From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH 2/4] emacs: Move loading packages to "guix-emacs.el". Date: Wed, 6 Jan 2016 19:55:03 +0300 Message-ID: <1452099305-746-3-git-send-email-alezost@gmail.com> References: <1452099305-746-1-git-send-email-alezost@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGrNZ-0003SB-Tp for guix-devel@gnu.org; Wed, 06 Jan 2016 11:56:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aGrNU-00013p-5A for guix-devel@gnu.org; Wed, 06 Jan 2016 11:56:09 -0500 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:33247) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aGrNT-00013k-Ty for guix-devel@gnu.org; Wed, 06 Jan 2016 11:56:04 -0500 Received: by mail-lf0-x22e.google.com with SMTP id p203so318885012lfa.0 for ; Wed, 06 Jan 2016 08:56:03 -0800 (PST) Received: from localhost.localdomain ([217.107.192.146]) by smtp.gmail.com with ESMTPSA id h9sm17188380lbj.42.2016.01.06.08.56.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 08:56:02 -0800 (PST) In-Reply-To: <1452099305-746-1-git-send-email-alezost@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org * emacs/guix-init.el: Move the code for auto-loading Emacs packages to... (guix-package-enable-at-startup): Move to... * emacs/guix-emacs.el (guix-package-enable-at-startup): ... here. --- emacs/guix-emacs.el | 12 ++++++++++++ emacs/guix-init.el | 13 ------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/emacs/guix-emacs.el b/emacs/guix-emacs.el index 311ab33..37a0bb2 100644 --- a/emacs/guix-emacs.el +++ b/emacs/guix-emacs.el @@ -28,6 +28,14 @@ (unless (require 'guix-profiles nil t) (defvar guix-user-profile (expand-file-name "~/.guix-profile"))) +(defcustom guix-package-enable-at-startup t + "If non-nil, activate Emacs packages installed in a user profile. +Set this variable to nil before requiring `guix-emacs' file to +avoid loading autoloads of Emacs packages installed in +`guix-user-profile'." + :type 'boolean + :group 'guix) + (defcustom guix-emacs-activate-after-operation t "Activate Emacs packages after installing. If nil, do not load autoloads of the Emacs packages after @@ -117,6 +125,10 @@ See `guix-emacs-activate-after-operation' for details." ;; profile will not be loaded). (guix-emacs-load-autoloads guix-current-profile))) +(when guix-package-enable-at-startup + (add-to-list 'load-path (guix-emacs-directory)) + (guix-emacs-load-autoloads)) + (provide 'guix-emacs) ;;; guix-emacs.el ends here diff --git a/emacs/guix-init.el b/emacs/guix-init.el index 1da6070..47ced6a 100644 --- a/emacs/guix-init.el +++ b/emacs/guix-init.el @@ -1,19 +1,6 @@ (require 'guix-autoloads) (require 'guix-emacs) -(defcustom guix-package-enable-at-startup t - "If non-nil, activate Emacs packages installed in a user profile. -Set this variable to nil before requiring `guix-init' file to -avoid loading autoloads of Emacs packages installed in -`guix-user-profile'." - :type 'boolean - :group 'guix) - -(add-to-list 'load-path (guix-emacs-directory)) - -(when guix-package-enable-at-startup - (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) -- 2.6.3