emacs-devel
[Top][All Lists]
Advanced

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

Re: Completion problems - completion window not rewritten


From: Kevin Rodgers
Subject: Re: Completion problems - completion window not rewritten
Date: Fri, 09 Dec 2005 09:32:46 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Kevin Rodgers wrote:
> Lennart Borgman wrote:
>> Start with
>>
>>   emacs -Q
>>
>> In the *scratch* buffer enter the text
>>
>>   'default-
>>
>> and the type
>>
>>    ESC TAB
>>
>> This gives all completions for default-* in the *Completions* buffer.
>> Now continue to type so that the *scratch* buffer contains
>>
>>   'default-dir
>>
>> Again type
>>
>>    ESC TAB
>>
>> I would expect the *Completion* buffer to show only the now useful
>> alternatives. However this does not happen. Closing the window showing
>> the *Completion* buffer and trying again with ESC TAB shows the
>> correct alternatives however.
>
>
> 2005-12-07  Kevin Rodgers  <address@hidden>
>
>     * emacs-lisp/lisp.el (lisp-complete-symbol): Regenerate the
>     completion list and redisplay the *Completions* buffer after a
>     partial completion has been inserted in the buffer.

Here's a slightly better patch:

2005-12-09  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
        completions, redisplay the *Completions* buffer; if the
        completion is unique, delete the *Completions* window.


*** emacs-21.4/lisp/emacs-lisp/lisp.el~ Tue Oct 22 02:14:32 2002
--- emacs-21.4/lisp/emacs-lisp/lisp.el  Fri Dec  9 09:16:48 2005
***************
*** 389,398 ****
          ((null completion)
           (message "Can't find completion for \"%s\"" pattern)
           (ding))
-         ((not (string= pattern completion))
-          (delete-region beg end)
-          (insert completion))
          (t
           (message "Making completion list...")
           (let ((list (all-completions pattern obarray predicate)))
             (setq list (sort list 'string<))
--- 389,399 ----
          ((null completion)
           (message "Can't find completion for \"%s\"" pattern)
           (ding))
          (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<))
***************
*** 405,412 ****
                                     new))
                     (setq list (cdr list)))
                   (setq list (nreverse new))))
!            (with-output-to-temp-buffer "*Completions*"
!              (display-completion-list list)))
           (message "Making completion list...%s" "done")))))

  ;;; lisp.el ends here
--- 406,415 ----
                                     new))
                     (setq list (cdr list)))
                   (setq list (nreverse new))))
!            (if (> (length list) 1)
!                (with-output-to-temp-buffer "*Completions*"
!                  (display-completion-list list))
!              (delete-windows-on "*Completions*")))
           (message "Making completion list...%s" "done")))))

  ;;; lisp.el ends here


--
Kevin Rodgers





reply via email to

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