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:
parent
c2bbad0a18
commit
c516f217d6
1 changed files with 5 additions and 4 deletions
|
|
@ -37,10 +37,11 @@
|
||||||
|
|
||||||
(defconst package-autosuggest-database
|
(defconst package-autosuggest-database
|
||||||
(eval-when-compile
|
(eval-when-compile
|
||||||
|
(if-let* ((db (expand-file-name "package-autosuggest.eld" data-directory))
|
||||||
|
((file-exists-p db)))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(insert-file-contents
|
(insert-file-contents db)
|
||||||
(expand-file-name "package-autosuggest.eld" data-directory))
|
(read (current-buffer)))))
|
||||||
(read (current-buffer))))
|
|
||||||
"List of hints for packages to suggest installing.
|
"List of hints for packages to suggest installing.
|
||||||
Each hint has the form (PACKAGE TYPE DATA), where PACKAGE is a symbol
|
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
|
denoting the package and major-mode the hint applies to, TYPE is one of
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue