mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
Clear buffer-undo-list after sending input in ERC
* lisp/erc/erc.el (erc-insert-line): Assume `erc-insert-marker' points somewhere. (erc-send-current-line): Set `buffer-undo-list' to nil because it should only record editing changes in the prompt area, which has just been cleared. ERC did this via `erc-display-prompt' prior to 5.6, but it now leaves the prompt alone by default. * test/lisp/erc/erc-tests.el (erc-update-undo-list): New test. (Bug#74518)
This commit is contained in:
parent
b5f1a9e6d3
commit
e0d2c6f20f
2 changed files with 83 additions and 6 deletions
|
|
@ -3515,8 +3515,7 @@ modification hooks)."
|
|||
(add-text-properties (point-min) (1+ (point-min)) props)))
|
||||
(erc--refresh-prompt)))))
|
||||
(run-hooks 'erc-insert-done-hook)
|
||||
(erc-update-undo-list (- (or (marker-position (or erc--insert-marker
|
||||
erc-insert-marker))
|
||||
(erc-update-undo-list (- (or erc--insert-marker erc-insert-marker
|
||||
(point-max))
|
||||
insert-position))))))
|
||||
|
||||
|
|
@ -8200,10 +8199,9 @@ ERC prints them as a single message joined by newlines.")
|
|||
;; Fix the buffer if the command didn't kill it
|
||||
(when (buffer-live-p old-buf)
|
||||
(with-current-buffer old-buf
|
||||
(save-restriction
|
||||
(widen)
|
||||
(let ((buffer-modified (buffer-modified-p)))
|
||||
(set-buffer-modified-p buffer-modified))))))
|
||||
(setq buffer-undo-list nil)
|
||||
;; `set-buffer-modified-p' used to do this here.
|
||||
(force-mode-line-update))))
|
||||
|
||||
;; Only when last hook has been run...
|
||||
(run-hook-with-args 'erc-send-completed-hook str)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue