aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2011-10-27 22:50:05 -0400
committerStefan Monnier2011-10-27 22:50:05 -0400
commit7a6c0941742d41702fb56cd492d4897e476ebc25 (patch)
tree66245e54412d2fa36a6956fde2c0361cef18079c
parentb0c4cdcf1072b604e8470c634a0b6c0c9a43c1ab (diff)
downloademacs-7a6c0941742d41702fb56cd492d4897e476ebc25.tar.gz
emacs-7a6c0941742d41702fb56cd492d4897e476ebc25.zip
* 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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/vc/log-edit.el14
2 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e6e8c2fdb2e..be55e8410bf 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc/log-edit.el: Fill empty field rather than adding new one.
4 (log-edit-add-field): New function.
5 (log-edit-insert-changelog): Use it.
6
12011-10-28 Mark Lillibridge <mark.lillibridge@hp.com> (tiny change) 72011-10-28 Mark Lillibridge <mark.lillibridge@hp.com> (tiny change)
2 8
3 * mail/rmail.el (rmail-mode-map): Add M-C-f as in rmailsum (bug#9802). 9 * mail/rmail.el (rmail-mode-map): Add M-C-f as in rmailsum (bug#9802).
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index c421304442f..f57429c76c7 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -593,6 +593,13 @@ to build the Fixes: header.")
593(put 'log-edit-rewrite-fixes 'safe-local-variable 593(put 'log-edit-rewrite-fixes 'safe-local-variable
594 (lambda (v) (and (stringp (car-safe v)) (stringp (cdr v))))) 594 (lambda (v) (and (stringp (car-safe v)) (stringp (cdr v)))))
595 595
596(defun log-edit-add-field (field value)
597 (rfc822-goto-eoh)
598 (if (save-excursion (re-search-backward (concat "^" field ":\\([ \t]*\\)$")
599 nil t))
600 (replace-match (concat " " value) t t nil 1)
601 (insert field ": " value "\n" (if (looking-at "\n") "" "\n"))))
602
596(defun log-edit-insert-changelog (&optional use-first) 603(defun log-edit-insert-changelog (&optional use-first)
597 "Insert a log message by looking at the ChangeLog. 604 "Insert a log message by looking at the ChangeLog.
598The idea is to write your ChangeLog entries first, and then use this 605The idea is to write your ChangeLog entries first, and then use this
@@ -620,9 +627,7 @@ regardless of user name or time."
620 (log-edit-insert-changelog-entries (log-edit-files))))) 627 (log-edit-insert-changelog-entries (log-edit-files)))))
621 (log-edit-set-common-indentation) 628 (log-edit-set-common-indentation)
622 ;; Add an Author: field if appropriate. 629 ;; Add an Author: field if appropriate.
623 (when author 630 (when author (log-edit-add-field "Author" author))
624 (rfc822-goto-eoh)
625 (insert "Author: " author "\n" (if (looking-at "\n") "" "\n")))
626 ;; Add a Fixes: field if applicable. 631 ;; Add a Fixes: field if applicable.
627 (when (consp log-edit-rewrite-fixes) 632 (when (consp log-edit-rewrite-fixes)
628 (rfc822-goto-eoh) 633 (rfc822-goto-eoh)
@@ -632,8 +637,7 @@ regardless of user name or time."
632 (fixes (match-substitute-replacement 637 (fixes (match-substitute-replacement
633 (cdr log-edit-rewrite-fixes)))) 638 (cdr log-edit-rewrite-fixes))))
634 (delete-region start end) 639 (delete-region start end)
635 (rfc822-goto-eoh) 640 (log-edit-add-field "Fixes" fixes))))
636 (insert "Fixes: " fixes "\n" (if (looking-at "\n") "" "\n")))))
637 (and log-edit-strip-single-file-name 641 (and log-edit-strip-single-file-name
638 (progn (rfc822-goto-eoh) 642 (progn (rfc822-goto-eoh)
639 (if (looking-at "\n") (forward-char 1)) 643 (if (looking-at "\n") (forward-char 1))