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.
This commit is contained in:
Eric Abrahamsen 2023-09-23 15:33:53 -07:00
parent 9babf61145
commit 450ca9951a

View 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