From b02ad19305b8b35444e517318e85fefc4c8a31c9 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 1 Sep 2023 00:53:21 -0400 Subject: gnu: emacs: Reload subdirs.el files in ‘guix-emacs-autoload-packages’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a regression introduced with 79cfe30f3 ("build-system: emacs: Use subdirectories again.") which caused the 'guix-emacs-autoload-packages' to no longer be able to autoload all packages. * gnu/packages/aux-files/emacs/guix-emacs.el (guix-emacs-autoload-packages): Reload subdirs.el files unless NO-RELOAD is provided. Update docstring. * doc/guix.texi (Application Setup): Document that ‘guix-emacs-autoload-packages’ can be invoked interactively to auto-reload newly installed Emacs packages. * gnu/packages/emacs.scm (emacs)[arguments]<#:phases>: Call guix-emacs-autoload-packages with an argument in the site-start.el file. Signed-off-by: Liliana Marie Prikler --- gnu/packages/aux-files/emacs/guix-emacs.el | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'gnu/packages/aux-files') diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el b/gnu/packages/aux-files/emacs/guix-emacs.el index 84284dde39..c253e64df8 100644 --- a/gnu/packages/aux-files/emacs/guix-emacs.el +++ b/gnu/packages/aux-files/emacs/guix-emacs.el @@ -65,12 +65,21 @@ The files in the list do not have extensions (.el, .elc)." (guix-emacs--non-core-load-path)))) ;;;###autoload -(defun guix-emacs-autoload-packages () +(defun guix-emacs-autoload-packages (&optional no-reload) "Autoload Emacs packages found in EMACSLOADPATH. 'Autoload' means to load the 'autoloads' files matching -`guix-emacs-autoloads-regexp'." - (interactive) +`guix-emacs-autoloads-regexp'. By default, the subdirs.el files +found on the load path are reloaded to discover newly installed +packages, unless NO-RELOAD is provided." + (interactive "P") + ;; Reload the subdirs.el files such as the one generated by the Guix profile + ;; hook, so that newly installed Emacs packages located under + ;; sub-directories are put on the load-path without having to restart Emacs. + (unless no-reload + (mapc #'guix-emacs--load-file-no-error (guix-emacs--subdirs-files)) + (setq load-path (delete-dups load-path))) + (let ((autoloads (mapcan #'guix-emacs-find-autoloads (guix-emacs--non-core-load-path)))) (mapc #'guix-emacs--load-file-no-error autoloads))) -- cgit v1.2.3