Stefan Monnier writes: >> + (let ((package-alist ;see bug#65475 >> (let ((pkgs (assq name package-alist))) > [...] >> + (set-default-toplevel-value 'package-alist package-alist) > [...] > > Eww!! > > If we really can't find a better option, we need to add a bunch of > comments explaining why we ended up with such a hack. It seems that it is only necessary to bind `package-alist' during the invocation of `package--used-elsewhere-p', so this is a more conservative proposal: