From: Eric Abrahamsen Date: Sat, 23 Sep 2023 22:33:53 +0000 (-0700) Subject: Use delete-region in Gnus message yanking X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=450ca9951a87a055eb00bd161a372cc1de02736f;p=emacs.git Use delete-region in Gnus message yanking See Bug#66106 * lisp/gnus/gnus-msg.el (gnus-summary-reply): Not erase-buffer. The intention was to narrow the buffer to the headers, and then delete just those headers. But erase-buffer doesn't respect narrowing, so use (delete-region (point-min) (point-max)) instead. --- diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 0439bf0d59b..b065ae34851 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1104,12 +1104,12 @@ If VERY-WIDE, make a very wide reply." (setq headers (concat headers (buffer-string))))))) (set-buffer (gnus-copy-article-buffer)) (gnus-msg-treat-broken-reply-to gnus-msg-force-broken-reply-to) - (save-restriction - (message-narrow-to-head) - (when very-wide - (erase-buffer) - (insert headers)) - (goto-char (point-max))) + (when very-wide + (save-restriction + (message-narrow-to-head) + (delete-region (point-min) (point-max)) + (insert headers) + (goto-char (point-max)))) (mml-quote-region (point) (point-max)) (message-reply nil wide) (when yank