# HG changeset patch # User Stefan Monnier # Date 1251645215 0 # Node ID cc62eac5991f8609cf7bfd8f08038d0006561082 # Parent 214b3e5da89aa272242d2157d5fbdceda1c7b2e4 (field-complete): Use minibuffer-complete. diff -r 214b3e5da89a -r cc62eac5991f lisp/ChangeLog --- a/lisp/ChangeLog Sun Aug 30 14:24:09 2009 +0000 +++ b/lisp/ChangeLog Sun Aug 30 15:13:35 2009 +0000 @@ -1,5 +1,7 @@ 2009-08-30 Stefan Monnier + * emacs-lisp/lisp.el (field-complete): Use minibuffer-complete. + * net/ldap.el (ldap-search-internal): Use with-current-buffer and push. * net/imap.el (imap-send-command): Simplify. diff -r 214b3e5da89a -r cc62eac5991f lisp/emacs-lisp/lisp.el --- a/lisp/emacs-lisp/lisp.el Sun Aug 30 14:24:09 2009 +0000 +++ b/lisp/emacs-lisp/lisp.el Sun Aug 30 15:13:35 2009 +0000 @@ -597,43 +597,16 @@ (error "Unmatched bracket or quote")))) (defun field-complete (table &optional predicate) - (let* ((pattern (field-string-no-properties)) - (completion (try-completion pattern table predicate))) - (cond ((eq completion t)) - ((null completion) - (message "Can't find completion for \"%s\"" pattern) - (ding)) - ((not (string= pattern completion)) - (delete-region (field-beginning) (field-end)) - (insert completion) - ;; Don't leave around a completions buffer that's out of date. - (let ((win (get-buffer-window "*Completions*" 0))) - (if win (with-selected-window win (bury-buffer))))) - (t - (let ((minibuf-is-in-use - (eq (minibuffer-window) (selected-window)))) - (unless minibuf-is-in-use - (message "Making completion list...")) - (let ((list (all-completions pattern table predicate))) - (setq list (sort list 'string<)) - (or (eq predicate 'fboundp) - (let (new) - (while list - (setq new (cons (if (fboundp (intern (car list))) - (list (car list) " ") - (car list)) - new)) - (setq list (cdr list))) - (setq list (nreverse new)))) - (if (> (length list) 1) - (with-output-to-temp-buffer "*Completions*" - (display-completion-list list pattern)) - ;; Don't leave around a completions buffer that's - ;; out of date. - (let ((win (get-buffer-window "*Completions*" 0))) - (if win (with-selected-window win (bury-buffer)))))) - (unless minibuf-is-in-use - (message "Making completion list...%s" "done"))))))) + (let ((minibuffer-completion-table table) + (minibuffer-completion-predicate predicate) + ;; This made sense for lisp-complete-symbol, but for + ;; field-complete, this is out of place. --Stef + ;; (completion-annotate-function + ;; (unless (eq predicate 'fboundp) + ;; (lambda (str) + ;; (if (fboundp (intern-soft str)) " ")))) + ) + (call-interactively 'minibuffer-complete))) (defun lisp-complete-symbol (&optional predicate) "Perform completion on Lisp symbol preceding point.