aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/log-edit.el28
-rw-r--r--lisp/vc.el9
4 files changed, 43 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 2e8c4b0ebf2..237c1d309cd 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -277,6 +277,9 @@ as a single changeset.
277 277
278*** In VC Annotate mode, you can type V to toggle the annotation visibility. 278*** In VC Annotate mode, you can type V to toggle the annotation visibility.
279 279
280** log-edit now has a command bound to C-c C-d to show the diff for
281the files involved.
282
280** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs. 283** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
281 284
282** The appearance of superscript and subscript in TeX is more customizable. 285** The appearance of superscript and subscript in TeX is more customizable.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6b976d8b8e4..2eaaf3cbe48 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12007-12-01 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * log-edit.el (log-edit-show-diff): New function.
4 (log-edit-mode-map, log-edit-menu): Bind it.
5 (log-edit-diff-function): New variable.
6 (log-edit): Change the 3rd param to be an alist and accept a
7 function that computes a diff for the files involved.
8
9 * vc.el (vc-log-edit): Add a diff function parameter to log-edit.
10
12007-12-01 Martin Rudalics <rudalics@gmx.at> 112007-12-01 Martin Rudalics <rudalics@gmx.at>
2 12
3 * play/blackbox.el (bb-up, bb-down): Revert 2007-10-21 change and 13 * play/blackbox.el (bb-up, bb-down): Revert 2007-10-21 change and
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 5c2cf989f62..46f1544d9eb 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -57,6 +57,7 @@
57(easy-mmode-defmap log-edit-mode-map 57(easy-mmode-defmap log-edit-mode-map
58 `(("\C-c\C-c" . log-edit-done) 58 `(("\C-c\C-c" . log-edit-done)
59 ("\C-c\C-a" . log-edit-insert-changelog) 59 ("\C-c\C-a" . log-edit-insert-changelog)
60 ("\C-c\C-d" . log-edit-show-diff)
60 ("\C-c\C-f" . log-edit-show-files) 61 ("\C-c\C-f" . log-edit-show-files)
61 ("\M-n" . log-edit-next-comment) 62 ("\M-n" . log-edit-next-comment)
62 ("\M-p" . log-edit-previous-comment) 63 ("\M-p" . log-edit-previous-comment)
@@ -79,6 +80,8 @@
79 ["Insert ChangeLog" log-edit-insert-changelog] 80 ["Insert ChangeLog" log-edit-insert-changelog]
80 ["Add to ChangeLog" log-edit-add-to-changelog] 81 ["Add to ChangeLog" log-edit-add-to-changelog]
81 "--" 82 "--"
83 ["Show diff" log-edit-show-diff
84 :help "Show the diff for the files to be committed."]
82 ["List files" log-edit-show-files 85 ["List files" log-edit-show-files
83 :help "Show the list of relevant files."] 86 :help "Show the list of relevant files."]
84 "--" 87 "--"
@@ -170,6 +173,7 @@ when this variable is set to nil.")
170(defconst log-edit-files-buf "*log-edit-files*") 173(defconst log-edit-files-buf "*log-edit-files*")
171(defvar log-edit-initial-files nil) 174(defvar log-edit-initial-files nil)
172(defvar log-edit-callback nil) 175(defvar log-edit-callback nil)
176(defvar log-edit-diff-function nil)
173(defvar log-edit-listfun nil) 177(defvar log-edit-listfun nil)
174(defvar log-edit-parent-buffer nil) 178(defvar log-edit-parent-buffer nil)
175 179
@@ -301,7 +305,7 @@ automatically."
301 (2 font-lock-function-name-face)))) 305 (2 font-lock-function-name-face))))
302 306
303;;;###autoload 307;;;###autoload
304(defun log-edit (callback &optional setup listfun buffer &rest ignore) 308(defun log-edit (callback &optional setup params buffer &rest ignore)
305 "Setup a buffer to enter a log message. 309 "Setup a buffer to enter a log message.
306\\<log-edit-mode-map>The buffer will be put in `log-edit-mode'. 310\\<log-edit-mode-map>The buffer will be put in `log-edit-mode'.
307If SETUP is non-nil, the buffer is then erased and `log-edit-hook' is run. 311If SETUP is non-nil, the buffer is then erased and `log-edit-hook' is run.
@@ -309,8 +313,13 @@ Mark and point will be set around the entire contents of the
309buffer so that it is easy to kill the contents of the buffer with \\[kill-region]. 313buffer so that it is easy to kill the contents of the buffer with \\[kill-region].
310Once you're done editing the message, pressing \\[log-edit-done] will call 314Once you're done editing the message, pressing \\[log-edit-done] will call
311`log-edit-done' which will end up calling CALLBACK to do the actual commit. 315`log-edit-done' which will end up calling CALLBACK to do the actual commit.
312LISTFUN if non-nil is a function of no arguments returning the list of files 316PARAMS if non-nil is an alist. The keys for the alist can be:
313 that are concerned by the current operation (using relative names). 317`log-edit-listfun' and `log-edit-diff-function'. The associated
318value for `log-edit-listfun' should be a function with not
319arguments that returns the list of files that are concerned by
320the current operation (using relative names). The associated
321value for `log-edit-diff-function' should be a function with no
322arguments that displays a diff of the files concerned by the current operation.
314If BUFFER is non-nil `log-edit' will jump to that buffer, use it to edit the 323If BUFFER is non-nil `log-edit' will jump to that buffer, use it to edit the
315 log message and go back to the current buffer when done. Otherwise, it 324 log message and go back to the current buffer when done. Otherwise, it
316 uses the current buffer." 325 uses the current buffer."
@@ -321,7 +330,13 @@ If BUFFER is non-nil `log-edit' will jump to that buffer, use it to edit the
321 (when setup (erase-buffer)) 330 (when setup (erase-buffer))
322 (log-edit-mode) 331 (log-edit-mode)
323 (set (make-local-variable 'log-edit-callback) callback) 332 (set (make-local-variable 'log-edit-callback) callback)
324 (set (make-local-variable 'log-edit-listfun) listfun) 333 (if (listp params)
334 (dolist (crt params)
335 (set (make-local-variable (car crt)) (cdr crt)))
336 ;; For backward compatibility with log-edit up to version 22.2
337 ;; accept non-list PARAMS to mean `log-edit-list'.
338 (set (make-local-variable 'log-edit-listfun) params))
339
325 (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent)) 340 (if buffer (set (make-local-variable 'log-edit-parent-buffer) parent))
326 (set (make-local-variable 'log-edit-initial-files) (log-edit-files)) 341 (set (make-local-variable 'log-edit-initial-files) (log-edit-files))
327 (when setup (run-hooks 'log-edit-hook)) 342 (when setup (run-hooks 'log-edit-hook))
@@ -417,6 +432,11 @@ If you want to abort the commit, simply delete the buffer."
417 (indent-rigidly (point-min) (point-max) 432 (indent-rigidly (point-min) (point-max)
418 (- log-edit-common-indent common))))) 433 (- log-edit-common-indent common)))))
419 434
435(defun log-edit-show-diff ()
436 "Show the diff for the files to be committed."
437 (interactive)
438 (funcall log-edit-diff-function))
439
420(defun log-edit-show-files () 440(defun log-edit-show-files ()
421 "Show the list of files to be committed." 441 "Show the list of files to be committed."
422 (interactive) 442 (interactive)
diff --git a/lisp/vc.el b/lisp/vc.el
index 74e949a4a3c..622c9682fbc 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -83,8 +83,8 @@
83;; to be installed somewhere on Emacs's path for executables. 83;; to be installed somewhere on Emacs's path for executables.
84;; 84;;
85;; If your site uses the ChangeLog convention supported by Emacs, the 85;; If your site uses the ChangeLog convention supported by Emacs, the
86;; function log-edit-comment-to-change-log could prove a useful checkin hook, 86;; function `log-edit-comment-to-change-log' could prove a useful checkin hook,
87;; although you might prefer to use C-c C-a (i.e. log-edit-insert-changelog) 87;; although you might prefer to use C-c C-a (i.e. `log-edit-insert-changelog')
88;; from the commit buffer instead or to set `log-edit-setup-invert'. 88;; from the commit buffer instead or to set `log-edit-setup-invert'.
89;; 89;;
90;; The vc code maintains some internal state in order to reduce expensive 90;; The vc code maintains some internal state in order to reduce expensive
@@ -3577,7 +3577,10 @@ The annotations are relative to the current time, unless overridden by OFFSET."
3577 "Set up `log-edit' for use with VC on FILE." 3577 "Set up `log-edit' for use with VC on FILE."
3578 (setq default-directory 3578 (setq default-directory
3579 (with-current-buffer vc-parent-buffer default-directory)) 3579 (with-current-buffer vc-parent-buffer default-directory))
3580 (log-edit 'vc-finish-logentry nil `(lambda () ',fileset)) 3580 (log-edit 'vc-finish-logentry
3581 nil
3582 `((log-edit-listfun . (lambda () ',fileset))
3583 (log-edit-diff-function . (lambda () (vc-diff nil)))))
3581 (set (make-local-variable 'vc-log-fileset) fileset) 3584 (set (make-local-variable 'vc-log-fileset) fileset)
3582 (make-local-variable 'vc-log-revision) 3585 (make-local-variable 'vc-log-revision)
3583 (set-buffer-modified-p nil) 3586 (set-buffer-modified-p nil)