Commit graph

11 commits

Author SHA1 Message Date
Alex Kost
004ea62955 emacs: Find Emacs packages in a system profile.
Fixes <http://bugs.gnu.org/22550>.
Reported by myglc2 <myglc2@gmail.com>.

* emacs/guix-emacs.el (guix-emacs-autoload-packages): Autoload Emacs
  packages installed in a system profile.
2016-02-07 11:24:35 +03:00
Alex Kost
09b634565d emacs: Move the code to load Emacs packages after installing.
This code should belong to "guix-backend" as it is run after a REPL
operation to check if new Emacs packages have been installed and to
autoload them if needed.

* emacs/guix-emacs.el (guix-emacs-activate-after-operation)
(guix-emacs-load-autoloads-maybe): Move and rename to...
* emacs/guix-backend.el (guix-emacs-activate-after-operation)
(guix-repl-autoload-emacs-packages-maybe): ... this.
(guix-after-repl-operation-hook): Adjust for the renaming.
2016-02-07 11:24:35 +03:00
Alex Kost
abea77e3f0 emacs: Factorize searching for Emacs packages.
* emacs/guix-emacs.el: (guix-emacs-directories): New procedure.
(guix-emacs-find-autoloads-in-directory): Rename to...
(guix-emacs-find-autoloads): ... this.
(guix-emacs-load-autoloads): Remove.  Replace with...
(guix-emacs-autoload-packages): ... this.  New procedure.  At first,
find a list of directories with Emacs packages, then add them to
'load-path' and finally, load autoloads.
* doc/emacs.texi (Emacs Initial Setup): Adjust accordingly.
2016-02-07 11:24:35 +03:00
Alex Kost
6d268e5281 emacs: Move loading packages to "guix-emacs.el".
* 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.
2016-01-13 17:56:14 +03:00
Alex Kost
e4e2154644 emacs: Make "guix-emacs.el" independent.
"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.
2016-01-13 17:56:14 +03:00
Alex Kost
98f4a9004b emacs: Handle compiled autoloads.
* emacs/guix-emacs.el (guix-emacs-autoloads-regexp): New variable.
  (guix-emacs-find-autoloads-in-directory): Return a list of autoloads
  without extensions.
2015-12-11 14:34:03 +03:00
Alex Kost
a65f007524 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.
2015-12-06 12:46:10 +03:00
Ludovic Courtès
6078594b13 emacs: Require 'cl-lib'.
* emacs/guix-emacs.el: Require 'cl-lib', for 'cl-pushnew'.
2015-07-20 22:25:42 +02:00
Christopher Allan Webber
8c9610be19 emacs: Fix reference to directory variable.
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>
2015-07-20 11:37:35 +03:00
Alex Kost
7741139080 emacs: Find autoloads in "guix.d" subdirectories.
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'.
2015-07-11 18:21:35 +03:00
Alex Kost
12f2490aa3 emacs: Handle autoloading Emacs packages installed with Guix.
* emacs/guix-emacs.el: New file.
* emacs.am (ELFILES): Add it.
* emacs/guix-backend.el (guix-after-repl-operation-hook): Add
  'guix-emacs-load-autoloads-maybe'.
* emacs/guix-init.el.in: Autoload emacs packages.
  (guix-package-enable-at-startup): New variable.
2014-12-02 22:09:23 +03:00