Commit 52789f7f authored by Dmitry Gutov's avatar Dmitry Gutov

Apply the initial log-edit tweaks discussed at emacs-devel

* .dir-locals.el: (log-edit-move): Add the "Author: " header.

* lisp/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.
parent 2e6710c3
......@@ -7,7 +7,8 @@
;; 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>
* .dir-locals.el: (log-edit-move): Add the "Author: " header.
2013-11-30 Dani Moncayo <dmoncayo@gmail.com>
* build-aux/msys-to-w32 (w32pathlist): Do not translate paths
......
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.
......
......@@ -32,6 +32,7 @@
(require 'add-log) ; for all the ChangeLog goodies
(require 'pcvs-util)
(require 'ring)
(require 'message)
;;;;
;;;; Global Variables
......@@ -55,6 +56,7 @@
("\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)
......@@ -116,6 +118,13 @@ If SETUP is 'force, this variable has no effect."
: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)
......@@ -427,13 +436,15 @@ done. Otherwise, it uses the current buffer."
(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)
......@@ -445,7 +456,10 @@ done. Otherwise, it uses the current buffer."
(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."))))
......@@ -574,6 +588,15 @@ If you want to abort the commit, simply delete the buffer."
(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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment