emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lisp-complete-symbol


From: Stefan Monnier
Subject: Re: lisp-complete-symbol
Date: Wed, 21 Dec 2005 18:16:54 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> The following change has some annoying side-effect:
>> 
>> 2005-12-10  Kevin Rodgers  <address@hidden>
>> 
>> * emacs-lisp/lisp.el (lisp-complete-symbol): Regenerate the
>> completion list, even after a partial completion has been
>> inserted in the current buffer.  If there are more than 1
>> completion, redisplay the *Completions* buffer; if the
>> completion is unique, delete the *Completions* window.
>> 
>> The problem is that it changed the behavior such that the *completions*
>> buffer is shown after every completion.  Before that change, the
>> *completions* buffer was only shown if the completion failed because
>> of ambiguity.
>> 
>> I'm not sure what this was supposed to fix, but I think it was not the right
>> fix,
> I believe it was to display the correct list in the *Completions* buffer if
> the user changed the input string to complete.

You mean, to update the *Completions* buffer on the fly rather than only
when a completion fails?
That'd be a new feature, not a bug fix.  And his code doesn't do that: it
only updates the buffer after completion, not after every keystroke.

How 'bout the patch below instead which simply hides the *Completions*
buffer after a successful completion.


        Stefan


--- lisp.el     21 déc 2005 14:59:54 -0500      1.71
+++ lisp.el     21 déc 2005 18:15:43 -0500      
@@ -569,11 +569,12 @@
              ((null completion)
               (message "Can't find completion for \"%s\"" pattern)
               (ding))
-             (t
-              (unless (string= completion pattern)
+             ((not (string= pattern completion))
                 (delete-region beg end)
                 (insert completion)
-                (setq pattern completion))
+               (let ((win (get-buffer-window "*Completions*" 0)))
+                 (if win (with-selected-window win (bury-buffer)))))
+             (t
               (message "Making completion list...")
               (let ((list (all-completions pattern obarray predicate)))
                 (setq list (sort list 'string<))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]