2014-08-27 08:44:17 -04:00
|
|
|
@node Emacs Interface
|
2015-08-13 13:16:29 -04:00
|
|
|
@chapter Emacs Interface
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@cindex Emacs
|
2015-08-13 13:16:29 -04:00
|
|
|
GNU Guix comes with several useful modules (known as ``guix.el'') for
|
|
|
|
GNU@tie{}Emacs which are intended to make an Emacs user interaction with
|
|
|
|
Guix convenient and fun.
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@menu
|
2014-10-17 13:22:38 -04:00
|
|
|
* Initial Setup: Emacs Initial Setup. Preparing @file{~/.emacs}.
|
2015-08-13 13:16:29 -04:00
|
|
|
* Package Management: Emacs Package Management. Managing packages and generations.
|
2016-01-21 14:07:10 -05:00
|
|
|
* Licenses: Emacs Licenses. Interface for licenses of Guix packages.
|
2015-08-14 03:47:10 -04:00
|
|
|
* Popup Interface: Emacs Popup Interface. Magit-like interface for guix commands.
|
2014-11-04 11:38:27 -05:00
|
|
|
* Prettify Mode: Emacs Prettify. Abbreviating @file{/gnu/store/@dots{}} file names.
|
2015-09-12 15:16:42 -04:00
|
|
|
* Build Log Mode: Emacs Build Log. Highlighting Guix build logs.
|
2015-07-24 11:33:14 -04:00
|
|
|
* Completions: Emacs Completions. Completing @command{guix} shell command.
|
|
|
|
* Development: Emacs Development. Tools for Guix developers.
|
2015-12-11 06:01:35 -05:00
|
|
|
* Hydra: Emacs Hydra. Interface for Guix build farm.
|
2014-08-27 08:44:17 -04:00
|
|
|
@end menu
|
|
|
|
|
2015-08-13 13:16:29 -04:00
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Initial Setup
|
2015-08-13 13:16:29 -04:00
|
|
|
@section Initial Setup
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2015-01-23 09:07:18 -05:00
|
|
|
On the Guix System Distribution (@pxref{GNU Distribution}), ``guix.el''
|
|
|
|
is ready to use, provided Guix is installed system-wide, which is the
|
|
|
|
case by default. So if that is what you're using, you can happily skip
|
|
|
|
this section and read about the fun stuff.
|
|
|
|
|
2015-05-23 06:42:20 -04:00
|
|
|
If you're not yet a happy user of GuixSD, a little bit of setup is needed.
|
2014-08-27 08:44:17 -04:00
|
|
|
To be able to use ``guix.el'', you need to install the following
|
|
|
|
packages:
|
|
|
|
|
|
|
|
@itemize
|
|
|
|
@item
|
|
|
|
@uref{http://www.gnu.org/software/emacs/, GNU Emacs}, version 24.3 or
|
|
|
|
later;
|
|
|
|
|
|
|
|
@item
|
|
|
|
@uref{http://nongnu.org/geiser/, Geiser}, version 0.3 or later: it is
|
|
|
|
used for interacting with the Guile process.
|
|
|
|
|
2015-08-14 03:47:10 -04:00
|
|
|
@item
|
|
|
|
@uref{https://github.com/magit/magit/, magit-popup library}. You
|
|
|
|
already have this library if you use Magit 2.1.0 or later. This library
|
|
|
|
is an optional dependency---it is required only for @kbd{M-x@tie{}guix}
|
|
|
|
command (@pxref{Emacs Popup Interface}).
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@end itemize
|
|
|
|
|
2015-06-07 14:43:58 -04:00
|
|
|
When it is done ``guix.el'' may be configured by requiring a special
|
|
|
|
@code{guix-init} file---i.e., by adding the following code into your
|
|
|
|
init file (@pxref{Init File,,, emacs, The GNU Emacs Manual}):
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@example
|
2015-06-07 14:43:58 -04:00
|
|
|
(add-to-list 'load-path "/path/to/directory-with-guix.el")
|
2014-08-27 08:44:17 -04:00
|
|
|
(require 'guix-init nil t)
|
|
|
|
@end example
|
|
|
|
|
2015-06-07 14:43:58 -04:00
|
|
|
So the only thing you need to figure out is where the directory with
|
|
|
|
elisp files for Guix is placed. It depends on how you installed Guix:
|
|
|
|
|
|
|
|
@itemize
|
|
|
|
@item
|
|
|
|
If it was installed by a package manager of your distribution or by a
|
|
|
|
usual @code{./configure && make && make install} command sequence, then
|
|
|
|
elisp files are placed in a standard directory with Emacs packages
|
|
|
|
(usually it is @file{/usr/share/emacs/site-lisp/}), which is already in
|
|
|
|
@code{load-path}, so there is no need to add that directory there.
|
|
|
|
|
|
|
|
@item
|
|
|
|
If you used a binary installation method (@pxref{Binary Installation}),
|
|
|
|
then Guix is installed somewhere in the store, so the elisp files are
|
|
|
|
placed in @file{/gnu/store/@dots{}-guix-0.8.2/share/emacs/site-lisp/} or
|
|
|
|
alike. However it is not recommended to refer directly to a store
|
|
|
|
directory. Instead you can install Guix using Guix itself with
|
|
|
|
@command{guix package -i guix} command (@pxref{Invoking guix package})
|
|
|
|
and add @file{~/.guix-profile/share/emacs/site-lisp/} directory to
|
|
|
|
@code{load-path} variable.
|
|
|
|
|
|
|
|
@item
|
|
|
|
If you did not install Guix at all and prefer a hacking way
|
|
|
|
(@pxref{Running Guix Before It Is Installed}), along with augmenting
|
|
|
|
@code{load-path} you need to set @code{guix-load-path} variable to the
|
|
|
|
same directory, so your final configuration will look like this:
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@example
|
2015-06-07 14:43:58 -04:00
|
|
|
(let ((dir "/path/to/your-guix-git-tree/emacs"))
|
|
|
|
(add-to-list 'load-path dir)
|
|
|
|
(setq guix-load-path dir))
|
|
|
|
(require 'guix-init nil t)
|
2014-08-27 08:44:17 -04:00
|
|
|
@end example
|
2015-06-07 14:43:58 -04:00
|
|
|
@end itemize
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2014-12-02 02:36:25 -05:00
|
|
|
By default, along with autoloading (@pxref{Autoload,,, elisp, The GNU
|
|
|
|
Emacs Lisp Reference Manual}) the main interactive commands for
|
|
|
|
``guix.el'' (@pxref{Emacs Commands}), requiring @code{guix-init} will
|
|
|
|
also autoload commands for the Emacs packages installed in your user
|
|
|
|
profile.
|
|
|
|
|
|
|
|
To disable automatic loading of installed Emacs packages, set
|
|
|
|
@code{guix-package-enable-at-startup} variable to @code{nil} before
|
|
|
|
requiring @code{guix-init}. This variable has the same meaning for
|
|
|
|
Emacs packages installed with Guix, as @code{package-enable-at-startup}
|
2014-12-03 12:25:27 -05:00
|
|
|
for the built-in Emacs package system (@pxref{Package Installation,,,
|
2014-12-02 02:36:25 -05:00
|
|
|
emacs, The GNU Emacs Manual}).
|
|
|
|
|
|
|
|
You can activate Emacs packages installed in your profile whenever you
|
2016-02-05 03:46:40 -05:00
|
|
|
want using @kbd{M-x@tie{}guix-emacs-autoload-packages}.
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2015-08-13 13:16:29 -04:00
|
|
|
|
|
|
|
@node Emacs Package Management
|
|
|
|
@section Package Management
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
Once ``guix.el'' has been successfully configured, you should be able to
|
2015-08-13 13:16:29 -04:00
|
|
|
use a visual interface for routine package management tasks, pretty much
|
|
|
|
like the @command{guix package} command (@pxref{Invoking guix package}).
|
|
|
|
Specifically, it makes it easy to:
|
|
|
|
|
|
|
|
@itemize
|
|
|
|
@item browse and display packages and generations;
|
|
|
|
@item search, install, upgrade and remove packages;
|
|
|
|
@item display packages from previous generations;
|
|
|
|
@item do some other useful things.
|
|
|
|
@end itemize
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@menu
|
2014-10-17 13:22:38 -04:00
|
|
|
* Commands: Emacs Commands. @kbd{M-x guix-@dots{}}
|
|
|
|
* General information: Emacs General info. Common for both interfaces.
|
|
|
|
* ``List'' buffer: Emacs List buffer. List-like interface.
|
|
|
|
* ``Info'' buffer: Emacs Info buffer. Help-like interface.
|
2015-08-13 13:16:29 -04:00
|
|
|
* Configuration: Emacs Configuration. Configuring the interface.
|
2014-08-27 08:44:17 -04:00
|
|
|
@end menu
|
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Commands
|
2015-08-13 13:16:29 -04:00
|
|
|
@subsection Commands
|
2014-08-27 08:44:17 -04:00
|
|
|
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
All commands for displaying packages and generations use the current
|
|
|
|
profile, which can be changed with
|
|
|
|
@kbd{M-x@tie{}guix-set-current-profile}. Alternatively, if you call any
|
|
|
|
of these commands with prefix argument (@kbd{C-u}), you will be prompted
|
|
|
|
for a profile just for that command.
|
|
|
|
|
|
|
|
Commands for displaying packages:
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@table @kbd
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@item M-x guix-all-available-packages
|
|
|
|
@itemx M-x guix-newest-available-packages
|
|
|
|
Display all/newest available packages.
|
|
|
|
|
|
|
|
@item M-x guix-installed-packages
|
2016-02-11 03:21:56 -05:00
|
|
|
@itemx M-x guix-installed-user-packages
|
|
|
|
@itemx M-x guix-installed-system-packages
|
|
|
|
Display installed packages. As described above, @kbd{M-x
|
|
|
|
guix-installed-packages} uses an arbitrary profile that you can specify,
|
|
|
|
while the other commands display packages installed in 2 special
|
|
|
|
profiles: @file{~/.guix-profile} and @file{/run/current-system/profile}
|
|
|
|
(only on GuixSD).
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@item M-x guix-obsolete-packages
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
Display obsolete packages (the packages that are installed in a profile
|
|
|
|
but cannot be found among available packages).
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2016-01-12 10:06:32 -05:00
|
|
|
@item M-x guix-packages-by-name
|
2014-08-27 08:44:17 -04:00
|
|
|
Display package(s) with the specified name.
|
|
|
|
|
2016-01-20 10:53:19 -05:00
|
|
|
@item M-x guix-packages-by-license
|
|
|
|
Display package(s) with the specified license.
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@item M-x guix-search-by-regexp
|
|
|
|
Search for packages by a specified regexp. By default ``name'',
|
|
|
|
``synopsis'' and ``description'' of the packages will be searched. This
|
emacs: Reorganize package/generation UI code.
Move the code for packages/generations interface from "guix-info.el",
"guix-list.el", "guix-base.el" and "guix.el" to "guix-ui-package.el" and
"guix-ui-generation.el".
* emacs/guix-base.el (guix-package-entry->name-specification)
(guix-package-entries->name-specifications)
(guix-package-id-and-output-by-output-id)
(guix-package-installed-outputs, guix-process-package-actions)
(guix-package-list-type, guix-package-info-type)
(guix-continue-package-operation-p, guix-get-package-strings)
(guix-insert-package-strings): Move to "guix-ui-package.el".
(guix-generation-packages-buffer-name-function, guix-output-name-width)
(guix-generation-packages-update-buffer, guix-generation-packages)
(guix-generation-packages-buffer-name-default)
(guix-generation-packages-buffer-name-long)
(guix-generation-packages-buffer-name, guix-generation-packages-buffer)
(guix-generation-insert-packages, guix-generation-insert-package)
(guix-profile-generation-manifest-file, guix-delete-generations)
(guix-profile-generation-packages-buffer, guix-switch-to-generation):
Move to "guix-ui-generation.el".
* emacs/guix-info.el (guix-package-location, guix-package-name)
(guix-package-source, guix-package-info-source)
(guix-package-info-heading, guix-package-info-license)
(guix-package-info-name, guix-package-info-name-button)
(guix-package-info-version, guix-package-info-location)
(guix-package-info-synopsis, guix-package-info-description)
(guix-package-info-obsolete, guix-package-info-installed-outputs)
(guix-package-info-uninstalled-outputs)
(guix-package-info-insert-heading)
(guix-package-info-define-insert-inputs)
(guix-package-info-obsolete-string)
(guix-package-info-insert-obsolete-text)
(guix-package-info-insert-non-unique-text)
(guix-package-info-insert-outputs, guix-package-info-insert-output)
(guix-package-info-insert-action-button)
(guix-package-info-auto-find-source)
(guix-package-info-auto-download-source)
(guix-package-info-download-buffer, guix-package-info-show-source)
(guix-package-info-download-source, guix-package-info-insert-source)
(guix-package-info-redisplay-after-download)
(guix-output-info-insert-version, guix-output-info-insert-output):
Move to "guix-ui-package.el".
(guix-generation-info-number, guix-generation-info-current)
(guix-generation-not-current, guix-generation-info-insert-number)
(guix-generation-info-insert-current): Move to "guix-ui-generation.el".
* emacs/guix-list.el (guix-package-list-generation-marking-enabled)
(guix-package-list-installed, guix-package-list-obsolete)
(guix-package-list-get-name, guix-package-list-get-installed-outputs)
(guix-package-list-marking-check, guix-package-list-mark-outputs)
(guix-package-list-mark-install, guix-package-list-mark-delete)
(guix-package-list-mark-upgrade, guix-package-list-mark-upgrades)
(guix-list-mark-package-upgrades, guix-list-execute-package-actions)
(guix-package-list-execute, guix-package-list-make-action)
(guix-package-list-edit, guix-output-list-mark-install)
(guix-output-list-mark-delete, guix-output-list-mark-upgrade)
(guix-output-list-mark-upgrades, guix-output-list-make-action)
(guix-output-list-describe, guix-output-list-edit): Move to
"guix-ui-package.el".
(guix-generation-list-get-current, guix-generation-list-switch)
(guix-generation-list-generations-to-compare)
(guix-generation-list-compare, guix-generation-list-show-packages)
(guix-generation-list-show-added-packages)
(guix-generation-list-show-removed-packages)
(guix-generation-list-diff, guix-generation-list-diff-manifests)
(guix-generation-list-ediff, guix-generation-list-ediff-manifests)
(guix-generation-list-diff-packages)
(guix-generation-list-ediff-packages)
(guix-generation-list-mark-delete, guix-generation-list-execute): Move
to "guix-ui-generation.el".
* emacs/guix.el: Remove.
(guix, guix-faces, guix-edit): Move to "guix-base.el".
(guix-list-single-package, guix-search-params, guix-search-history)
(guix-get-show-packages, guix-search-by-name, guix-search-by-regexp)
(guix-installed-packages, guix-obsolete-packages)
(guix-all-available-packages, guix-newest-available-packages): Move
to "guix-ui-package.el".
(guix-get-show-generations, guix-generations, guix-last-generations)
(guix-generations-by-time): Move to "guix-ui-generation.el".
* emacs.am (ELFILES): Remove "guix.el". Add "guix-ui-package.el" and
"guix-ui-generation.el".
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2015-12-09 06:44:34 -05:00
|
|
|
can be changed by modifying @code{guix-package-search-params} variable.
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2016-01-12 10:10:14 -05:00
|
|
|
@item M-x guix-search-by-name
|
|
|
|
Search for packages with names matching a specified regexp. This
|
|
|
|
command is the same as @code{guix-search-by-regexp}, except only a
|
|
|
|
package ``name'' is searched.
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@end table
|
|
|
|
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
By default, these commands display each output on a separate line. If
|
|
|
|
you prefer to see a list of packages---i.e., a list with a package per
|
|
|
|
line, use the following setting:
|
2014-09-19 01:57:36 -04:00
|
|
|
|
|
|
|
@example
|
|
|
|
(setq guix-package-list-type 'package)
|
|
|
|
@end example
|
|
|
|
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
Commands for displaying generations:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
|
|
|
|
@item M-x guix-generations
|
|
|
|
List all the generations.
|
|
|
|
|
|
|
|
@item M-x guix-last-generations
|
|
|
|
List the @var{N} last generations. You will be prompted for the number
|
|
|
|
of generations.
|
|
|
|
|
|
|
|
@item M-x guix-generations-by-time
|
|
|
|
List generations matching time period. You will be prompted for the
|
|
|
|
period using Org mode time prompt based on Emacs calendar (@pxref{The
|
2014-11-04 02:20:41 -05:00
|
|
|
date/time prompt,,, org, The Org Manual}).
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
|
|
|
|
@end table
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2016-01-07 15:01:26 -05:00
|
|
|
Analogously on GuixSD you can also display system generations:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
@item M-x guix-system-generations
|
|
|
|
@item M-x guix-last-system-generations
|
|
|
|
@item M-x guix-system-generations-by-time
|
|
|
|
@end table
|
|
|
|
|
2014-10-21 03:48:28 -04:00
|
|
|
You can also invoke the @command{guix pull} command (@pxref{Invoking
|
|
|
|
guix pull}) from Emacs using:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
@item M-x guix-pull
|
|
|
|
With @kbd{C-u}, make it verbose.
|
|
|
|
@end table
|
|
|
|
|
|
|
|
Once @command{guix pull} has succeeded, the Guix REPL is restared. This
|
|
|
|
allows you to keep using the Emacs interface with the updated Guix.
|
|
|
|
|
2016-02-05 06:51:45 -05:00
|
|
|
Finally, there is an Emacs variant of @command{guix edit} command
|
|
|
|
(@pxref{Invoking guix edit}):
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
@item M-x guix-edit
|
|
|
|
As with @kbd{M-x guix-packages-by-name}, you can press @key{TAB} to
|
|
|
|
complete a package name.
|
|
|
|
@end table
|
|
|
|
|
|
|
|
If you are contributing to Guix, you may find it useful for @kbd{M-x
|
|
|
|
guix-edit} to open package files from your git directory. This can be
|
|
|
|
done by setting @code{guix-directory} variable. For example, after
|
|
|
|
this:
|
|
|
|
|
|
|
|
@example
|
|
|
|
(setq guix-directory "~/src/guix")
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@kbd{M-x guix-edit guix} opens
|
|
|
|
@file{~/src/guix/gnu/packages/package-management.scm} file.
|
|
|
|
|
2016-02-07 03:08:57 -05:00
|
|
|
Also you can use @kbd{C-u} prefix argument to specify a directory just
|
|
|
|
for the current @kbd{M-x guix-edit} command.
|
|
|
|
|
2016-02-05 06:51:45 -05:00
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs General info
|
2015-08-13 13:16:29 -04:00
|
|
|
@subsection General information
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
The following keys are available for both ``list'' and ``info'' types of
|
|
|
|
buffers:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
@item l
|
|
|
|
@itemx r
|
|
|
|
Go backward/forward by the history of the displayed results (this
|
|
|
|
history is similar to the history of the Emacs @code{help-mode} or
|
|
|
|
@code{Info-mode}).
|
|
|
|
|
|
|
|
@item g
|
|
|
|
Revert current buffer: update information about the displayed
|
|
|
|
packages/generations and redisplay it.
|
|
|
|
|
|
|
|
@item R
|
|
|
|
Redisplay current buffer (without updating information).
|
|
|
|
|
2015-05-27 13:33:42 -04:00
|
|
|
@item M
|
|
|
|
Apply manifest to the current profile or to a specified profile, if
|
|
|
|
prefix argument is used. This has the same meaning as @code{--manifest}
|
|
|
|
option (@pxref{Invoking guix package}).
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@item C-c C-z
|
2015-10-26 13:44:18 -04:00
|
|
|
@cindex REPL
|
|
|
|
@cindex read-eval-print loop
|
2014-08-27 08:44:17 -04:00
|
|
|
Go to the Guix REPL (@pxref{The REPL,,, geiser, Geiser User Manual}).
|
|
|
|
|
|
|
|
@item h
|
|
|
|
@itemx ?
|
|
|
|
Describe current mode to see all available bindings.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
@emph{Hint:} If you need several ``list'' or ``info'' buffers, you can
|
|
|
|
simlpy @kbd{M-x clone-buffer} them, and each buffer will have its own
|
|
|
|
history.
|
|
|
|
|
|
|
|
@emph{Warning:} Name/version pairs cannot be used to identify packages
|
|
|
|
(because a name is not necessarily unique), so ``guix.el'' uses special
|
|
|
|
identifiers that live only during a guile session, so if the Guix REPL
|
|
|
|
was restarted, you may want to revert ``list'' buffer (by pressing
|
|
|
|
@kbd{g}).
|
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs List buffer
|
2015-08-13 13:16:29 -04:00
|
|
|
@subsection ``List'' buffer
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
An interface of a ``list'' buffer is similar to the interface provided
|
2014-11-04 02:20:41 -05:00
|
|
|
by ``package.el'' (@pxref{Package Menu,,, emacs, The GNU Emacs Manual}).
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
Default key bindings available for both ``package-list'' and
|
|
|
|
``generation-list'' buffers:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
@item m
|
2015-05-27 09:51:25 -04:00
|
|
|
Mark the current entry (with prefix, mark all entries).
|
2014-08-27 08:44:17 -04:00
|
|
|
@item u
|
2014-09-06 10:00:45 -04:00
|
|
|
Unmark the current entry (with prefix, unmark all entries).
|
2014-08-27 08:44:17 -04:00
|
|
|
@item @key{DEL}
|
|
|
|
Unmark backward.
|
|
|
|
@item S
|
|
|
|
Sort entries by a specified column.
|
|
|
|
@end table
|
|
|
|
|
|
|
|
A ``package-list'' buffer additionally provides the following bindings:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
@item @key{RET}
|
|
|
|
Describe marked packages (display available information in a
|
|
|
|
``package-info'' buffer).
|
|
|
|
@item i
|
2014-09-19 01:57:36 -04:00
|
|
|
Mark the current package for installation.
|
2014-08-27 08:44:17 -04:00
|
|
|
@item d
|
2014-09-19 01:57:36 -04:00
|
|
|
Mark the current package for deletion.
|
2014-09-06 10:00:45 -04:00
|
|
|
@item U
|
2014-09-19 01:57:36 -04:00
|
|
|
Mark the current package for upgrading.
|
2014-08-27 08:44:17 -04:00
|
|
|
@item ^
|
2014-09-06 10:00:45 -04:00
|
|
|
Mark all obsolete packages for upgrading.
|
2015-06-19 14:57:04 -04:00
|
|
|
@item e
|
|
|
|
Edit the definition of the curent package (go to its location). This is
|
|
|
|
similar to @command{guix edit} command (@pxref{Invoking guix edit}), but
|
|
|
|
for opening a package recipe in the current Emacs instance.
|
2014-08-27 08:44:17 -04:00
|
|
|
@item x
|
2014-09-19 01:57:36 -04:00
|
|
|
Execute actions on the marked packages.
|
2015-12-11 06:09:27 -05:00
|
|
|
@item B
|
|
|
|
Display latest builds of the current package (@pxref{Emacs Hydra}).
|
2014-08-27 08:44:17 -04:00
|
|
|
@end table
|
|
|
|
|
|
|
|
A ``generation-list'' buffer additionally provides the following
|
|
|
|
bindings:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
@item @key{RET}
|
|
|
|
List packages installed in the current generation.
|
|
|
|
@item i
|
|
|
|
Describe marked generations (display available information in a
|
|
|
|
``generation-info'' buffer).
|
2014-10-10 15:58:30 -04:00
|
|
|
@item s
|
|
|
|
Switch profile to the current generation.
|
2014-10-05 04:31:23 -04:00
|
|
|
@item d
|
|
|
|
Mark the current generation for deletion (with prefix, mark all
|
|
|
|
generations).
|
|
|
|
@item x
|
|
|
|
Execute actions on the marked generations---i.e., delete generations.
|
emacs: Add interface for comparing generations.
Suggested by Ludovic Courtès.
* doc/emacs.texi (Emacs List buffer): Document new key bindings.
* emacs/guix-base.el (guix-generation-packages-buffer-name-function,
guix-generation-packages-update-buffer, guix-output-name-width): New
variables.
(guix-generation-file, guix-manifest-file, guix-generation-packages,
guix-generation-packages-buffer-name-default,
guix-generation-packages-buffer-name-long,
guix-generation-packages-buffer-name, guix-generation-packages-buffer,
guix-generation-insert-package, guix-generation-insert-packages,
guix-profile-generation-manifest-file,
guix-profile-generation-packages-buffer): New procedures.
* emacs/guix-list.el: Add key bindings for comparing generations.
(guix-generation-list-generations-to-compare,
guix-generation-list-show-added-packages,
guix-generation-list-show-removed-packages, guix-generation-list-compare,
guix-generation-list-ediff-manifests, guix-generation-list-diff-manifests,
guix-generation-list-ediff-packages, guix-generation-list-diff-packages,
guix-generation-list-ediff, guix-generation-list-diff): New procedures.
* emacs/guix-messages.el (guix-messages): Add 'generation-diff' search type.
(guix-message-outputs-by-diff): New procedure.
* emacs/guix-utils.el (guix-diff-switches): New variable.
(guix-diff): New procedure.
* emacs/guix-main.scm (package/output-sexps): Handle 'generation-diff' search
type.
(manifest-entry->package-specification,
manifest-entries->package-specifications, generation-package-specifications,
generation-package-specifications+paths, generation-difference): New
procedures.
2014-11-02 05:58:21 -05:00
|
|
|
@item e
|
|
|
|
Run Ediff (@pxref{Top,,, ediff, The Ediff Manual}) on package outputs
|
|
|
|
installed in the 2 marked generations. With prefix argument, run Ediff
|
|
|
|
on manifests of the marked generations.
|
|
|
|
@item D
|
|
|
|
@itemx =
|
|
|
|
Run Diff (@pxref{Diff Mode,,, emacs, The GNU Emacs Manual}) on package
|
|
|
|
outputs installed in the 2 marked generations. With prefix argument,
|
|
|
|
run Diff on manifests of the marked generations.
|
|
|
|
@item +
|
|
|
|
List package outputs added to the latest marked generation comparing
|
|
|
|
with another marked generation.
|
|
|
|
@item -
|
|
|
|
List package outputs removed from the latest marked generation comparing
|
|
|
|
with another marked generation.
|
2014-08-27 08:44:17 -04:00
|
|
|
@end table
|
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Info buffer
|
2015-08-13 13:16:29 -04:00
|
|
|
@subsection ``Info'' buffer
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
The interface of an ``info'' buffer is similar to the interface of
|
2014-11-04 02:20:41 -05:00
|
|
|
@code{help-mode} (@pxref{Help Mode,,, emacs, The GNU Emacs Manual}).
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
``Info'' buffer contains some buttons (as usual you may use @key{TAB} /
|
|
|
|
@kbd{S-@key{TAB}} to move between buttons---@pxref{Mouse References,,,
|
2014-11-04 02:20:41 -05:00
|
|
|
emacs, The GNU Emacs Manual}) which can be used to:
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@itemize @bullet
|
|
|
|
@item (in a ``package-info'' buffer)
|
|
|
|
|
|
|
|
@itemize @minus
|
|
|
|
@item install/remove a package;
|
|
|
|
@item jump to a package location;
|
|
|
|
@item browse home page of a package;
|
2016-01-19 14:16:20 -05:00
|
|
|
@item browse license URL;
|
2014-08-27 08:44:17 -04:00
|
|
|
@item describe packages from ``Inputs'' fields.
|
|
|
|
@end itemize
|
|
|
|
|
|
|
|
@item (in a ``generation-info'' buffer)
|
|
|
|
|
|
|
|
@itemize @minus
|
|
|
|
@item remove a generation;
|
2014-10-10 15:58:30 -04:00
|
|
|
@item switch to a generation;
|
2014-08-27 08:44:17 -04:00
|
|
|
@item list packages installed in a generation;
|
|
|
|
@item jump to a generation directory.
|
|
|
|
@end itemize
|
|
|
|
|
|
|
|
@end itemize
|
|
|
|
|
2014-11-08 12:13:32 -05:00
|
|
|
It is also possible to copy a button label (a link to an URL or a file)
|
|
|
|
by pressing @kbd{c} on a button.
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Configuration
|
2014-08-27 08:44:17 -04:00
|
|
|
@subsection Configuration
|
|
|
|
|
|
|
|
There are many variables you can modify to change the appearance or
|
|
|
|
behavior of Emacs user interface. Some of these variables are described
|
|
|
|
in this section. Also you can use Custom Interface (@pxref{Easy
|
2014-11-04 02:20:41 -05:00
|
|
|
Customization,,, emacs, The GNU Emacs Manual}) to explore/set variables
|
|
|
|
(not all) and faces.
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@menu
|
2014-10-17 13:22:38 -04:00
|
|
|
* Guile and Build Options: Emacs Build Options. Specifying how packages are built.
|
|
|
|
* Buffer Names: Emacs Buffer Names. Names of Guix buffers.
|
|
|
|
* Keymaps: Emacs Keymaps. Configuring key bindings.
|
|
|
|
* Appearance: Emacs Appearance. Settings for visual appearance.
|
2014-08-27 08:44:17 -04:00
|
|
|
@end menu
|
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Build Options
|
2014-08-27 08:44:17 -04:00
|
|
|
@subsubsection Guile and Build Options
|
|
|
|
|
|
|
|
@table @code
|
|
|
|
@item guix-guile-program
|
|
|
|
If you have some special needs for starting a Guile process, you may set
|
|
|
|
this variable, for example:
|
|
|
|
|
|
|
|
@example
|
|
|
|
(setq guix-guile-program '("/bin/guile" "--no-auto-compile"))
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@item guix-use-substitutes
|
|
|
|
Has the same meaning as @code{--no-substitutes} option (@pxref{Invoking
|
|
|
|
guix build}).
|
|
|
|
|
|
|
|
@item guix-dry-run
|
|
|
|
Has the same meaning as @code{--dry-run} option (@pxref{Invoking guix
|
|
|
|
build}).
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Buffer Names
|
2014-09-19 01:57:36 -04:00
|
|
|
@subsubsection Buffer Names
|
|
|
|
|
|
|
|
Default names of ``guix.el'' buffers (``*Guix@tie{}@dots{}*'') may be
|
|
|
|
changed with the following variables:
|
|
|
|
|
|
|
|
@table @code
|
|
|
|
@item guix-package-list-buffer-name
|
|
|
|
@item guix-output-list-buffer-name
|
|
|
|
@item guix-generation-list-buffer-name
|
|
|
|
@item guix-package-info-buffer-name
|
|
|
|
@item guix-output-info-buffer-name
|
|
|
|
@item guix-generation-info-buffer-name
|
|
|
|
@item guix-repl-buffer-name
|
|
|
|
@item guix-internal-repl-buffer-name
|
|
|
|
@end table
|
|
|
|
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
By default, the name of a profile is also displayed in a ``list'' or
|
|
|
|
``info'' buffer name. To change this behavior, use
|
emacs: Generalize buffer naming.
* emacs/guix-base.el (guix-buffer-name): New procedure.
(guix-buffer-define-interface): Make ':buffer-name' a required keyword.
(guix-update-after-operation, guix-buffer-name-function)
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name)
(guix-buffer-p, guix-buffers, guix-update-buffer)
(guix-update-buffers-maybe-after-operation): Adjust, move and rename to...
* emacs/guix-ui.el (guix-ui-update-after-operation)
(guix-ui-buffer-name-function, guix-ui-buffer-name-simple)
(guix-ui-buffer-name-default, guix-ui-buffer-name)
(guix-ui-buffer?, guix-ui-buffers, guix-ui-update-buffer)
(guix-ui-update-buffers-after-operation): ... this.
(guix-ui-define-interface): Generate
'guix-ENTRY-TYPE-BUFFER-TYPE-buffer-name' procedure and pass it as
':buffer-name' argument.
(guix-ui): New custom group.
* emacs/guix-info.el: Specify ':buffer-name' for the defined interfaces.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2015-11-23 08:41:58 -05:00
|
|
|
@code{guix-ui-buffer-name-function} variable.
|
emacs: Improve interface for working with multiple profiles.
Suggested by David Thompson, Ludovic Courtès and Mathieu Lirzin.
* emacs/guix-base.el (guix-profile-prompt): New procedure.
(guix-set-current-profile): Use it.
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name): New
procedures.
(guix-buffer-name-function, guix-profile): New variables.
(guix-set-vars, guix-get-entries, guix-get-show-entries, guix-set-buffer,
guix-history-call, guix-process-package-actions,
guix-continue-package-operation-p, guix-delete-generations,
guix-switch-to-generation): Add 'profile' argument.
* emacs/guix.el (guix-get-show-packages, guix-get-show-generations,
guix-search-by-name, guix-search-by-regexp, guix-installed-packages,
guix-obsolete-packages, guix-all-available-packages,
guix-newest-available-packages, guix-generations, guix-generations-by-time):
Likewise.
(guix-last-generations): New command.
* emacs/guix-info.el: Adjust for using 'profile' argument where needed.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Commands): Document 'guix-last-generations' and using
"C-u" for commands.
(Emacs Buffer Names): Document 'guix-buffer-name-function'.
2014-10-17 14:21:32 -04:00
|
|
|
|
|
|
|
For example, if you want to display all types of results in a single
|
2014-09-19 01:57:36 -04:00
|
|
|
buffer (in such case you will probably use a history (@kbd{l}/@kbd{r})
|
|
|
|
extensively), you may do it like this:
|
|
|
|
|
|
|
|
@example
|
|
|
|
(let ((name "Guix Universal"))
|
|
|
|
(setq
|
|
|
|
guix-package-list-buffer-name name
|
|
|
|
guix-output-list-buffer-name name
|
|
|
|
guix-generation-list-buffer-name name
|
|
|
|
guix-package-info-buffer-name name
|
|
|
|
guix-output-info-buffer-name name
|
emacs: Generalize buffer naming.
* emacs/guix-base.el (guix-buffer-name): New procedure.
(guix-buffer-define-interface): Make ':buffer-name' a required keyword.
(guix-update-after-operation, guix-buffer-name-function)
(guix-buffer-name-simple, guix-buffer-name-default, guix-buffer-name)
(guix-buffer-p, guix-buffers, guix-update-buffer)
(guix-update-buffers-maybe-after-operation): Adjust, move and rename to...
* emacs/guix-ui.el (guix-ui-update-after-operation)
(guix-ui-buffer-name-function, guix-ui-buffer-name-simple)
(guix-ui-buffer-name-default, guix-ui-buffer-name)
(guix-ui-buffer?, guix-ui-buffers, guix-ui-update-buffer)
(guix-ui-update-buffers-after-operation): ... this.
(guix-ui-define-interface): Generate
'guix-ENTRY-TYPE-BUFFER-TYPE-buffer-name' procedure and pass it as
':buffer-name' argument.
(guix-ui): New custom group.
* emacs/guix-info.el: Specify ':buffer-name' for the defined interfaces.
* emacs/guix-list.el: Likewise.
* doc/emacs.texi (Emacs Appearance): Adjust accordingly.
2015-11-23 08:41:58 -05:00
|
|
|
guix-generation-info-buffer-name name))
|
2014-09-19 01:57:36 -04:00
|
|
|
@end example
|
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Keymaps
|
2014-08-27 08:44:17 -04:00
|
|
|
@subsubsection Keymaps
|
|
|
|
|
|
|
|
If you want to change default key bindings, use the following keymaps
|
2014-11-04 02:20:41 -05:00
|
|
|
(@pxref{Init Rebinding,,, emacs, The GNU Emacs Manual}):
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@table @code
|
2015-11-21 04:25:19 -05:00
|
|
|
@item guix-buffer-map
|
|
|
|
Parent keymap with general keys for any buffer type.
|
|
|
|
|
|
|
|
@item guix-ui-map
|
|
|
|
Parent keymap with general keys for buffers used for Guix package
|
|
|
|
management (for packages, outputs and generations).
|
2015-06-24 03:36:18 -04:00
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@item guix-list-mode-map
|
|
|
|
Parent keymap with general keys for ``list'' buffers.
|
|
|
|
|
|
|
|
@item guix-package-list-mode-map
|
|
|
|
Keymap with specific keys for ``package-list'' buffers.
|
|
|
|
|
2014-09-19 01:57:36 -04:00
|
|
|
@item guix-output-list-mode-map
|
|
|
|
Keymap with specific keys for ``output-list'' buffers.
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@item guix-generation-list-mode-map
|
|
|
|
Keymap with specific keys for ``generation-list'' buffers.
|
|
|
|
|
|
|
|
@item guix-info-mode-map
|
|
|
|
Parent keymap with general keys for ``info'' buffers.
|
|
|
|
|
|
|
|
@item guix-package-info-mode-map
|
|
|
|
Keymap with specific keys for ``package-info'' buffers.
|
|
|
|
|
2014-09-19 01:57:36 -04:00
|
|
|
@item guix-output-info-mode-map
|
|
|
|
Keymap with specific keys for ``output-info'' buffers.
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@item guix-generation-info-mode-map
|
|
|
|
Keymap with specific keys for ``generation-info'' buffers.
|
|
|
|
|
2014-11-08 12:13:32 -05:00
|
|
|
@item guix-info-button-map
|
|
|
|
Keymap with keys available when a point is placed on a button.
|
|
|
|
|
2014-08-27 08:44:17 -04:00
|
|
|
@end table
|
|
|
|
|
2014-10-17 13:22:38 -04:00
|
|
|
@node Emacs Appearance
|
2014-08-27 08:44:17 -04:00
|
|
|
@subsubsection Appearance
|
|
|
|
|
|
|
|
You can change almost any aspect of ``list'' / ``info'' buffers using
|
2015-11-19 08:56:19 -05:00
|
|
|
the following variables (@dfn{ENTRY-TYPE} means @code{package},
|
|
|
|
@code{output} or @code{generation}):
|
2014-08-27 08:44:17 -04:00
|
|
|
|
|
|
|
@table @code
|
2015-11-19 08:56:19 -05:00
|
|
|
@item guix-ENTRY-TYPE-list-format
|
2015-11-21 03:35:43 -05:00
|
|
|
@itemx guix-ENTRY-TYPE-list-titles
|
2014-08-27 08:44:17 -04:00
|
|
|
Specify the columns, their names, what and how is displayed in ``list''
|
|
|
|
buffers.
|
|
|
|
|
2015-11-20 13:25:10 -05:00
|
|
|
@item guix-ENTRY-TYPE-info-format
|
2015-11-21 03:35:43 -05:00
|
|
|
@itemx guix-ENTRY-TYPE-info-titles
|
2015-11-19 16:13:19 -05:00
|
|
|
@itemx guix-info-ignore-empty-values
|
2014-08-27 08:44:17 -04:00
|
|
|
@itemx guix-info-param-title-format
|
|
|
|
@itemx guix-info-multiline-prefix
|
|
|
|
@itemx guix-info-indent
|
2015-11-19 16:13:19 -05:00
|
|
|
@itemx guix-info-fill
|
2014-08-27 08:44:17 -04:00
|
|
|
@itemx guix-info-delimiter
|
|
|
|
Various settings for ``info'' buffers.
|
|
|
|
|
|
|
|
@end table
|
2014-11-04 11:38:27 -05:00
|
|
|
|
|
|
|
|
2016-01-21 14:07:10 -05:00
|
|
|
@node Emacs Licenses
|
|
|
|
@section Licenses
|
|
|
|
|
|
|
|
If you want to browse the URL of a particular license, or to look at a
|
|
|
|
list of licenses, you may use the following commands:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
|
|
|
|
@item M-x guix-browse-license-url
|
|
|
|
Choose a license from a completion list to browse its URL using
|
|
|
|
@code{browse-url} function (@pxref{Browse-URL,,, emacs, The GNU Emacs
|
|
|
|
Manual}).
|
|
|
|
|
|
|
|
@item M-x guix-licenses
|
|
|
|
Display a list of available licenses. You can press @kbd{@key{RET}}
|
|
|
|
there to display packages with this license in the same way as @kbd{M-x
|
|
|
|
guix-packages-by-license} would do (@pxref{Emacs Commands}).
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
|
2015-08-14 03:47:10 -04:00
|
|
|
@node Emacs Popup Interface
|
|
|
|
@section Popup Interface
|
|
|
|
|
|
|
|
If you ever used Magit, you know what ``popup interface'' is
|
|
|
|
(@pxref{Top,,, magit-popup, Magit-Popup User Manual}). Even if you are
|
|
|
|
not acquainted with Magit, there should be no worries as it is very
|
|
|
|
intuitive.
|
|
|
|
|
|
|
|
So @kbd{M-x@tie{}guix} command provides a top-level popup interface for
|
|
|
|
all available guix commands. When you select an option, you'll be
|
|
|
|
prompted for a value in the minibuffer. Many values have completions,
|
|
|
|
so don't hesitate to press @key{TAB} key. Multiple values (for example,
|
|
|
|
packages or lint checkers) should be separated by commas.
|
|
|
|
|
|
|
|
After specifying all options and switches for a command, you may choose
|
|
|
|
one of the available actions. The following default actions are
|
|
|
|
available for all commands:
|
|
|
|
|
|
|
|
@itemize
|
|
|
|
|
|
|
|
@item
|
|
|
|
Run the command in the Guix REPL. It is faster than running
|
|
|
|
@code{guix@tie{}@dots{}} command directly in shell, as there is no
|
|
|
|
need to run another guile process and to load required modules there.
|
|
|
|
|
|
|
|
@item
|
|
|
|
Run the command in a shell buffer. You can set
|
|
|
|
@code{guix-run-in-shell-function} variable to fine tune the shell buffer
|
|
|
|
you want to use.
|
|
|
|
|
|
|
|
@item
|
|
|
|
Add the command line to the kill ring (@pxref{Kill Ring,,, emacs, The
|
|
|
|
GNU Emacs Manual}).
|
|
|
|
|
|
|
|
@end itemize
|
|
|
|
|
2016-01-27 15:06:07 -05:00
|
|
|
Several commands (@command{guix graph}, @command{guix system shepherd-graph}
|
2015-10-16 10:50:36 -04:00
|
|
|
and @command{guix system extension-graph}) also have a ``View graph''
|
|
|
|
action, which allows you to view a generated graph using @command{dot}
|
|
|
|
command (specified by @code{guix-dot-program} variable). By default a
|
|
|
|
PNG file will be saved in @file{/tmp} directory and will be opened
|
|
|
|
directly in Emacs. This behavior may be changed with the following
|
|
|
|
variables:
|
|
|
|
|
|
|
|
@table @code
|
|
|
|
|
|
|
|
@item guix-find-file-function
|
|
|
|
Function used to open a generated graph. If you want to open a graph in
|
|
|
|
an external program, you can do it by modifying this variable---for
|
|
|
|
example, you can use a functionality provided by the Org Mode
|
|
|
|
(@pxref{Top,,, org, The Org Manual}):
|
|
|
|
|
|
|
|
@example
|
|
|
|
(setq guix-find-file-function 'org-open-file)
|
|
|
|
(add-to-list 'org-file-apps '("\\.png\\'" . "sxiv %s"))
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@item guix-dot-default-arguments
|
|
|
|
Command line arguments to run @command{dot} command. If you change an
|
|
|
|
output format (for example, into @code{-Tpdf}), you also need to change
|
|
|
|
the next variable.
|
|
|
|
|
|
|
|
@item guix-dot-file-name-function
|
|
|
|
Function used to define a name of the generated graph file. Default
|
|
|
|
name is @file{/tmp/guix-emacs-graph-XXXXXX.png}.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
So, for example, if you want to generate and open a PDF file in your
|
|
|
|
Emacs, you may change the settings like this:
|
|
|
|
|
|
|
|
@example
|
|
|
|
(defun my-guix-pdf-graph ()
|
|
|
|
"/tmp/my-current-guix-graph.pdf")
|
|
|
|
|
|
|
|
(setq guix-dot-default-arguments '("-Tpdf")
|
|
|
|
guix-dot-file-name-function 'my-guix-pdf-graph)
|
|
|
|
@end example
|
|
|
|
|
2015-08-14 03:47:10 -04:00
|
|
|
|
2014-11-04 11:38:27 -05:00
|
|
|
@node Emacs Prettify
|
2015-08-13 13:16:29 -04:00
|
|
|
@section Guix Prettify Mode
|
2014-11-04 11:38:27 -05:00
|
|
|
|
2015-08-13 13:16:29 -04:00
|
|
|
GNU@tie{}Guix also comes with ``guix-prettify.el''. It provides a minor
|
|
|
|
mode for abbreviating store file names by replacing hash sequences of
|
|
|
|
symbols with ``@dots{}'':
|
2014-11-04 11:38:27 -05:00
|
|
|
|
|
|
|
@example
|
|
|
|
/gnu/store/72f54nfp6g1hz873w8z3gfcah0h4nl9p-foo-0.1
|
|
|
|
@result{} /gnu/store/…-foo-0.1
|
|
|
|
@end example
|
|
|
|
|
|
|
|
Once you set up ``guix.el'' (@pxref{Emacs Initial Setup}), the following
|
|
|
|
commands become available:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
|
|
|
|
@item M-x guix-prettify-mode
|
|
|
|
Enable/disable prettifying for the current buffer.
|
|
|
|
|
|
|
|
@item M-x global-guix-prettify-mode
|
|
|
|
Enable/disable prettifying globally.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
To automatically enable @code{guix-prettify-mode} globally on Emacs
|
|
|
|
start, add the following line to your init file:
|
|
|
|
|
|
|
|
@example
|
|
|
|
(global-guix-prettify-mode)
|
|
|
|
@end example
|
|
|
|
|
|
|
|
If you want to enable it only for specific major modes, add it to the
|
|
|
|
mode hooks (@pxref{Hooks,,, emacs, The GNU Emacs Manual}), for example:
|
|
|
|
|
|
|
|
@example
|
|
|
|
(add-hook 'shell-mode-hook 'guix-prettify-mode)
|
|
|
|
(add-hook 'dired-mode-hook 'guix-prettify-mode)
|
|
|
|
@end example
|
2015-06-06 15:19:51 -04:00
|
|
|
|
|
|
|
|
2015-09-12 15:16:42 -04:00
|
|
|
@node Emacs Build Log
|
|
|
|
@section Build Log Mode
|
|
|
|
|
|
|
|
GNU@tie{}Guix provides major and minor modes for highlighting build
|
|
|
|
logs. So when you have a file with a package build output---for
|
|
|
|
example, a file returned by @command{guix build --log-file @dots{}}
|
|
|
|
command (@pxref{Invoking guix build}), you may call @kbd{M-x
|
|
|
|
guix-build-log-mode} command in the buffer with this file. This major
|
|
|
|
mode highlights some lines specific to build output and provides the
|
|
|
|
following key bindings:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
|
|
|
|
@item M-n
|
|
|
|
Move to the next build phase.
|
|
|
|
|
|
|
|
@item M-p
|
|
|
|
Move to the previous build phase.
|
|
|
|
|
2015-09-15 14:27:44 -04:00
|
|
|
@item @key{TAB}
|
|
|
|
Toggle (show/hide) the body of the current build phase.
|
|
|
|
|
|
|
|
@item S-@key{TAB}
|
|
|
|
Toggle (show/hide) the bodies of all build phases.
|
|
|
|
|
2015-09-12 15:16:42 -04:00
|
|
|
@end table
|
|
|
|
|
|
|
|
There is also @kbd{M-x guix-build-log-minor-mode} which also provides
|
2015-10-31 15:01:45 -04:00
|
|
|
the same highlighting and the same key bindings as the major mode, but
|
|
|
|
prefixed with @kbd{C-c}. By default, this minor mode is enabled in
|
|
|
|
shell buffers (@pxref{Interactive Shell,,, emacs, The GNU Emacs
|
|
|
|
Manual}). If you don't like it, set
|
|
|
|
@code{guix-build-log-minor-mode-activate} to nil.
|
2015-09-12 15:16:42 -04:00
|
|
|
|
|
|
|
|
2015-06-06 15:19:51 -04:00
|
|
|
@node Emacs Completions
|
2015-08-13 13:16:29 -04:00
|
|
|
@section Shell Completions
|
2015-06-06 15:19:51 -04:00
|
|
|
|
|
|
|
Another feature that becomes available after configuring Emacs interface
|
|
|
|
(@pxref{Emacs Initial Setup}) is completing of @command{guix}
|
|
|
|
subcommands, options, packages and other things in @code{shell}
|
|
|
|
(@pxref{Interactive Shell,,, emacs, The GNU Emacs Manual}) and
|
|
|
|
@code{eshell} (@pxref{Top,,, eshell, Eshell: The Emacs Shell}).
|
|
|
|
|
|
|
|
It works the same way as other completions do. Just press @key{TAB}
|
|
|
|
when your intuition tells you.
|
|
|
|
|
|
|
|
And here are some examples, where pressing @key{TAB} may complete
|
|
|
|
something:
|
|
|
|
|
|
|
|
@itemize @w{}
|
|
|
|
|
|
|
|
@item @code{guix pa}@key{TAB}
|
|
|
|
@item @code{guix package -}@key{TAB}
|
|
|
|
@item @code{guix package --}@key{TAB}
|
|
|
|
@item @code{guix package -i gei}@key{TAB}
|
|
|
|
@item @code{guix build -L/tm}@key{TAB}
|
|
|
|
@item @code{guix build --sy}@key{TAB}
|
|
|
|
@item @code{guix build --system=i}@key{TAB}
|
|
|
|
@item @code{guix system rec}@key{TAB}
|
|
|
|
@item @code{guix lint --checkers=sy}@key{TAB}
|
|
|
|
@item @code{guix lint --checkers=synopsis,des}@key{TAB}
|
|
|
|
|
|
|
|
@end itemize
|
2015-07-24 11:33:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
@node Emacs Development
|
|
|
|
@section Development
|
|
|
|
|
|
|
|
By default, when you open a Scheme file, @code{guix-devel-mode} will be
|
|
|
|
activated (if you don't want it, set @code{guix-devel-activate-mode} to
|
|
|
|
nil). This minor mode provides the following key bindings:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
|
|
|
|
@item C-c . k
|
|
|
|
Copy the name of the current Guile module into kill ring
|
|
|
|
(@code{guix-devel-copy-module-as-kill}).
|
|
|
|
|
|
|
|
@item C-c . u
|
|
|
|
Use the current Guile module. Often after opening a Scheme file, you
|
|
|
|
want to use a module it defines, so you switch to the Geiser REPL and
|
|
|
|
write @code{,use (some module)} there. You may just use this command
|
|
|
|
instead (@code{guix-devel-use-module}).
|
|
|
|
|
2015-07-24 13:31:11 -04:00
|
|
|
@item C-c . b
|
|
|
|
Build a package defined by the current variable definition. The
|
|
|
|
building process is run in the current Geiser REPL. If you modified the
|
|
|
|
current package definition, don't forget to reevaluate it before calling
|
|
|
|
this command---for example, with @kbd{C-M-x} (@pxref{To eval or not to
|
|
|
|
eval,,, geiser, Geiser User Manual})
|
|
|
|
(@code{guix-devel-build-package-definition}).
|
|
|
|
|
2015-10-09 09:45:24 -04:00
|
|
|
@item C-c . s
|
|
|
|
Build a source derivation of the package defined by the current variable
|
|
|
|
definition. This command has the same meaning as @code{guix build -S}
|
|
|
|
shell command (@pxref{Invoking guix build})
|
|
|
|
(@code{guix-devel-build-package-source}).
|
|
|
|
|
2015-10-01 14:16:18 -04:00
|
|
|
@item C-c . l
|
|
|
|
Lint (check) a package defined by the current variable definition
|
|
|
|
(@pxref{Invoking guix lint}) (@code{guix-devel-lint-package}).
|
|
|
|
|
2015-07-24 11:33:14 -04:00
|
|
|
@end table
|
2015-07-24 13:31:11 -04:00
|
|
|
|
|
|
|
Unluckily, there is a limitation related to long-running REPL commands.
|
|
|
|
When there is a running process in a Geiser REPL, you are not supposed
|
|
|
|
to evaluate anything in a scheme buffer, because this will ``freeze''
|
|
|
|
the REPL: it will stop producing any output (however, the evaluating
|
|
|
|
process will continue---you will just not see any progress anymore). Be
|
|
|
|
aware: even moving the point in a scheme buffer may ``break'' the REPL
|
|
|
|
if Autodoc (@pxref{Autodoc and friends,,, geiser, Geiser User Manual})
|
|
|
|
is enabled (which is the default).
|
|
|
|
|
|
|
|
So you have to postpone editing your scheme buffers until the running
|
|
|
|
evaluation will be finished in the REPL.
|
|
|
|
|
|
|
|
Alternatively, to avoid this limitation, you may just run another Geiser
|
|
|
|
REPL, and while something is being evaluated in the previous REPL, you
|
|
|
|
can continue editing a scheme file with the help of the current one.
|
2015-12-11 06:01:35 -05:00
|
|
|
|
|
|
|
|
|
|
|
@node Emacs Hydra
|
|
|
|
@section Hydra
|
|
|
|
|
|
|
|
The continuous integration server at @code{hydra.gnu.org} builds all
|
|
|
|
the distribution packages on the supported architectures and serves
|
|
|
|
them as substitutes (@pxref{Substitutes}). Continuous integration is
|
|
|
|
currently orchestrated by @uref{https://nixos.org/hydra/, Hydra}.
|
|
|
|
|
|
|
|
This section describes an Emacs interface to query Hydra to know the
|
|
|
|
build status of specific packages, discover recent and ongoing builds,
|
|
|
|
view build logs, and so on. This interface is mostly the same as the
|
|
|
|
``list''/``info'' interface for displaying packages and generations
|
|
|
|
(@pxref{Emacs Package Management}).
|
|
|
|
|
|
|
|
The following commands are available:
|
|
|
|
|
|
|
|
@table @kbd
|
|
|
|
|
|
|
|
@item M-x guix-hydra-latest-builds
|
|
|
|
Display latest failed or successful builds (you will be prompted for a
|
|
|
|
number of builds). With @kbd{C-u}, you will also be prompted for other
|
|
|
|
parameters (project, jobset, job and system).
|
|
|
|
|
|
|
|
@item M-x guix-hydra-queued-builds
|
|
|
|
Display scheduled or currently running builds (you will be prompted for
|
|
|
|
a number of builds).
|
|
|
|
|
|
|
|
@item M-x guix-hydra-jobsets
|
|
|
|
Display available jobsets (you will be prompted for a project).
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
In a list of builds you can press @kbd{L} key to display a build log of
|
|
|
|
the current build. Also both a list of builds and a list of jobsets
|
|
|
|
provide @kbd{B} key to display latest builds of the current job or
|
|
|
|
jobset (don't forget about @kbd{C-u}).
|