changeset 105995:d90116e2656a

(add-change-log-entry): Avoid displaying the changelog a second time.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 13 Nov 2009 22:54:16 +0000
parents 009383a57ce8
children 5bb289ba7169
files lisp/ChangeLog lisp/add-log.el
diffstat 2 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 13 22:19:45 2009 +0000
+++ b/lisp/ChangeLog	Fri Nov 13 22:54:16 2009 +0000
@@ -1,5 +1,8 @@
 2009-11-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* add-log.el (add-change-log-entry): Avoid displaying the changelog
+	a second time.
+
 	* x-dnd.el (x-dnd-maybe-call-test-function):
 	* window.el (split-window-vertically):
 	* whitespace.el (whitespace-help-on):
--- a/lisp/add-log.el	Fri Nov 13 22:19:45 2009 +0000
+++ b/lisp/add-log.el	Fri Nov 13 22:54:16 2009 +0000
@@ -807,9 +807,15 @@
 	 (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)