changeset 52791:2ea08fedb58f

(log-edit-changelog-entries): Prefer local value of change-log-default-name in the buffer visiting the file.
author Andreas Schwab <schwab@suse.de>
date Mon, 06 Oct 2003 22:52:52 +0000
parents a93f1f4e2e49
children 52ec5e8bdb21
files lisp/log-edit.el
diffstat 1 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/log-edit.el	Mon Oct 06 21:54:09 2003 +0000
+++ b/lisp/log-edit.el	Mon Oct 06 22:52:52 2003 +0000
@@ -564,12 +564,21 @@
   (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))