diff options
author | Andreas Schwab <schwab@suse.de> | 2003-10-06 22:52:52 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2003-10-06 22:52:52 +0000 |
commit | 44d7d150a1110c0457fa75386023f2853af2651e (patch) | |
tree | f9dd8161bcd9a949b5ce18a1f96b54f09d8f48cd /lisp/log-edit.el | |
parent | 38572aef38ed4cab8a2ec2286a25841172d5b4fa (diff) | |
download | emacs-44d7d150a1110c0457fa75386023f2853af2651e.tar.gz |
(log-edit-changelog-entries): Prefer local value of
change-log-default-name in the buffer visiting the file.
Diffstat (limited to 'lisp/log-edit.el')
-rw-r--r-- | lisp/log-edit.el | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lisp/log-edit.el b/lisp/log-edit.el index 31bf7add457..fa7ea4e842d 100644 --- a/lisp/log-edit.el +++ b/lisp/log-edit.el @@ -564,12 +564,21 @@ where LOGBUFFER is the name of the ChangeLog buffer, and each (save-excursion (let ((changelog-file-name (let ((default-directory - (file-name-directory (expand-file-name file)))) - ;; `find-change-log' uses `change-log-default-name' if set - ;; and sets it before exiting, so we need to work around - ;; that memoizing which is undesired here - (setq change-log-default-name nil) - (find-change-log)))) + (file-name-directory (expand-file-name file))) + (visiting-buffer (find-buffer-visiting file))) + ;; If there is a buffer visiting FILE, and it has a local + ;; value for `change-log-default-name', use that. + (if (and visiting-buffer + (local-variable-p 'change-log-default-name + visiting-buffer)) + (save-excursion + (set-buffer visiting-buffer) + change-log-default-name) + ;; `find-change-log' uses `change-log-default-name' if set + ;; and sets it before exiting, so we need to work around + ;; that memoizing which is undesired here + (setq change-log-default-name nil) + (find-change-log))))) (set-buffer (find-file-noselect changelog-file-name)) (unless (eq major-mode 'change-log-mode) (change-log-mode)) (goto-char (point-min)) |