Steve Purcell wrote: > Given an init.el snippet like: > > (add-hook 'after-init-hook > (lambda () > (require 'server) > (unless (server-running-p) > (server-start)))) > > the `load-history' var will contain an entry with a nil car (as per its > documentation), inside which the `(require . server)' load will be > noted. > > However, the code in `package--list-loaded-files' unconditionally > applies `file-name-sans-extension' to the cars of `load-history', > resulting in errors whenever packages are activated (e.g. upgraded, > installed). > > I believe the correct fix would be simply add a `stringp' test here: > > https://github.com/emacs-mirror/emacs/blob/5abaf16ab49b86ca5add981c2ddcaea6db0c8a08/lisp/emacs-lisp/package.el#L759 > > (Using a nightly Emacs HEAD snapshot from a couple of days ago.) This is actually not limited to package.el. E. g. lisp/help-fns.el was also written in assumtion, that cars of elements of ‘load-history’ are always file names: