From: Lars Ingebrigtsen Date: Fri, 22 Oct 2021 14:38:11 +0000 (+0200) Subject: Ensure valid end/beginning lines in message-mark-inserted-region X-Git-Tag: emacs-28.0.90~213 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1f6cdeb12c3cb8a86159cae9bfd638d8139c123e;p=emacs.git 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). --- diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index d460f9bd922..bbf1c78a01f 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -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))))