From 6351953dcd162d46fcccfaeb0076d22e2a390951 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 21 Mar 2021 21:24:26 +0100 Subject: [PATCH] * 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 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. -- 2.39.5