guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 50621bc51af327c370581e248e842c54222c5239
Author: Sergey Trofimov <[email protected]>
AuthorDate: Mon Jan 12 10:17:35 2026 +0100
gnu: emacs: Make guix-emacs-autoload-packages tolerant to non-existent
directories.
* gnu/packages/aux-files/emacs/guix-emacs.el
(guix-emacs-find-autoloads): Warn about non-existent directories in load
path instead of raising an error.
Change-Id: Icf470d7aa0f2f8a694c13c8d84b9f7c50c334919
Signed-off-by: Liliana Marie Prikler <[email protected]>
---
gnu/packages/aux-files/emacs/guix-emacs.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el
b/gnu/packages/aux-files/emacs/guix-emacs.el
index 265c8bde16..8cffe039e0 100644
--- a/gnu/packages/aux-files/emacs/guix-emacs.el
+++ b/gnu/packages/aux-files/emacs/guix-emacs.el
@@ -38,19 +38,23 @@ Historically, this used to be the package name followed by
\"-autoloads.el\".
As of Emacs 29, the term \"loaddefs\" is preferred over \"autoloads\",
but they function much in the same manner.")
-(defun guix-emacs-find-autoloads (directory)
- "Return a list of files containing autoload definitions in DIRECTORY.
-The files in the list do not have extensions (.el, .elc)."
- ;; `directory-files' doesn't honor group in regexp.
- (delete-dups (mapcar #'file-name-sans-extension
- (directory-files directory 'full-name
- guix-emacs-autoloads-regexp))))
-
(defcustom guix-emacs-verbose nil
"Set to true to provide verbose messages, such as when loading packages."
:type 'boolean
:group 'guix-emacs)
+(defun guix-emacs-find-autoloads (directory)
+ "Return a list of files containing autoload definitions in DIRECTORY.
+The files in the list do not have extensions (.el, .elc)."
+ ;; `directory-files' doesn't honor group in regexp.
+ (if (file-directory-p directory)
+ (delete-dups (mapcar #'file-name-sans-extension
+ (directory-files directory 'full-name
+ guix-emacs-autoloads-regexp)))
+ (when guix-emacs-verbose
+ (message "Ignoring nonexistent load-path directory: %s" directory)
+ nil)))
+
(defun guix-emacs--load-file-no-error (file)
"Load FILE, ignoring any errors"
(load file 'noerror (not guix-emacs-verbose)))