diff options
| -rw-r--r-- | gnu/packages/aux-files/emacs/guix-emacs.el | 21 | ||||
| -rw-r--r-- | gnu/packages/emacs.scm | 4 |
2 files changed, 8 insertions, 17 deletions
diff --git a/gnu/packages/aux-files/emacs/guix-emacs.el b/gnu/packages/aux-files/emacs/guix-emacs.el index 099261a0139..2bbd639ffd6 100644 --- a/gnu/packages/aux-files/emacs/guix-emacs.el +++ b/gnu/packages/aux-files/emacs/guix-emacs.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; guix-emacs.el --- Emacs packages installed with Guix | 1 | ;;; guix-emacs.el --- Emacs packages installed with Guix |
| 2 | 2 | ||
| 3 | ;; Copyright © 2014, 2015, 2016 Alex Kost <alezost@gmail.com> | 3 | ;; Copyright © 2014, 2015, 2016, 2017 Alex Kost <alezost@gmail.com> |
| 4 | 4 | ||
| 5 | ;; This file is part of GNU Guix. | 5 | ;; This file is part of GNU Guix. |
| 6 | 6 | ||
| @@ -19,22 +19,14 @@ | |||
| 19 | 19 | ||
| 20 | ;;; Commentary: | 20 | ;;; Commentary: |
| 21 | 21 | ||
| 22 | ;; This file provides auxiliary code for working with Emacs packages | 22 | ;; This file provides auxiliary code to autoload Emacs packages |
| 23 | ;; installed with Guix. | 23 | ;; installed with Guix. |
| 24 | 24 | ||
| 25 | ;;; Code: | 25 | ;;; Code: |
| 26 | 26 | ||
| 27 | (require 'cl-lib) | 27 | (require 'cl-lib) |
| 28 | (unless (require 'guix-profiles nil t) | ||
| 29 | (defvar guix-user-profile (expand-file-name "~/.guix-profile"))) | ||
| 30 | 28 | ||
| 31 | (defcustom guix-package-enable-at-startup t | 29 | (defvar guix-user-profile (expand-file-name "~/.guix-profile")) |
| 32 | "If non-nil, activate Emacs packages installed in a user profile. | ||
| 33 | Set this variable to nil before requiring `guix-emacs' file to | ||
| 34 | avoid loading autoloads of Emacs packages installed in | ||
| 35 | `guix-user-profile'." | ||
| 36 | :type 'boolean | ||
| 37 | :group 'guix) | ||
| 38 | 30 | ||
| 39 | (defvar guix-emacs-autoloads nil | 31 | (defvar guix-emacs-autoloads nil |
| 40 | "List of the last loaded Emacs autoloads.") | 32 | "List of the last loaded Emacs autoloads.") |
| @@ -92,8 +84,8 @@ profiles. | |||
| 92 | 'Autoload' means add directories with Emacs packages to | 84 | 'Autoload' means add directories with Emacs packages to |
| 93 | `load-path' and load 'autoloads' files matching | 85 | `load-path' and load 'autoloads' files matching |
| 94 | `guix-emacs-autoloads-regexp'." | 86 | `guix-emacs-autoloads-regexp'." |
| 95 | (interactive (list (if (fboundp 'guix-profile-prompt) | 87 | (interactive (list (if (fboundp 'guix-read-package-profile) |
| 96 | (funcall 'guix-profile-prompt) | 88 | (funcall 'guix-read-package-profile) |
| 97 | guix-user-profile))) | 89 | guix-user-profile))) |
| 98 | (let ((profiles (or profiles | 90 | (let ((profiles (or profiles |
| 99 | (list "/run/current-system/profile" | 91 | (list "/run/current-system/profile" |
| @@ -115,9 +107,6 @@ profiles. | |||
| 115 | (setq guix-emacs-autoloads | 107 | (setq guix-emacs-autoloads |
| 116 | (append new-autoloads guix-emacs-autoloads)))))))) | 108 | (append new-autoloads guix-emacs-autoloads)))))))) |
| 117 | 109 | ||
| 118 | (when guix-package-enable-at-startup | ||
| 119 | (guix-emacs-autoload-packages)) | ||
| 120 | |||
| 121 | (provide 'guix-emacs) | 110 | (provide 'guix-emacs) |
| 122 | 111 | ||
| 123 | ;;; guix-emacs.el ends here | 112 | ;;; guix-emacs.el ends here |
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 3e722c326b1..ca3b832dc03 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm | |||
| @@ -144,7 +144,9 @@ | |||
| 144 | (string-append lisp-dir "/guix-emacs.el")) | 144 | (string-append lisp-dir "/guix-emacs.el")) |
| 145 | (with-output-to-file (string-append lisp-dir "/site-start.el") | 145 | (with-output-to-file (string-append lisp-dir "/site-start.el") |
| 146 | (lambda () | 146 | (lambda () |
| 147 | (display "(require 'guix-emacs nil t)"))) | 147 | (display |
| 148 | (string-append "(when (require 'guix-emacs nil t)\n" | ||
| 149 | " (guix-emacs-autoload-packages))\n")))) | ||
| 148 | #t)))))) | 150 | #t)))))) |
| 149 | (inputs | 151 | (inputs |
| 150 | `(("gnutls" ,gnutls) | 152 | `(("gnutls" ,gnutls) |
