summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-03-21 21:24:26 +0100
committerAndrea Corallo <akrl@sdf.org>2021-03-21 21:50:22 +0100
commit6351953dcd162d46fcccfaeb0076d22e2a390951 (patch)
tree866d52f0aa57b7cc9a41cf6b31d37ad14fa314db /lisp/emacs-lisp/comp.el
parent5aa42f686c635e3b3f6cea8270e3c6fc2e4270f9 (diff)
downloademacs-6351953dcd162d46fcccfaeb0076d22e2a390951.tar.gz
emacs-6351953dcd162d46fcccfaeb0076d22e2a390951.tar.bz2
emacs-6351953dcd162d46fcccfaeb0076d22e2a390951.zip
* lisp/emacs-lisp/comp.el (comp-lookup-eln): Add new function.
Diffstat (limited to 'lisp/emacs-lisp/comp.el')
-rw-r--r--lisp/emacs-lisp/comp.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 37b61edeb0c..e688d41f5d9 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -4099,6 +4099,20 @@ bytecode definition was not changed in the meantime)."
;;; Compiler entry points.
+(defun comp-lookup-eln (filename)
+ "Given a Lisp source FILENAME return the corresponding .eln file if found.
+Search happens in `comp-eln-load-path'."
+ (cl-loop
+ with eln-filename = (comp-el-to-eln-rel-filename filename)
+ for dir in comp-eln-load-path
+ for f = (expand-file-name eln-filename
+ (expand-file-name comp-native-version-dir
+ (expand-file-name
+ dir
+ invocation-directory)))
+ when (file-exists-p f)
+ do (cl-return f)))
+
;;;###autoload
(defun native-compile (function-or-file &optional output)
"Compile FUNCTION-OR-FILE into native code.