From 6d93e4aa38aa1993c8be0e24cf374d40583455bd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 10 Dec 2005 11:40:04 +0000 Subject: [PATCH] (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. --- lisp/ChangeLog | 8 ++++++++ lisp/emacs-lisp/lisp.el | 13 ++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b69c5a831af..21f3422a63d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2005-12-10 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 + completion, redisplay the *Completions* buffer; if the + completion is unique, delete the *Completions* window. + 2005-12-10 Eli Zaretskii * mail/rmail.el (rmail-next-same-subject): Handle multiple "Re: " diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 4b799ebfedf..7aeb33a648e 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -569,10 +569,11 @@ considered." ((null completion) (message "Can't find completion for \"%s\"" pattern) (ding)) - ((not (string= pattern completion)) - (delete-region beg end) - (insert completion)) (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<)) @@ -585,8 +586,10 @@ considered." new)) (setq list (cdr list))) (setq list (nreverse new)))) - (with-output-to-temp-buffer "*Completions*" - (display-completion-list list pattern))) + (if (> (length list) 1) + (with-output-to-temp-buffer "*Completions*" + (display-completion-list list pattern)) + (delete-windows-on "*Completions*"))) (message "Making completion list...%s" "done"))))))) ;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e -- 2.39.5