summaryrefslogtreecommitdiff
path: root/lisp/pcvs.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-09-08 03:11:43 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-09-08 03:11:43 +0000
commitfd071fdf4c359784557d16b4e5790d81ea3d05a0 (patch)
tree0d2a1e9e70f71936d4a2e5926f0ecf7d999d877e /lisp/pcvs.el
parentb7e5bc1c44850833ad2c0e0b2b72cf789c372b24 (diff)
downloademacs-fd071fdf4c359784557d16b4e5790d81ea3d05a0.tar.gz
(cvs-mode-add-change-log-entry-other-window): Use
add-log-buffer-file-name-function rather than bind buffer-file-name, so we dont end up calling change-log-mode in *cvs* when `fi' is the ChangeLog file itself.
Diffstat (limited to 'lisp/pcvs.el')
-rw-r--r--lisp/pcvs.el18
1 files changed, 13 insertions, 5 deletions
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 29530043447..d533796ee50 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -2210,13 +2210,21 @@ With prefix argument, prompt for cvs flags."
(defun-cvs-mode cvs-mode-add-change-log-entry-other-window ()
"Add a ChangeLog entry in the ChangeLog of the current directory."
(interactive)
+ ;; Require `add-log' explicitly, because if it gets autoloaded when we call
+ ;; add-change-log-entry-other-window below, the
+ ;; add-log-buffer-file-name-function ends up unbound when we leave the `let'.
+ (require 'add-log)
(dolist (fi (cvs-mode-marked nil nil))
(let* ((default-directory (cvs-expand-dir-name (cvs-fileinfo->dir fi)))
- (buffer-file-name (expand-file-name (cvs-fileinfo->file fi))))
- (if (file-directory-p buffer-file-name)
- ;; Be careful to use a directory name, otherwise add-log starts
- ;; looking for a ChangeLog file in the parent dir.
- (setq buffer-file-name (file-name-as-directory buffer-file-name)))
+ (add-log-buffer-file-name-function
+ (lambda ()
+ (let ((file (expand-file-name (cvs-fileinfo->file fi))))
+ (if (file-directory-p file)
+ ;; Be careful to use a directory name, otherwise add-log
+ ;; starts looking for a ChangeLog file in the
+ ;; parent dir.
+ (file-name-as-directory file)
+ file)))))
(kill-local-variable 'change-log-default-name)
(save-excursion (add-change-log-entry-other-window)))))