aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc
diff options
context:
space:
mode:
authorPaul Eggert2011-10-29 10:33:13 -0700
committerPaul Eggert2011-10-29 10:33:13 -0700
commit8d0eb4c275581847990b85dbb350caa3df9e653f (patch)
treec161f977d59ac3103b04dc0f4aea57c83436a456 /lisp/vc
parent929bb973dd3faf1655f03ac758942d5b009354ad (diff)
parent196e41e4aec1a44ec5b6e9bed485185ba872ae67 (diff)
downloademacs-8d0eb4c275581847990b85dbb350caa3df9e653f.tar.gz
emacs-8d0eb4c275581847990b85dbb350caa3df9e653f.zip
Merge from trunk.
Diffstat (limited to 'lisp/vc')
-rw-r--r--lisp/vc/log-edit.el14
1 files changed, 9 insertions, 5 deletions
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))