all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Completion problems - completion window not rewritten
Date: Fri, 09 Dec 2005 09:32:46 -0700	[thread overview]
Message-ID: <dncbjj$fg5$1@sea.gmane.org> (raw)
In-Reply-To: <dn7d18$k4$1@sea.gmane.org>

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

      parent reply	other threads:[~2005-12-09 16:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='dncbjj$fg5$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.