diff options
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/files.el b/lisp/files.el index e5fa1d8b224..6815354cf55 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -906,6 +906,8 @@ See `file-symlink-p' to distinguish symlinks." (read-file-name "Load file: " nil nil 'lambda)))) (load (expand-file-name file) nil nil t)) +(defvar comp-eln-to-el-h) + (defun locate-file (filename path &optional suffixes predicate) "Search for FILENAME through PATH. If found, return the absolute file name of FILENAME; otherwise @@ -932,7 +934,10 @@ one or more of those symbols." (logior (if (memq 'executable predicate) 1 0) (if (memq 'writable predicate) 2 0) (if (memq 'readable predicate) 4 0)))) - (locate-file-internal filename path suffixes predicate)) + (let ((file (locate-file-internal filename path suffixes predicate))) + (if (and file (string-match "\\.eln\\'" file)) + (gethash (file-name-nondirectory file) comp-eln-to-el-h) + file))) (defun locate-file-completion-table (dirs suffixes string pred action) "Do completion for file names passed to `locate-file'." |