Ensure valid end/beginning lines in message-mark-inserted-region

* lisp/gnus/message.el (message-mark-inserted-region): Ensure
there's a newline before inserting the end line (bug#51324).
This commit is contained in:
Lars Ingebrigtsen 2021-10-22 16:38:11 +02:00
parent 9b46150ab0
commit 1f6cdeb12c

View file

@ -2395,6 +2395,8 @@ If VERBATIM, use slrn style verbatim marks (\"#v+\" and \"#v-\")."
(save-excursion
;; add to the end of the region first, otherwise end would be invalid
(goto-char end)
(unless (bolp)
(insert "\n"))
(insert (if verbatim "#v-\n" message-mark-insert-end))
(goto-char beg)
(insert (if verbatim "#v+\n" message-mark-insert-begin))))