changeset 67728:bffc4c57eda9

(lisp-complete-symbol): Mostly undo the change by Kevin Rodgers. Instead, just hide the completions buffer if we don't need to show it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 22 Dec 2005 01:48:20 +0000
parents c0dbbeb95cd3
children 88f36bfe01f5
files lisp/ChangeLog lisp/emacs-lisp/lisp.el
diffstat 2 files changed, 15 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Dec 22 01:46:34 2005 +0000
+++ b/lisp/ChangeLog	Thu Dec 22 01:48:20 2005 +0000
@@ -1,3 +1,9 @@
+2005-12-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/lisp.el (lisp-complete-symbol): Mostly undo the change
+	by Kevin Rodgers.  Instead, just hide the completions buffer if we
+	don't need to show it.
+
 2005-12-21  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* wid-edit.el (file, directory): Doc fixes for the `define-widget's.
--- a/lisp/emacs-lisp/lisp.el	Thu Dec 22 01:46:34 2005 +0000
+++ b/lisp/emacs-lisp/lisp.el	Thu Dec 22 01:48:20 2005 +0000
@@ -569,11 +569,13 @@
 	      ((null completion)
 	       (message "Can't find completion for \"%s\"" pattern)
 	       (ding))
+	      ((not (string= pattern completion))
+	       (delete-region beg end)
+	       (insert completion)
+               ;; Don't leave around a completions buffer that's outofdate.
+               (let ((win (get-buffer-window "*Completions*" 0)))
+                 (if win (with-selected-window win (bury-buffer)))))
 	      (t
-	       (unless (string= completion pattern)
-		 (delete-region beg end)
-		 (insert completion)
-		 (setq pattern completion))
 	       (message "Making completion list...")
 	       (let ((list (all-completions pattern obarray predicate)))
 		 (setq list (sort list 'string<))
@@ -589,8 +591,9 @@
 		 (if (> (length list) 1)
 		     (with-output-to-temp-buffer "*Completions*"
 		       (display-completion-list list pattern))
-                   (if (get-buffer "*Completions*")
-                       (delete-windows-on "*Completions*"))))
+                   ;; Don't leave around a completions buffer that's outofdate.
+                   (let ((win (get-buffer-window "*Completions*" 0)))
+                     (if win (with-selected-window win (bury-buffer))))))
 	       (message "Making completion list...%s" "done")))))))
 
 ;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e