diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-10-21 23:17:26 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-10-21 23:17:26 -0400 |
commit | 7c23d9e85b58d0cc360c255ff86bd3e723259d7f (patch) | |
tree | 99bb84d8d07c2322aa4743d02355fa53ca96e4de /lisp/emacs-lisp | |
parent | e0da801ae4b5791480bce39e1d4337e02f3bcb7a (diff) | |
download | emacs-7c23d9e85b58d0cc360c255ff86bd3e723259d7f.tar.gz emacs-7c23d9e85b58d0cc360c255ff86bd3e723259d7f.tar.bz2 emacs-7c23d9e85b58d0cc360c255ff86bd3e723259d7f.zip |
* lisp/emacs-lisp/find-func.el (find-library): Use test-completion.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 216d91baa7b..9d59337a7c7 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -213,6 +213,8 @@ LIBRARY should be a string (the name of the library)." (interactive (let* ((dirs (or find-function-source-path load-path)) (suffixes (find-library-suffixes)) + (table (apply-partially 'locate-file-completion-table + dirs suffixes)) (def (if (eq (function-called-at-point) 'require) ;; `function-called-at-point' may return 'require ;; with `point' anywhere on this line. So wrap the @@ -226,16 +228,12 @@ LIBRARY should be a string (the name of the library)." (thing-at-point 'symbol)) (error nil)) (thing-at-point 'symbol)))) - (when def - (setq def (and (locate-file-completion-table - dirs suffixes def nil 'lambda) - def))) + (when (and def (not (test-completion def table))) + (setq def nil)) (list (completing-read (if def (format "Library name (default %s): " def) "Library name: ") - (apply-partially 'locate-file-completion-table - dirs suffixes) - nil nil nil nil def)))) + table nil nil nil nil def)))) (let ((buf (find-file-noselect (find-library-name library)))) (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))))) |