aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/add-log.el
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2009-11-13 22:54:16 +0000
committerStefan Monnier <[email protected]>2009-11-13 22:54:16 +0000
commitd499c5b950a2aa8d6af470e672821f927d6e50c5 (patch)
tree4d05e4181cb508fa4fcb9c8c9e8767c2a1fa63b9 /lisp/add-log.el
parent7fdbcd83877ab0317df43e1120c583af3ba86bc4 (diff)
(add-change-log-entry): Avoid displaying the changelog a second time.
Diffstat (limited to 'lisp/add-log.el')
-rw-r--r--lisp/add-log.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/add-log.el b/lisp/add-log.el
index c3e8364f1f..1633a6441d 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -807,9 +807,15 @@ non-nil, otherwise in local time."
(item (add-log-file-name buffer-file file-name)))
(unless (equal file-name buffer-file-name)
- (if (or other-window (window-dedicated-p (selected-window)))
- (find-file-other-window file-name)
- (find-file file-name)))
+ (cond
+ ((equal file-name (buffer-file-name (window-buffer (selected-window))))
+ ;; If the selected window already shows the desired buffer don't show
+ ;; it again (particularly important if other-window is true).
+ ;; This is important for diff-add-change-log-entries-other-window.
+ (set-buffer (window-buffer (selected-window))))
+ ((or other-window (window-dedicated-p (selected-window)))
+ (find-file-other-window file-name))
+ (t (find-file file-name))))
(or (derived-mode-p 'change-log-mode)
(change-log-mode))
(undo-boundary)