[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 286e21c 07/11: Rework `find-lisp-object-file-name'
From: |
Andrea Corallo |
Subject: |
feature/native-comp 286e21c 07/11: Rework `find-lisp-object-file-name' |
Date: |
Wed, 4 Mar 2020 12:08:32 -0500 (EST) |
branch: feature/native-comp
commit 286e21c4e86e19bac60f871120df6b51893c5849
Author: AndreaCorallo <address@hidden>
Commit: Andrea Corallo <address@hidden>
Rework `find-lisp-object-file-name'
Rework it for eln new compilation folder layout.
---
lisp/help-fns.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 2b7534b..e629a40 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -325,12 +325,19 @@ found via `load-path'. The return value can also be
`C-source', which
means that OBJECT is a function or variable defined in C. If no
suitable file is found, return nil."
(let* ((autoloaded (autoloadp type))
- (file-name (or (and autoloaded (nth 1 type))
+ (true-name (or (and autoloaded (nth 1 type))
(symbol-file
;; FIXME: Why do we have this weird "If TYPE is the
;; value returned by `symbol-function' for a function
;; symbol" exception?
- object (or (if (symbolp type) type) 'defun)))))
+ object (or (if (symbolp type) type) 'defun))))
+ (file-name (if (and true-name
+ (string-match "[.]eln\\'" true-name))
+ (expand-file-name (concat (file-name-base true-name)
+ ".el")
+ (concat (file-name-directory
true-name)
+ ".."))
+ true-name)))
(cond
(autoloaded
;; An autoloaded function: Locate the file since `symbol-function'
@@ -377,7 +384,7 @@ suitable file is found, return nil."
;; This applies to config files like ~/.emacs,
;; which people sometimes compile.
((let (fn)
- (and (string-match "\\`\\..*\\.el[cn]\\'"
+ (and (string-match "\\`\\..*\\.elc\\'"
(file-name-nondirectory file-name))
(string-equal (file-name-directory file-name)
(file-name-as-directory (expand-file-name "~")))
@@ -386,9 +393,9 @@ suitable file is found, return nil."
;; When the Elisp source file can be found in the install
;; directory, return the name of that file.
((let ((lib-name
- (if (string-match "[.]el[cn]\\'" file-name)
+ (if (string-match "[.]elc\\'" file-name)
(substring-no-properties file-name 0 -1)
- file-name)))
+ file-name)))
(or (and (file-readable-p lib-name) lib-name)
;; The library might be compressed.
(and (file-readable-p (concat lib-name ".gz")) lib-name))))
@@ -399,7 +406,7 @@ suitable file is found, return nil."
;; name, convert that back to a file name and see if we
;; get the original one. If so, they are equivalent.
(if (equal file-name (locate-file lib-name load-path '("")))
- (if (string-match "[.]el[cn]\\'" lib-name)
+ (if (string-match "[.]elc\\'" lib-name)
(substring-no-properties lib-name 0 -1)
lib-name)
file-name))
- feature/native-comp updated (0cef208 -> 6487d4a), Andrea Corallo, 2020/03/04
- feature/native-comp 8788fab 03/11: ; Nit fix in comment, Andrea Corallo, 2020/03/04
- feature/native-comp ce9e3a4 05/11: Introduce 'effective_load_path', Andrea Corallo, 2020/03/04
- feature/native-comp 0da62d9 01/11: Change parameter name into comp--compile-ctxt-to-file, Andrea Corallo, 2020/03/04
- feature/native-comp 2dae7e1 02/11: Add system-configuration in the compilation output path, Andrea Corallo, 2020/03/04
- feature/native-comp d0066e3 04/11: * Keep comp-subr-list into pure space, Andrea Corallo, 2020/03/04
- feature/native-comp bf4f620 06/11: * ; Clean-up out of date comment, Andrea Corallo, 2020/03/04
- feature/native-comp 43b6f05 09/11: Hash eln ABI once and add it to the output compilation path, Andrea Corallo, 2020/03/04
- feature/native-comp f77f6ca 08/11: Fix org for eln new compilation folder layout, Andrea Corallo, 2020/03/04
- feature/native-comp 1f3ba65 10/11: * Do not crash if the output directory is created in the meanwhile, Andrea Corallo, 2020/03/04
- feature/native-comp 286e21c 07/11: Rework `find-lisp-object-file-name',
Andrea Corallo <=
- feature/native-comp 6487d4a 11/11: Merge remote-tracking branch 'savannah/master' into HEAD, Andrea Corallo, 2020/03/04