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)) "\\'"))
        (alist load-history)
        elt file found)
    (while (and alist (null found))
      (setq elt (car alist)
            alist (cdr alist)
            file (car elt)
            found (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))))))
    found))