all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Is package--list-loaded-files broken?
@ 2018-09-02 16:16 Clément Pit-Claudel
  0 siblings, 0 replies; only message in thread
From: Clément Pit-Claudel @ 2018-09-02 16:16 UTC (permalink / raw)
  To: Emacs developers

Hi all,

In the course of debugging proof-general's installation, I've run across the following bit in package--list-loaded-files:

           (mapcar
               (lambda (x) (let* ((file (file-relative-name x dir))
                             ;; Previously loaded file, if any.
                             (previous
                              (ignore-errors ;; ← !!
                                (file-name-sans-extension
                                 (file-truename (find-library-name file)))))
                             (pos (when previous (member previous history))))
                        ;; Return (RELATIVE-FILENAME . HISTORY-POSITION)
                        (when pos
                          (cons (file-name-sans-extension file) (length pos)))))
             (directory-files-recursively dir "\\`[^\\.].*\\.el\\'")))))

This is supposed to find all previously-loaded files in `dir'.  The part that I've highlighted with `;; ← !!' seems wrong: since package.el never loads `find-func' the function `find-library-name' is never defined, and calling it always raises an error, caught by the ignore-errors form.  This means that package--list-loaded-files always returns nil, and package--load-files-for-activation never reloads anything.

Of course, if the user's init file somehow requires find-func, or if any file compiled by package.el requires find-func, then find-library-name is available and package--list-loaded-files works just fine.

The reason why the missing function doesn't cause a byte-compiler warning is that package.el includes a (declare-function find-library-name "find-func" (library)) form.

Am I missing something?

Thanks!
Clément.






^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-09-02 16:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-02 16:16 Is package--list-loaded-files broken? Clément Pit-Claudel

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.