(calendar-absolute-from-julian): Declare as a function.
[bpt/emacs.git] / lisp / log-edit.el
index 8f63635..5c2cf98 100644 (file)
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -568,7 +568,7 @@ for more details."
 (defvar user-mail-address)
 (defun log-edit-changelog-ours-p ()
   "See if ChangeLog entry at point is for the current user, today.
-Return non-nil iff it is."
+Return non-nil if it is."
   ;; Code adapted from add-change-log-entry.
   (let ((name (or (and (boundp 'add-log-full-name) add-log-full-name)
                  (and (fboundp 'user-full-name) (user-full-name))
@@ -590,25 +590,23 @@ The return value looks like this:
   (LOGBUFFER (ENTRYSTART . ENTRYEND) ...)
 where LOGBUFFER is the name of the ChangeLog buffer, and each
 \(ENTRYSTART . ENTRYEND\) pair is a buffer region."
-  (save-excursion
-    (let ((changelog-file-name
-          (let ((default-directory
-                  (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))
+  (let ((changelog-file-name
+         (let ((default-directory
+                 (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))
+               (with-current-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)))))
+    (with-current-buffer (find-file-noselect changelog-file-name)
       (unless (eq major-mode 'change-log-mode) (change-log-mode))
       (goto-char (point-min))
       (if (looking-at "\\s-*\n") (goto-char (match-end 0)))