comparison lisp/emacs-lisp/lisp.el @ 67472:dc66229d83bf

(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.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 10 Dec 2005 11:39:24 +0000
parents 13abee3a9bc6
children d372bc6eff1d
comparison
equal deleted inserted replaced
67471:8e00ea681e4d 67472:dc66229d83bf
567 (completion (try-completion pattern obarray predicate))) 567 (completion (try-completion pattern obarray predicate)))
568 (cond ((eq completion t)) 568 (cond ((eq completion t))
569 ((null completion) 569 ((null completion)
570 (message "Can't find completion for \"%s\"" pattern) 570 (message "Can't find completion for \"%s\"" pattern)
571 (ding)) 571 (ding))
572 ((not (string= pattern completion))
573 (delete-region beg end)
574 (insert completion))
575 (t 572 (t
573 (unless (string= completion pattern)
574 (delete-region beg end)
575 (insert completion)
576 (setq pattern completion))
576 (message "Making completion list...") 577 (message "Making completion list...")
577 (let ((list (all-completions pattern obarray predicate))) 578 (let ((list (all-completions pattern obarray predicate)))
578 (setq list (sort list 'string<)) 579 (setq list (sort list 'string<))
579 (or (eq predicate 'fboundp) 580 (or (eq predicate 'fboundp)
580 (let (new) 581 (let (new)
583 (list (car list) " <f>") 584 (list (car list) " <f>")
584 (car list)) 585 (car list))
585 new)) 586 new))
586 (setq list (cdr list))) 587 (setq list (cdr list)))
587 (setq list (nreverse new)))) 588 (setq list (nreverse new))))
588 (with-output-to-temp-buffer "*Completions*" 589 (if (> (length list) 1)
589 (display-completion-list list pattern))) 590 (with-output-to-temp-buffer "*Completions*"
591 (display-completion-list list pattern))
592 (delete-windows-on "*Completions*")))
590 (message "Making completion list...%s" "done"))))))) 593 (message "Making completion list...%s" "done")))))))
591 594
592 ;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e 595 ;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
593 ;;; lisp.el ends here 596 ;;; lisp.el ends here