From 1f6cdeb12c3cb8a86159cae9bfd638d8139c123e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 22 Oct 2021 16:38:11 +0200 Subject: [PATCH] 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). --- lisp/gnus/message.el | 2 ++ 1 file changed, 2 insertions(+) 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)))) -- 2.39.2