From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.devel Subject: Re: Completion problems - completion window not rewritten Date: Fri, 09 Dec 2005 09:32:46 -0700 Message-ID: References: <4396FA72.1000504@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1134156633 20738 80.91.229.2 (9 Dec 2005 19:30:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Dec 2005 19:30:33 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 09 20:30:31 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eknwi-0007MZ-Sb for ged-emacs-devel@m.gmane.org; Fri, 09 Dec 2005 20:30:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eknx4-00046J-JF for ged-emacs-devel@m.gmane.org; Fri, 09 Dec 2005 14:30:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EklJu-0005dT-M9 for emacs-devel@gnu.org; Fri, 09 Dec 2005 11:42:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EklJG-0005Jd-95 for emacs-devel@gnu.org; Fri, 09 Dec 2005 11:41:28 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EklIp-00052H-8U for emacs-devel@gnu.org; Fri, 09 Dec 2005 11:40:59 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1EklK2-0003P3-UV for emacs-devel@gnu.org; Fri, 09 Dec 2005 11:42:15 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EklEl-00025w-4Y for emacs-devel@gnu.org; Fri, 09 Dec 2005 17:36:47 +0100 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Dec 2005 17:36:47 +0100 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Dec 2005 17:36:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 97 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:47325 Archived-At: 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 > > * 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 * 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