1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Gracefully handle the non-existence of "package-autosuggest.eld"

* lisp/package/package-autosuggest.el (package-autosuggest-database):
Check if the file name exists and is readable before slurping
the contents.
This commit is contained in:
Philip Kaludercic 2025-09-02 16:06:19 +02:00
parent c2bbad0a18
commit c516f217d6

View file

@ -37,10 +37,11 @@
(defconst package-autosuggest-database
(eval-when-compile
(with-temp-buffer
(insert-file-contents
(expand-file-name "package-autosuggest.eld" data-directory))
(read (current-buffer))))
(if-let* ((db (expand-file-name "package-autosuggest.eld" data-directory))
((file-exists-p db)))
(with-temp-buffer
(insert-file-contents db)
(read (current-buffer)))))
"List of hints for packages to suggest installing.
Each hint has the form (PACKAGE TYPE DATA), where PACKAGE is a symbol
denoting the package and major-mode the hint applies to, TYPE is one of