[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/06: emacs: 'guix-emacs-load-autoloads' takes a profile.
From: |
Alex Kost |
Subject: |
03/06: emacs: 'guix-emacs-load-autoloads' takes a profile. |
Date: |
Sun, 06 Dec 2015 09:55:01 +0000 |
alezost pushed a commit to branch master
in repository guix.
commit a65f0075244cb0c2422e13419a3094baf0ae6f24
Author: Alex Kost <address@hidden>
Date: Fri Nov 27 16:07:20 2015 +0300
emacs: 'guix-emacs-load-autoloads' takes a profile.
* 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.
---
emacs/guix-emacs.el | 36 ++++++++++++++++++++----------------
emacs/guix-init.el | 2 +-
2 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/emacs/guix-emacs.el b/emacs/guix-emacs.el
index 0e3e8c2..6515b3d 100644
--- a/emacs/guix-emacs.el
+++ b/emacs/guix-emacs.el
@@ -74,29 +74,33 @@ Return nil if there are no emacs packages installed in
PROFILE."
nil)))
;;;###autoload
-(defun guix-emacs-load-autoloads (&optional all)
- "Load autoloads for Emacs packages installed in a user profile.
-Add autoloads directories to `load-path'.
-If ALL is nil, activate only those packages that were installed
-after the last activation, otherwise activate all Emacs packages
-installed in `guix-user-profile'."
- (interactive "P")
- (let* ((autoloads (guix-emacs-find-autoloads))
- (files (if all
- autoloads
- (cl-nset-difference autoloads guix-emacs-autoloads
- :test #'string=))))
- (dolist (file files)
- (cl-pushnew (file-name-directory file) load-path
+(defun guix-emacs-load-autoloads (&optional profile)
+ "Load autoloads for Emacs packages installed in PROFILE.
+If PROFILE is nil, use `guix-user-profile'.
+Add autoloads directories to `load-path'."
+ (interactive (list (guix-profile-prompt)))
+ (let* ((autoloads (guix-emacs-find-autoloads profile))
+ (new-autoloads (cl-nset-difference autoloads
+ guix-emacs-autoloads
+ :test #'string=)))
+ (dolist (file new-autoloads)
+ (cl-pushnew (directory-file-name (file-name-directory file))
+ load-path
:test #'string=)
(load file 'noerror))
- (setq guix-emacs-autoloads autoloads)))
+ (setq guix-emacs-autoloads
+ (append new-autoloads guix-emacs-autoloads))))
(defun guix-emacs-load-autoloads-maybe ()
"Load autoloads for Emacs packages if needed.
See `guix-emacs-activate-after-operation' for details."
(and guix-emacs-activate-after-operation
- (guix-emacs-load-autoloads)))
+ ;; FIXME Since a user can work with a non-current profile (using
+ ;; C-u before `guix-search-by-name' and other commands), emacs
+ ;; packages can be installed to another profile, and the
+ ;; following code will not work (i.e., the autoloads for this
+ ;; profile will not be loaded).
+ (guix-emacs-load-autoloads guix-current-profile)))
(provide 'guix-emacs)
diff --git a/emacs/guix-init.el b/emacs/guix-init.el
index 1612dee..1da6070 100644
--- a/emacs/guix-init.el
+++ b/emacs/guix-init.el
@@ -12,7 +12,7 @@ avoid loading autoloads of Emacs packages installed in
(add-to-list 'load-path (guix-emacs-directory))
(when guix-package-enable-at-startup
- (guix-emacs-load-autoloads 'all))
+ (guix-emacs-load-autoloads))
(add-hook 'scheme-mode-hook 'guix-devel-activate-mode-maybe)
(add-hook 'shell-mode-hook 'guix-build-log-minor-mode-activate-maybe)
- branch master updated (e2e3600 -> 7edf242), Alex Kost, 2015/12/06
- 01/06: emacs: Fix 'guix-apply-manifest'., Alex Kost, 2015/12/06
- 02/06: emacs: Fix 'guix-pull'., Alex Kost, 2015/12/06
- 06/06: gnu: manaplus: Update to 1.5.12.5., Alex Kost, 2015/12/06
- 03/06: emacs: 'guix-emacs-load-autoloads' takes a profile.,
Alex Kost <=
- 04/06: emacs: Complete --profile in 'guix package' popup., Alex Kost, 2015/12/06
- 05/06: emacs: info: Show a message after copying button label., Alex Kost, 2015/12/06