aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/find-func.el17
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 9fc7e4a797d..142c99edd43 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -285,10 +285,19 @@ Interactively, prompt for LIBRARY using the one at or near point."
285A library name is the filename of an Emacs Lisp library located 285A library name is the filename of an Emacs Lisp library located
286in a directory under `load-path' (or `find-function-source-path', 286in a directory under `load-path' (or `find-function-source-path',
287if non-nil)." 287if non-nil)."
288 (let* ((dirs (or find-function-source-path load-path)) 288 (let* ((suffix-regexp (mapconcat
289 (suffixes (find-library-suffixes)) 289 (lambda (suffix)
290 (table (apply-partially 'locate-file-completion-table 290 (concat (regexp-quote suffix) "\\'"))
291 dirs suffixes)) 291 (find-library-suffixes)
292 "\\|"))
293 (table (cl-loop for dir in (or find-function-source-path load-path)
294 when (file-readable-p dir)
295 append (mapcar
296 (lambda (file)
297 (replace-regexp-in-string suffix-regexp
298 "" file))
299 (directory-files dir nil
300 suffix-regexp))))
292 (def (if (eq (function-called-at-point) 'require) 301 (def (if (eq (function-called-at-point) 'require)
293 ;; `function-called-at-point' may return 'require 302 ;; `function-called-at-point' may return 'require
294 ;; with `point' anywhere on this line. So wrap the 303 ;; with `point' anywhere on this line. So wrap the