emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 6351953 1/2: * lisp/emacs-lisp/comp.el (comp-lookup-


From: Andrea Corallo
Subject: feature/native-comp 6351953 1/2: * lisp/emacs-lisp/comp.el (comp-lookup-eln): Add new function.
Date: Sun, 21 Mar 2021 16:51:19 -0400 (EDT)

branch: feature/native-comp
commit 6351953dcd162d46fcccfaeb0076d22e2a390951
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * lisp/emacs-lisp/comp.el (comp-lookup-eln): Add new function.
---
 lisp/emacs-lisp/comp.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 37b61ed..e688d41 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]