Function: find-library--from-load-history

find-library--from-load-history is a byte-compiled function defined in find-func.el.gz.

Signature

(find-library--from-load-history LIBRARY)

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/find-func.el.gz
(defun find-library--from-load-history (library)
  ;; In `load-history', the file may be ".elc", ".el", ".el.gz", and
  ;; LIBRARY may be "foo.el" or "foo".
  (let ((load-re
         (concat "\\(" (regexp-quote (file-name-sans-extension library)) "\\)"
                 (regexp-opt (get-load-suffixes)) "\\'")))
    (cl-loop
     for (file . _) in load-history thereis
     (and (stringp file) (string-match load-re file)
          (let ((dir (substring file 0 (match-beginning 1)))
                (basename (match-string 1 file)))
            (locate-file basename (list dir) (find-library-suffixes)))))))