emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master fddbd8c 2/2: Fix error in add-change-log-entry when


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master fddbd8c 2/2: Fix error in add-change-log-entry when the entry has no newline
Date: Wed, 24 Feb 2016 02:19:12 +0000

branch: master
commit fddbd8ca227d4dbd940e6dd72fecb35e26c3c27b
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Fix error in add-change-log-entry when the entry has no newline
    
    * lisp/vc/add-log.el (add-change-log-entry): The entry in the
    ChangeLog may end without a new line starting with blanks.
---
 lisp/vc/add-log.el |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el
index 112bc7b..d6c1fc2 100644
--- a/lisp/vc/add-log.el
+++ b/lisp/vc/add-log.el
@@ -911,8 +911,10 @@ non-nil, otherwise in local time."
                              "\\(\\s \\|[(),:]\\)")
                      bound t)))
              ;; Add to the existing item for the same file.
-             (re-search-forward "^\\s *$\\|^\\s \\*")
-             (goto-char (match-beginning 0))
+             (if (re-search-forward "^\\s *$\\|^\\s \\*" nil t)
+                 (goto-char (match-beginning 0))
+               (goto-char (point-max))
+               (insert "\n"))
              ;; Delete excess empty lines; make just 2.
              (while (and (not (eobp)) (looking-at "^\\s *$"))
                (delete-region (point) (line-beginning-position 2)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]