]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix vc-hg-log-edit-toggle-amend
authorDmitry Gutov <dmitry@gutov.dev>
Sat, 14 Oct 2023 17:47:57 +0000 (20:47 +0300)
committerDmitry Gutov <dmitry@gutov.dev>
Sat, 14 Oct 2023 17:47:57 +0000 (20:47 +0300)
* 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

index 1e249c637a61b9e6128f8597170a9b77c198ca49..c77f4494c1ac70e86572af3d1f9f72b57b3778d3 100644 (file)
@@ -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)))))))