summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/find-func.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-09-21 21:45:02 +0200
committerAndrea Corallo <akrl@sdf.org>2020-09-21 21:45:02 +0200
commit5a8be1719a80031ea3833749b1e82de8d5a39787 (patch)
tree1f3cb774fd9e222b7d4f2f426695e7894ee7b297 /lisp/emacs-lisp/find-func.el
parent5b41545f1be367837d9ac717ea67fba19a4c24d4 (diff)
parentfb68645b5a258c98acc11efdc3caae80683cc6b0 (diff)
downloademacs-5a8be1719a80031ea3833749b1e82de8d5a39787.tar.gz
emacs-5a8be1719a80031ea3833749b1e82de8d5a39787.tar.bz2
emacs-5a8be1719a80031ea3833749b1e82de8d5a39787.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp/find-func.el')
-rw-r--r--lisp/emacs-lisp/find-func.el20
1 files changed, 5 insertions, 15 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 9802bd4ca9b..f5f8c822089 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -61,7 +61,7 @@
"^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\
ine\\(?:-global\\)?-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|\
foo\\|\\(?:[^icfgv]\\|g[^r]\\)\\(\\w\\|\\s_\\)+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\
-menu-bar-make-toggle\\)"
+menu-bar-make-toggle\\|menu-bar-make-toggle-command\\)"
find-function-space-re
"\\('\\|(quote \\)?%s\\(\\s-\\|$\\|[()]\\)")
"The regexp used by `find-function' to search for a function definition.
@@ -290,20 +290,10 @@ Interactively, prompt for LIBRARY using the one at or near point."
A library name is the filename of an Emacs Lisp library located
in a directory under `load-path' (or `find-function-source-path',
if non-nil)."
- (let* ((suffix-regexp (mapconcat
- (lambda (suffix)
- (concat (regexp-quote suffix) "\\'"))
- (find-library-suffixes)
- "\\|"))
- (table (cl-loop for dir in (or find-function-source-path load-path)
- for dir-or-default = (or dir default-directory)
- when (file-readable-p dir-or-default)
- append (mapcar
- (lambda (file)
- (replace-regexp-in-string suffix-regexp
- "" file))
- (directory-files dir-or-default nil
- suffix-regexp))))
+ (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