unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Completion problems - completion window not rewritten
@ 2005-12-07 15:06 Lennart Borgman
  2005-12-07 19:26 ` Kevin Rodgers
  0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman @ 2005-12-07 15:06 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Completion problems - completion window not rewritten
  2005-12-07 15:06 Completion problems - completion window not rewritten Lennart Borgman
@ 2005-12-07 19:26 ` Kevin Rodgers
  2005-12-07 21:24   ` Kevin Rodgers
  2005-12-09 16:32   ` Kevin Rodgers
  0 siblings, 2 replies; 4+ messages in thread
From: Kevin Rodgers @ 2005-12-07 19:26 UTC (permalink / raw)


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  <ihs_4664@ihs.com>

	* 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.


*** emacs-21.4/lisp/emacs-lisp/lisp.el~	Tue Oct 22 02:14:32 2002
--- emacs-21.4/lisp/emacs-lisp/lisp.el	Wed Dec  7 12:13:28 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<))

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Completion problems - completion window not rewritten
  2005-12-07 19:26 ` Kevin Rodgers
@ 2005-12-07 21:24   ` Kevin Rodgers
  2005-12-09 16:32   ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2005-12-07 21:24 UTC (permalink / raw)


Kevin Rodgers wrote:
> 2005-12-07  Kevin Rodgers  <ihs_4664@ihs.com>
> 
>     * 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.
                                                  ^ current
-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Completion problems - completion window not rewritten
  2005-12-07 19:26 ` Kevin Rodgers
  2005-12-07 21:24   ` Kevin Rodgers
@ 2005-12-09 16:32   ` Kevin Rodgers
  1 sibling, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2005-12-09 16:32 UTC (permalink / raw)


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  <ihs_4664@ihs.com>
 >
 >     * 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  <ihs_4664@ihs.com>

	* 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-09 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-07 15:06 Completion problems - completion window not rewritten Lennart Borgman
2005-12-07 19:26 ` Kevin Rodgers
2005-12-07 21:24   ` Kevin Rodgers
2005-12-09 16:32   ` Kevin Rodgers

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).