]> git.eshelyaron.com Git - emacs.git/commitdiff
(choose-completion): Try reselecting completion-reference-buffer.
authorChong Yidong <cyd@stupidchicken.com>
Fri, 15 Aug 2008 00:30:44 +0000 (00:30 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 15 Aug 2008 00:30:44 +0000 (00:30 +0000)
lisp/simple.el

index 1cf39021321931f1abeda7962363d31fdb50e271..3e38d59a6924ee6592d119b12d58acf89f642f94 100644 (file)
@@ -5612,12 +5612,15 @@ With prefix argument N, move N items (negative N means move backward)."
     (setq completion (buffer-substring-no-properties beg end))
     (let ((owindow (selected-window)))
       (if (and (one-window-p t 'selected-frame)
-              (window-dedicated-p (selected-window)))
+              (window-dedicated-p owindow))
          ;; This is a special buffer's frame
          (iconify-frame (selected-frame))
        (or (window-dedicated-p (selected-window))
            (bury-buffer)))
-      (select-window owindow))
+      (select-window
+       (or (and (buffer-live-p buffer)
+               (get-buffer-window buffer))
+          owindow)))
     (choose-completion-string completion buffer base-size)))
 
 ;; Delete the longest partial match for STRING