diff options
| author | Stefan Monnier | 2007-09-08 03:11:43 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-09-08 03:11:43 +0000 |
| commit | fd071fdf4c359784557d16b4e5790d81ea3d05a0 (patch) | |
| tree | 0d2a1e9e70f71936d4a2e5926f0ecf7d999d877e | |
| parent | b7e5bc1c44850833ad2c0e0b2b72cf789c372b24 (diff) | |
| download | emacs-fd071fdf4c359784557d16b4e5790d81ea3d05a0.tar.gz emacs-fd071fdf4c359784557d16b4e5790d81ea3d05a0.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/pcvs.el | 18 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58bd6a36f35..055cdc75af3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2007-09-08 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-09-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * pcvs.el (cvs-mode-add-change-log-entry-other-window): Use | ||
| 4 | add-log-buffer-file-name-function rather than bind buffer-file-name, | ||
| 5 | so we dont end up calling change-log-mode in *cvs* when `fi' is the | ||
| 6 | ChangeLog file itself. | ||
| 7 | |||
| 3 | * outline.el (outline-flag-region): Use front-advance. | 8 | * outline.el (outline-flag-region): Use front-advance. |
| 4 | 9 | ||
| 5 | 2007-09-07 Ilya Zakharevich <ilyaz@cpan.org> | 10 | 2007-09-07 Ilya Zakharevich <ilyaz@cpan.org> |
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." | |||
| 2210 | (defun-cvs-mode cvs-mode-add-change-log-entry-other-window () | 2210 | (defun-cvs-mode cvs-mode-add-change-log-entry-other-window () |
| 2211 | "Add a ChangeLog entry in the ChangeLog of the current directory." | 2211 | "Add a ChangeLog entry in the ChangeLog of the current directory." |
| 2212 | (interactive) | 2212 | (interactive) |
| 2213 | ;; Require `add-log' explicitly, because if it gets autoloaded when we call | ||
| 2214 | ;; add-change-log-entry-other-window below, the | ||
| 2215 | ;; add-log-buffer-file-name-function ends up unbound when we leave the `let'. | ||
| 2216 | (require 'add-log) | ||
| 2213 | (dolist (fi (cvs-mode-marked nil nil)) | 2217 | (dolist (fi (cvs-mode-marked nil nil)) |
| 2214 | (let* ((default-directory (cvs-expand-dir-name (cvs-fileinfo->dir fi))) | 2218 | (let* ((default-directory (cvs-expand-dir-name (cvs-fileinfo->dir fi))) |
| 2215 | (buffer-file-name (expand-file-name (cvs-fileinfo->file fi)))) | 2219 | (add-log-buffer-file-name-function |
| 2216 | (if (file-directory-p buffer-file-name) | 2220 | (lambda () |
| 2217 | ;; Be careful to use a directory name, otherwise add-log starts | 2221 | (let ((file (expand-file-name (cvs-fileinfo->file fi)))) |
| 2218 | ;; looking for a ChangeLog file in the parent dir. | 2222 | (if (file-directory-p file) |
| 2219 | (setq buffer-file-name (file-name-as-directory buffer-file-name))) | 2223 | ;; Be careful to use a directory name, otherwise add-log |
| 2224 | ;; starts looking for a ChangeLog file in the | ||
| 2225 | ;; parent dir. | ||
| 2226 | (file-name-as-directory file) | ||
| 2227 | file))))) | ||
| 2220 | (kill-local-variable 'change-log-default-name) | 2228 | (kill-local-variable 'change-log-default-name) |
| 2221 | (save-excursion (add-change-log-entry-other-window))))) | 2229 | (save-excursion (add-change-log-entry-other-window))))) |
| 2222 | 2230 | ||