comparison lisp/emacs-lisp/lisp.el @ 67728:bffc4c57eda9

(lisp-complete-symbol): Mostly undo the change by Kevin Rodgers. Instead, just hide the completions buffer if we don't need to show it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 22 Dec 2005 01:48:20 +0000
parents d372bc6eff1d
children 1ee1a77d8b03
comparison
equal deleted inserted replaced
67727:c0dbbeb95cd3 67728:bffc4c57eda9
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 ;; Don't leave around a completions buffer that's outofdate.
576 (let ((win (get-buffer-window "*Completions*" 0)))
577 (if win (with-selected-window win (bury-buffer)))))
572 (t 578 (t
573 (unless (string= completion pattern)
574 (delete-region beg end)
575 (insert completion)
576 (setq pattern completion))
577 (message "Making completion list...") 579 (message "Making completion list...")
578 (let ((list (all-completions pattern obarray predicate))) 580 (let ((list (all-completions pattern obarray predicate)))
579 (setq list (sort list 'string<)) 581 (setq list (sort list 'string<))
580 (or (eq predicate 'fboundp) 582 (or (eq predicate 'fboundp)
581 (let (new) 583 (let (new)
587 (setq list (cdr list))) 589 (setq list (cdr list)))
588 (setq list (nreverse new)))) 590 (setq list (nreverse new))))
589 (if (> (length list) 1) 591 (if (> (length list) 1)
590 (with-output-to-temp-buffer "*Completions*" 592 (with-output-to-temp-buffer "*Completions*"
591 (display-completion-list list pattern)) 593 (display-completion-list list pattern))
592 (if (get-buffer "*Completions*") 594 ;; Don't leave around a completions buffer that's outofdate.
593 (delete-windows-on "*Completions*")))) 595 (let ((win (get-buffer-window "*Completions*" 0)))
596 (if win (with-selected-window win (bury-buffer))))))
594 (message "Making completion list...%s" "done"))))))) 597 (message "Making completion list...%s" "done")))))))
595 598
596 ;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e 599 ;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
597 ;;; lisp.el ends here 600 ;;; lisp.el ends here