[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Is package--list-loaded-files broken?
From: |
Clément Pit-Claudel |
Subject: |
Is package--list-loaded-files broken? |
Date: |
Sun, 2 Sep 2018 12:16:40 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Is package--list-loaded-files broken?,
Clément Pit-Claudel <=