summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-03-08 21:30:28 +0000
committerAndrea Corallo <akrl@sdf.org>2020-03-08 21:51:56 +0000
commitf055f523216d6aa5fe2b59984e0aed81ca80b66e (patch)
tree29f47d8d2b313826fb6d360d7ca037757623308a /lisp/emacs-lisp
parent6c3efad161dcccf28bf6db1b0b714b012059e719 (diff)
downloademacs-f055f523216d6aa5fe2b59984e0aed81ca80b66e.tar.gz
emacs-f055f523216d6aa5fe2b59984e0aed81ca80b66e.tar.bz2
emacs-f055f523216d6aa5fe2b59984e0aed81ca80b66e.zip
* Fix two find function functions for native compilation
`find-function-library' and `find-library-name' gets fixed for new eln compilation directory layout.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/find-func.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 86b5e5456f0..21c10029ac4 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -184,8 +184,15 @@ See the functions `find-function' and `find-variable'."
LIBRARY should be a string (the name of the library)."
;; If the library is byte-compiled, try to find a source library by
;; the same name.
- (when (string-match "\\.el\\([cn]\\(\\..*\\)?\\)\\'" library)
+ (cond
+ ((string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
(setq library (replace-match "" t t library)))
+ ((string-match "\\.eln$" library)
+ ;; From help-fns.el.
+ (setq library (expand-file-name (concat (file-name-base library)
+ ".el")
+ (concat (file-name-directory library)
+ "..")))))
(or
(locate-file library
(or find-function-source-path load-path)
@@ -439,7 +446,7 @@ message about the whole chain of aliases."
(cons function
(cond
((autoloadp def) (nth 1 def))
- ((subrp def)
+ ((and (subrp def) (not (subr-native-elisp-p def)))
(if lisp-only
(error "%s is a built-in function" function))
(help-C-file-name def 'subr))