From 496202d00ead9cdb649443f831e3cc8dfcf6aadd Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 23 Oct 2019 11:13:54 +0200 Subject: [PATCH] Make erc-cmd-CLEAR do what its doc string says * lisp/erc/erc.el (erc-cmd-CLEAR): Delete the buffer contents instead of recentering (bug#31743). --- lisp/erc/erc.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 65a4d5034de..86f103ef231 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2939,7 +2939,8 @@ If no USER argument is specified, list the contents of `erc-ignore-list'." (defun erc-cmd-CLEAR () "Clear the window content." - (recenter 0) + (let ((inhibit-read-only t)) + (delete-region (point-min) (line-beginning-position))) t) (put 'erc-cmd-CLEAR 'process-not-needed t) -- 2.39.2