diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-23 11:55:13 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-10-23 11:55:13 +0200 |
commit | b7037662e1111d55218fb2345f9ebb9ed3ebef13 (patch) | |
tree | 6121349d6b192260c84088d799549dc897b38d29 /lisp/erc/erc.el | |
parent | 496202d00ead9cdb649443f831e3cc8dfcf6aadd (diff) | |
download | emacs-b7037662e1111d55218fb2345f9ebb9ed3ebef13.tar.gz emacs-b7037662e1111d55218fb2345f9ebb9ed3ebef13.tar.bz2 emacs-b7037662e1111d55218fb2345f9ebb9ed3ebef13.zip |
Ensure that the prompt is kept on the final line
* lisp/erc/erc-goodies.el (erc-possibly-scroll-to-bottom): New
function.
(scrolltobottom): Add to erc-insert-done-hook.
* lisp/erc/erc.el (erc-insert-done-hook): New hook (bug#11697).
(erc-display-line-1): Use it.
Diffstat (limited to 'lisp/erc/erc.el')
-rw-r--r-- | lisp/erc/erc.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 86f103ef231..1c5ecf99c6b 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1097,6 +1097,14 @@ At this point, all modifications from prior hook functions are done." erc-make-read-only erc-save-buffer-in-logs)) +(defcustom erc-insert-done-hook nil + "This hook is called after inserting strings into the buffer. +This hook is not called from inside `save-excursion' and should +preserve point if needed." + :group 'erc-hooks + :version "27.1" + :type 'hook) + (defcustom erc-send-modify-hook nil "Sending hook for functions that will change the text's appearance. This hook is called just after `erc-send-pre-hook' when the values @@ -2419,6 +2427,7 @@ If STRING is nil, the function does nothing." (when erc-remove-parsed-property (remove-text-properties (point-min) (point-max) '(erc-parsed nil)))))))) + (run-hooks 'erc-insert-done-hook) (erc-update-undo-list (- (or (marker-position erc-insert-marker) (point-max)) insert-position)))))) |