summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-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.