diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-19 03:33:13 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-04-19 03:33:13 +0000 |
commit | e8dab975990b1e7bcab9263d02c60d1fb51397ad (patch) | |
tree | 46fd099309e89c520e8c1aa8ca53353bda1e8e89 /lisp/emacs-lisp/find-func.el | |
parent | 25c0d999666985929f375a75f4ed5018b7c5e9f3 (diff) | |
download | emacs-e8dab975990b1e7bcab9263d02c60d1fb51397ad.tar.gz emacs-e8dab975990b1e7bcab9263d02c60d1fb51397ad.tar.bz2 emacs-e8dab975990b1e7bcab9263d02c60d1fb51397ad.zip |
* files.el (locate-file-completion-table): Rename from
locate-file-completion and make it use `pred' in the normal way.
(locate-file-completion): New compatibility wrapper.
(load-library): Use locate-file-completion-table.
* emacs-lisp/find-func.el (find-library): Likewise.
* info.el: Use with-current-buffer and inhibit-read-only.
(Info-read-node-name-2): Change to use `predicate' in the normal way.
(Info-read-node-name-1): Adjust uses accordingly.
Diffstat (limited to 'lisp/emacs-lisp/find-func.el')
-rw-r--r-- | lisp/emacs-lisp/find-func.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 85f3fe941b7..2a1e659ad92 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -197,8 +197,8 @@ TYPE should be nil to find a function, or `defvar' to find a variable." (defun find-library (library) "Find the elisp source of LIBRARY." (interactive - (let* ((path (cons (or find-function-source-path load-path) - (find-library-suffixes))) + (let* ((dirs (or find-function-source-path load-path)) + (suffixes (find-library-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 @@ -213,11 +213,15 @@ TYPE should be nil to find a function, or `defvar' to find a variable." (error nil)) (thing-at-point 'symbol)))) (when def - (setq def (and (locate-file-completion def path 'test) def))) + (setq def (and (locate-file-completion-table + dirs suffixes def nil 'lambda) + def))) (list (completing-read (if def (format "Library name (default %s): " def) "Library name: ") - 'locate-file-completion path nil nil nil def)))) + (apply-partially 'locate-file-completion-table + dirs suffixes) + 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))))) |