[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r106212: * lisp/vc/log-edit.el: Fill
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r106212: * lisp/vc/log-edit.el: Fill empty field rather than adding new one. |
Date: |
Thu, 27 Oct 2011 22:50:05 -0400 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 106212
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2011-10-27 22:50:05 -0400
message:
* lisp/vc/log-edit.el: Fill empty field rather than adding new one.
(log-edit-add-field): New function.
(log-edit-insert-changelog): Use it.
modified:
lisp/ChangeLog
lisp/vc/log-edit.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-10-28 02:47:43 +0000
+++ b/lisp/ChangeLog 2011-10-28 02:50:05 +0000
@@ -1,3 +1,9 @@
+2011-10-28 Stefan Monnier <address@hidden>
+
+ * vc/log-edit.el: Fill empty field rather than adding new one.
+ (log-edit-add-field): New function.
+ (log-edit-insert-changelog): Use it.
+
2011-10-28 Mark Lillibridge <address@hidden> (tiny change)
* mail/rmail.el (rmail-mode-map): Add M-C-f as in rmailsum (bug#9802).
=== modified file 'lisp/vc/log-edit.el'
--- a/lisp/vc/log-edit.el 2011-10-19 21:43:41 +0000
+++ b/lisp/vc/log-edit.el 2011-10-28 02:50:05 +0000
@@ -593,6 +593,13 @@
(put 'log-edit-rewrite-fixes 'safe-local-variable
(lambda (v) (and (stringp (car-safe v)) (stringp (cdr v)))))
+(defun log-edit-add-field (field value)
+ (rfc822-goto-eoh)
+ (if (save-excursion (re-search-backward (concat "^" field ":\\([ \t]*\\)$")
+ nil t))
+ (replace-match (concat " " value) t t nil 1)
+ (insert field ": " value "\n" (if (looking-at "\n") "" "\n"))))
+
(defun log-edit-insert-changelog (&optional use-first)
"Insert a log message by looking at the ChangeLog.
The idea is to write your ChangeLog entries first, and then use this
@@ -620,9 +627,7 @@
(log-edit-insert-changelog-entries (log-edit-files)))))
(log-edit-set-common-indentation)
;; Add an Author: field if appropriate.
- (when author
- (rfc822-goto-eoh)
- (insert "Author: " author "\n" (if (looking-at "\n") "" "\n")))
+ (when author (log-edit-add-field "Author" author))
;; Add a Fixes: field if applicable.
(when (consp log-edit-rewrite-fixes)
(rfc822-goto-eoh)
@@ -632,8 +637,7 @@
(fixes (match-substitute-replacement
(cdr log-edit-rewrite-fixes))))
(delete-region start end)
- (rfc822-goto-eoh)
- (insert "Fixes: " fixes "\n" (if (looking-at "\n") "" "\n")))))
+ (log-edit-add-field "Fixes" fixes))))
(and log-edit-strip-single-file-name
(progn (rfc822-goto-eoh)
(if (looking-at "\n") (forward-char 1))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r106212: * lisp/vc/log-edit.el: Fill empty field rather than adding new one.,
Stefan Monnier <=