From fe62315ef35c301d1fa0e1614d6bbbc83dbeef81 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sat, 14 Oct 2023 20:47:57 +0300 Subject: [PATCH] Fix vc-hg-log-edit-toggle-amend * lisp/vc/log-edit.el (log-edit--toggle-amend): Handle the case when the VCS returns log entry that doesn't end with a newline (bug#66423). --- lisp/vc/log-edit.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 1e249c637a6..c77f4494c1a 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -1219,7 +1219,10 @@ line of MSG." (let ((pt (point))) (and (zerop (forward-line 1)) (looking-at "\n\\|\\'") - (let ((summary (buffer-substring-no-properties pt (1- (point))))) + (let ((summary (buffer-substring-no-properties pt + (if (bolp) + (1- (point)) + (point))))) (skip-chars-forward " \n") (delete-region pt (point)) (log-edit-set-header "Summary" summary))))))) -- 2.39.2