"guix-emacs.el" may be used just for "instructing" Emacs where to find
Emacs packages installed with Guix, so it should have as few
dependencies as possible.
See <http://lists.gnu.org/archive/html/guix-devel/2016-01/msg00022.html>.
* emacs/guix-emacs.el: Require 'guix-profiles' optionally.
(guix-emacs-load-autoloads): Use 'guix-profile-prompt' only if it is
available.
* emacs/guix-emacs.el (guix-emacs-autoloads-regexp): New variable.
(guix-emacs-find-autoloads-in-directory): Return a list of autoloads
without extensions.
* emacs/guix-emacs.el (guix-emacs-load-autoloads): Use 'profile'
as an optional argument.
(guix-emacs-load-autoloads-maybe): Adjust accordingly.
* emacs/guix-init.el: Likewise.
This is a followup to commit 7741139080.
* emacs/guix-emacs.el (guix-emacs-find-autoloads): Fix variable
reference to 'elisp-root-dir'.
Signed-off-by: Alex Kost <alezost@gmail.com>
Co-authored-by: Federico Beffa <beffa@fbengineering.ch>.
* emacs/guix-emacs.el (guix-emacs-find-autoloads-in-directory,
guix-emacs-subdirs): New functions.
(guix-emacs-find-autoloads): Search for autoloads in "guix.d"
subdirectories.
(guix-emacs-load-autoloads): Add subdirectories to 'load-path'.
* emacs/guix-init.el.in: Do not add guix emacs directory to 'load-path'
because it will be done by 'guix-emacs-load-autoloads'. Move
requiring 'guix-emacs' from the top-level to a clause for checking for
'guix-package-enable-at-startup'.