]> git.eshelyaron.com Git - emacs.git/commitdiff
Use delete-region in Gnus message yanking
authorEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 23 Sep 2023 22:33:53 +0000 (15:33 -0700)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 23 Sep 2023 22:33:53 +0000 (15:33 -0700)
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.

lisp/gnus/gnus-msg.el

index 0439bf0d59b4f54d8eaa15d26ab42abe147cc668..b065ae348515bcebeb2d5b3752bd7cb1bf58d144 100644 (file)
@@ -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