From e8dab975990b1e7bcab9263d02c60d1fb51397ad Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 19 Apr 2008 03:33:13 +0000 Subject: * 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. --- lisp/emacs-lisp/find-func.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp/find-func.el') 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))))) -- cgit v1.2.3