]> git.eshelyaron.com Git - emacs.git/commitdiff
Extend find-library-suffixes and find-library-name for eln support
authorAndrea Corallo <akrl@sdf.org>
Thu, 2 Jan 2020 21:55:38 +0000 (22:55 +0100)
committerAndrea Corallo <akrl@sdf.org>
Thu, 2 Jan 2020 22:01:42 +0000 (23:01 +0100)
lisp/emacs-lisp/find-func.el

index 167ead3ce02bc9ca5b57fa68c1ad6cbc57933bf8..86b5e5456f0bcf7c86c4034a626893dd69c2e7c6 100644 (file)
@@ -167,7 +167,8 @@ See the functions `find-function' and `find-variable'."
 (defun find-library-suffixes ()
   (let ((suffixes nil))
     (dolist (suffix (get-load-suffixes) (nreverse suffixes))
-      (unless (string-match "elc" suffix) (push suffix suffixes)))))
+      (unless (string-match "el[cn]" suffix)
+        (push suffix suffixes)))))
 
 (defun find-library--load-name (library)
   (let ((name library))
@@ -183,7 +184,7 @@ See the functions `find-function' and `find-variable'."
 LIBRARY should be a string (the name of the library)."
   ;; If the library is byte-compiled, try to find a source library by
   ;; the same name.
-  (when (string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
+  (when (string-match "\\.el\\([cn]\\(\\..*\\)?\\)\\'" library)
     (setq library (replace-match "" t t library)))
   (or
    (locate-file library