summaryrefslogtreecommitdiff
path: root/lisp/log-edit.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-06-26 16:40:26 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-06-26 16:40:26 +0000
commitd944ee49ddcfab0f3425022cc19724952fe3e1be (patch)
treeb201090854f33b0758da96924646a1049a09c15a /lisp/log-edit.el
parent0b0dad411fa205045749e8c767fe5e2201689560 (diff)
downloademacs-d944ee49ddcfab0f3425022cc19724952fe3e1be.tar.gz
(log-edit-changelog-entries): Use with-current-buffer.
Diffstat (limited to 'lisp/log-edit.el')
-rw-r--r--lisp/log-edit.el36
1 files changed, 17 insertions, 19 deletions
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 8f63635ee49..b59a6a61a9b 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -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)))