;; See admin/notes/bugtracker.
(log-edit-mode . ((log-edit-rewrite-fixes
"[ \n](bug#\\([0-9]+\\))" . "debbugs:\\1")
- (log-edit-font-lock-gnu-style . t)))
+ (log-edit-font-lock-gnu-style . t)
+ (log-edit-setup-add-author . t)))
(change-log-mode . ((add-log-time-zone-rule . t)
(fill-column . 74)
(bug-reference-url-format . "http://debbugs.gnu.org/%s")
+2013-12-01 Dmitry Gutov <dgutov@yandex.ru>
+
+ * vc/log-edit.el (log-edit-mode-map): Add binding for
+ `log-edit-beginning-of-line'.
+ (log-edit-setup-add-author): New user option.
+ (log-edit-beginning-of-line): New command.
+ (log-edit): Move major mode call above the contents setup so that
+ the local variable values are already applied.
+ (log-edit): Only insert "Author: " when
+ `log-edit-setup-add-author' is non-nil.
+ (log-edit): When SETUP is non-nil, position point after ": "
+ instead of point-min.
+
2013-12-01 Glenn Morris <rgm@gnu.org>
* startup.el (command-line): Warn if ~/emacs.d is in load-path.
(require 'add-log) ; for all the ChangeLog goodies
(require 'pcvs-util)
(require 'ring)
+(require 'message)
;;;;
;;;; Global Variables
("\C-c\C-a" . log-edit-insert-changelog)
("\C-c\C-d" . log-edit-show-diff)
("\C-c\C-f" . log-edit-show-files)
+ ("\C-a" . log-edit-beginning-of-line)
("\M-n" . log-edit-next-comment)
("\M-p" . log-edit-previous-comment)
("\M-r" . log-edit-comment-search-backward)
:group 'log-edit
:type 'boolean)
+(defcustom log-edit-setup-add-author nil
+ "Non-nil means `log-edit' should add the `Author:' header when
+its SETUP argument is non-nil."
+ :group 'log-edit
+ :type 'boolean
+ :safe 'booleanp)
+
(defcustom log-edit-hook '(log-edit-insert-cvs-template
log-edit-show-files
log-edit-insert-changelog)
(if buffer (pop-to-buffer buffer))
(when (and log-edit-setup-invert (not (eq setup 'force)))
(setq setup (not setup)))
- (when setup
- (erase-buffer)
- (insert "Summary: \nAuthor: ")
- (save-excursion (insert "\n\n")))
(if mode
(funcall mode)
(log-edit-mode))
+ (when setup
+ (erase-buffer)
+ (insert "Summary: ")
+ (when log-edit-setup-add-author
+ (insert "\nAuthor: "))
+ (insert "\n\n"))
(set (make-local-variable 'log-edit-callback) callback)
(if (listp params)
(dolist (crt params)
(if buffer (set (make-local-variable 'log-edit-parent-buffer) parent))
(set (make-local-variable 'log-edit-initial-files) (log-edit-files))
(when setup (run-hooks 'log-edit-hook))
- (goto-char (point-min)) (push-mark (point-max))
+ (if setup
+ (message-position-point)
+ (goto-char (point-min)))
+ (push-mark (point-max))
(message "%s" (substitute-command-keys
"Press \\[log-edit-done] when you are done editing."))))
(shrink-window-if-larger-than-buffer)
(selected-window)))))
+(defun log-edit-beginning-of-line (&optional n)
+ "Move point to beginning of header value or to beginning of line.
+
+It works the same as `message-beginning-of-line', but it uses a
+different header separator appropriate for `log-edit-mode'."
+ (interactive "p")
+ (let ((mail-header-separator ""))
+ (message-beginning-of-line n)))
+
(defun log-edit-empty-buffer-p ()
"Return non-nil if the buffer is \"empty\"."
(or (= (point-min) (point-max))