Mercurial > emacs
diff lisp/vc-dispatcher.el @ 107430:1918e70c8b37
Add special markup processing for commit logs.
* log-edit.el (log-edit-extra-flags): New variable.
(log-edit): Add new argument MODE. Use that mode when non-nil
instead of the log-view-mode.
(log-view-process-buffer): New function.
* vc.el: Document that the checkin method takes optional
arguments. Document new backend specific method: log-view-mode.
(vc-default-log-edit-mode): New function.
(vc-checkin): Use a backend specific log-view-mode.
Pass extra arguments to the checkin method.
(vc-modify-change-comment): Pass a dummy extra argument.
* vc-dispatcher.el (vc-log-edit): Add a mode argument, pass it to
log-edit.
(vc-start-logentry): Add a mode argument, pass it to vc-log-edit.
(vc-finish-logentry): Process the log buffer before passing it
down. Pass log-edit-extra-flags.
* vc-bzr.el (vc-bzr-checkin): Pass extra arguments to the commit
command.
(log-edit-extra-flags, log-edit-before-checkin-process): New declarations.
* vc-hg.el (vc-hg-checkin): Pass extra arguments to the commit
command.
(log-edit-extra-flags, log-edit-before-checkin-process): New declarations.
(vc-hg-log-edit-mode): New derived mode.
* vc-arch.el (vc-arch-checkin):
* vc-cvs.el (vc-cvs-checkin):
* vc-git.el (vc-git-checkin):
* vc-mtn.el (vc-mtn-checkin):
* vc-rcs.el (vc-rcs-checkin):
* vc-sccs.el (vc-sccs-checkin):
* vc-svn.el (vc-svn-checkin): Add an optional ignored argument.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Fri, 19 Mar 2010 02:37:41 -0700 |
parents | 6427b60ed4f2 |
children | 11244653958e |
line wrap: on
line diff
--- a/lisp/vc-dispatcher.el Thu Mar 18 23:32:47 2010 -0400 +++ b/lisp/vc-dispatcher.el Fri Mar 19 02:37:41 2010 -0700 @@ -522,20 +522,22 @@ ;; Set up key bindings for use while editing log messages -(defun vc-log-edit (fileset) +(defun vc-log-edit (fileset mode) "Set up `log-edit' for use on FILE." (setq default-directory (with-current-buffer vc-parent-buffer default-directory)) (log-edit 'vc-finish-logentry nil `((log-edit-listfun . (lambda () ',fileset)) - (log-edit-diff-function . (lambda () (vc-diff nil))))) + (log-edit-diff-function . (lambda () (vc-diff nil)))) + nil + mode) (set (make-local-variable 'vc-log-fileset) fileset) (make-local-variable 'vc-log-extra) (set-buffer-modified-p nil) (setq buffer-file-name nil)) -(defun vc-start-logentry (files extra comment initial-contents msg logbuf action &optional after-hook) +(defun vc-start-logentry (files extra comment initial-contents msg logbuf mode action &optional after-hook) "Accept a comment for an operation on FILES with extra data EXTRA. If COMMENT is nil, pop up a LOGBUF buffer, emit MSG, and set the action on close to ACTION. If COMMENT is a string and @@ -560,7 +562,7 @@ (set (make-local-variable 'vc-parent-buffer) parent) (set (make-local-variable 'vc-parent-buffer-name) (concat " from " (buffer-name vc-parent-buffer))) - (vc-log-edit files) + (vc-log-edit files mode) (make-local-variable 'vc-log-after-operation-hook) (when after-hook (setq vc-log-after-operation-hook after-hook)) @@ -590,12 +592,16 @@ (or (vc-dispatcher-browsing) (vc-buffer-sync))) (unless vc-log-operation (error "No log operation is pending")) + + (log-view-process-buffer) + ;; save the parameters held in buffer-local variables (let ((logbuf (current-buffer)) (log-operation vc-log-operation) (log-fileset vc-log-fileset) (log-extra vc-log-extra) (log-entry (buffer-string)) + (extra-flags log-edit-extra-flags) (after-hook vc-log-after-operation-hook) (tmp-vc-parent-buffer vc-parent-buffer)) (pop-to-buffer vc-parent-buffer) @@ -604,7 +610,9 @@ (funcall log-operation log-fileset log-extra - log-entry)) + log-entry + extra-flags + )) ;; Remove checkin window (after the checkin so that if that fails ;; we don't zap the log buffer and the typing therein). ;; -- IMO this should be replaced with quit-window