Next: Introduction [Contents][Index]
This document describes Emacs-Guix, the Emacs interface for the GNU Guix package manager.
Copyright © 2014-2019, 2021 Alex Kost
Copyright © 2018 Oleg PykhalovPermission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/licenses/fdl.html.
• Introduction | Quick overview. | |
• Installation | Installing Emacs-Guix. | |
• Packages | Interface for packages. | |
• Profiles and Generations | Interface for profiles and their generations. | |
• System | Interface for operating-system and services.
| |
• Store Items | Interface for store items. | |
• Package Licenses | Interface for licenses of packages. | |
• Popup Interface | Magit-like interface for Emacs-Guix commands. | |
• Prettify Mode | Abbreviating /gnu/store/… file names. | |
• Prettify Variables | Split and indent Shell variables. | |
• Build Log Mode | Highlighting Guix build logs. | |
• Completions | Completing guix shell command.
| |
• Development | Highlighting and tools for Guix code. | |
• List/Info Interface | Describing “list”/”info” buffers. | |
• Configuration | Configuring Emacs-Guix. | |
• Miscellaneous Commands | M-x guix-… uncovered by other sections. | |
• Help | Help commands. | |
Indexes | ||
---|---|---|
• Concept Index | Concepts. | |
• Command Index | Commands and functions. | |
• Variable Index | Variables. |
Next: Installation, Previous: Top, Up: Top [Contents][Index]
Emacs-Guix (also known as “guix.el”) provides various interfaces and tools related to the GNU Guix package manager.
Call M-x guix if you prefer to dive in right away (see Popup Interface).
In short, Emacs-Guix provides the following features:
operating-system
declaration (see System From File)
scheme-mode
to
work with Guix Scheme files (see Development).
Next: Packages, Previous: Introduction, Up: Top [Contents][Index]
There are several ways1 to install Emacs-Guix:
$ guix package -i emacs-guix
For the first 2 options, you are all set, so you can skip this chapter. If you want to use Emacs-Guix from a git checkout, read further.
• Requirements | Required and optional dependencies. | |
• Using from Git | Using without installation. |
Next: Using from Git, Up: Installation [Contents][Index]
Emacs-Guix depends on the following packages:
guix-devel-mode
(see Development).
To sum up, most likely, you’ll need all the above dependencies except
maybe magit-popup
, edit-indirect
and build-farm
.
Previous: Requirements, Up: Installation [Contents][Index]
You can use Emacs-Guix directly from a git checkout without any installation.
At first, you need to clone the repository and to run
autogen.sh
script (it’s just a wrapper for autoreconf
command). If you don’t have all dependencies installed, you may use
guix.scm file to make an environment to build Emacs-Guix
(see Invoking guix environment in The GNU Guix Reference
Manual):
$ git clone https://notabug.org/alezost/emacs-guix.git $ cd guix.el $ guix environment --pure --load=guix.scm $ ./autogen.sh
Now configure and make it (this will compile all Emacs-Lisp and Scheme files, and will generate guix-autoloads.el file):
$ ./configure $ make
Now all you need, is to add elisp directory to the Emacs
load-path
and to load the generated autoloads. This can be
done by adding the following code into your Emacs init file
(see Init File in The GNU Emacs Manual):
(add-to-list 'load-path "/path/to/emacs-guix/elisp") (require 'guix-autoloads nil t)
Now, if you start Emacs, all M-x guix-… commands should become available.
• Using the Manual from Git |
Up: Using from Git [Contents][Index]
After “make”-ing, the info manual is ready to use. You can run it, for example, with C-u C-h i command (the file is doc/emacs-guix.info). However it is not convenient. You may want to have this manual in the top info directory along with the other manuals. To make it possible, you need to do the following 2 steps:
export INFOPATH="/path/to/emacs-guix/doc${INFOPATH:+:}$INFOPATH"
Alternatively, you can adjust Info path inside Emacs, like this:
(with-eval-after-load 'info (info-initialize) (add-to-list 'Info-directory-list "/path/to/emacs-guix/doc"))
make doc/dir
Once the above 2 steps are done, C-h i should display the Emacs-Guix entry. Also you can use M-x guix-info command to run the manual (see Help).
Next: Profiles and Generations, Previous: Installation, Up: Top [Contents][Index]
Emacs-Guix provides a visual interface for packages where you can
perform routine package management tasks, pretty much like the
guix package
command (see Invoking guix package in The GNU Guix Reference Manual).
• Package Commands | M-x guix-… to show packages. | |
• Package Keys | Key bindings in package “list” and “info” buffers. | |
• Package Locations | Interface for locations of packages. | |
• Lint Checkers | Interface for package lint checkers. | |
• More Package Commands | Other M-x guix-… related to packages. |
Next: Package Keys, Up: Packages [Contents][Index]
There are multiple commands to display a list of Guix packages. You can either perform some actions in such “package-list” buffer, or “describe” package(s) in “package-info” buffer using RET.
The following commands use the current profile, which can be changed globally with M-x guix-set-current-profile (see Profile Commands). Alternatively, if you call any of the following commands with a prefix argument (C-u), you will be prompted for a profile just for that command.
Display all available packages.
Display installed packages. As explained above, M-x guix-installed-packages uses an arbitrary profile that you can specify, while the other commands display packages installed in 2 special profiles: ~/.guix-profile and /run/current-system/profile (only on Guix System).
Display obsolete or unknown packages (the packages that are installed in a profile but cannot be found among the available packages).
Display packages that are superseded by the other packages.
Display packages that are hidden from user interfaces (usually because they are for internal use only).
Display packages that depend on the specified package(s). This
command is analogous to guix refresh --list-dependent
shell
command (see Invoking guix refresh in The GNU Guix Reference
Manual). You’ll be prompted for a package name (or multiple names,
separated by commas) and a dependency type (it should be either
“all” or “direct”).
Display package(s) with the specified name.
Search for packages by a specified regexp. By default, “name”,
“synopsis” and “description” of the packages will be searched. This
can be changed by modifying guix-package-search-params
variable.
Search for packages with names matching a specified regexp. This
command is the same as guix-packages-by-regexp
, except only a
package “name” is searched.
Display package(s) with the specified license.
Display package(s) located in the specified file. These files usually have the following form: gnu/packages/emacs.scm, but don’t type them manually! Press TAB to complete the file name.
Display package that the code within the specified file evaluates to.
See --install-from-file
in The
GNU Guix Reference Manual, for an example of what such a file may
look like.
Display packages from the specified file with operating-system
declaration (see Using the Configuration System in The GNU
Guix Reference Manual).
By default, these commands display each package 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:
(setq guix-package-list-type 'package)
Next: Package Locations, Previous: Package Commands, Up: Packages [Contents][Index]
Along with the general “list” keys (see List buffer), a “package-list” buffer additionally provides the following key bindings:
Mark the current package for installation.
Mark the current package for deletion.
Mark the current package for upgrading.
Mark all obsolete packages for upgrading (with prefix, mark all installed packages for upgrading).
Execute actions on the marked packages.
Edit the definition of the current package (go to its location). This
is similar to guix edit
command (see Invoking guix
edit in The GNU Guix Reference Manual), but for opening a
package recipe in the current Emacs instance.
Show graph for the current package (see Graph Configuration).
Show package size (see Invoking guix size in The GNU Guix Reference Manual).
Lint the current package (see Invoking guix lint in The GNU Guix Reference Manual). With prefix argument, you’ll be prompted for checker names.
Display latest builds (from the Guix build farm) of the current package.
Similarly, “package-info” buffer provides the following key bindings:
Install the current package.
Delete the current package.
Upgrade the current package.
Go to the package definition.
Show package graph.
Show package size.
Lint the package.
Next: Lint Checkers, Previous: Package Keys, Up: Packages [Contents][Index]
As you know, package definitions are placed in Guile files. The following commands should help you not get lost in these package locations:
Display a list of files with package definitions. You can press P or RET there to display packages placed in the current file in the same way as M-x guix-packages-by-location would do (see Package Commands). Note that when the point is on a location button, RET will open this location file.
Open a file with package definitions (press TAB to choose a file from the completion list).
Find location of a specified package. This is an Emacs analog of
guix edit
command (see Invoking guix edit in The
GNU Guix Reference Manual). As with
M-x guix-packages-by-name, you can press TAB to
complete a package name.
By default, when you should specify a package name (for example, after M-x guix-edit), you will be prompted for it in the minibuffer, but you can configure Emacs-Guix to use a package name at the current point position (unless C-u is used):
(setq guix-read-package-name-function 'guix-read-package-name-at-point)
Next: More Package Commands, Previous: Package Locations, Up: Packages [Contents][Index]
The following commands provides functionality similar to guix
lint
shell command (see Invoking guix lint in The GNU Guix
Reference Manual).
Display a list of available lint checkers. You can press L there to lint the packages you will be prompted for with the marked checkers.
Lint packages. You will be prompted for comma separated package names. With prefix argument, you will also be prompted for checker names.
Previous: Lint Checkers, Up: Packages [Contents][Index]
And some more commands related to packages:
This command just displays a message (in the minibuffer) with the
number of available packages. Along with the default Guix packages,
this number includes the packages from GUIX_PACKAGE_PATH
environment variable (see Package Modules in The GNU Guix
Reference Manual).
Show a package graph. You’ll be prompted for a package name, graph backend and graph node type (everything can be completed with TAB key). See Graph Configuration, if you want to set an external graph viewer.
Show a package size (see Invoking guix size in The GNU Guix Reference Manual). You’ll be prompted for a package name and a size type (it should be either “text” or “image”).
As you know, packages are installed in profiles. The default
user profile is ~/.guix-profile (actually it is a symlink to
the real profile) but you can also install packages to non-standard
profiles (using guix package --profile=…
).
Profiles have generations. They appear whenever you perform any profile action (installing/removing packages). These generations are just symlinks to the previous versions of profile, so you can easily roll-back to any previous generation.
As you may guess, Emacs-Guix provides an interface for profiles and their generations, where you can look at the packages from the old generations, switch to any generation, delete generations, etc.
• Profiles | Interface for profiles. | |
• Generations | Interface for generations. |
Next: Generations, Up: Profiles and Generations [Contents][Index]
If you manage multiple Guix profiles, this section is for you. M-x guix-profiles is the entry point to display profiles. There you can look at the profile generations, installed packages and more. Read further for details.
• Profile Commands | M-x guix-profiles and friends. | |
• Profile Keys | Key bindings in profile “list” buffer. |
Next: Profile Keys, Up: Profiles [Contents][Index]
Show a list of available Guix profiles. By default, it displays:
the default user profile
profile, populated by guix pull
system profile (only on Guix System)
GUIX_PROFILE
(only if this environment variable is set and this profile is not the same as one of the above)
and other profiles shown by guix package --list-profiles
shell
command. If it is not enough for you, you can add even more profiles
to this list by setting guix-profiles
variable, for example,
like this:
(with-eval-after-load 'guix-ui-profile (setq guix-profiles (append '("/path/to/my-profile1" "/path/to/my-profile2") (guix-all-profiles))))
The “profile-list” buffer provides some keys to work with profiles (see Profile Keys), but also there are the following standalone profile commands that can be called outside this buffer.
Set the current profile (guix-current-profile
variable) to the
specified one. The current profile is used by the package commands
(see Package Commands) to check what package is installed in this
profile, and by generation commands (see Generation Commands).
Apply a manifest file to the current profile or a specified profile,
if the prefix argument is used. This has the same meaning as
--manifest
option (see Invoking guix package in The
GNU Guix Reference Manual).
Previous: Profile Commands, Up: Profiles [Contents][Index]
Along with the general “list” keys (see List buffer), a “profile-list” buffer (displayed by M-x guix-profiles) additionally provides the following bindings:
Display packages installed in profile at point.
Display generations of profile at point.
Display “search paths” environment variables for the marked
profiles, or the current profile if nothing is marked. This command
is analogous to guix package --search-paths
shell command
(see Invoking guix package in The GNU Guix Reference
Manual).
Make profile at point the current profile for the package commands (see Packages).
Apply manifest from a specified file to the profile at point.
Previous: Profiles, Up: Profiles and Generations [Contents][Index]
Each Guix profile may have multiple generations and Emacs-Guix allows you to display these generations, to switch to a particular generation, to look at the packages installed in it and to compare 2 generations.
• Generation Commands | M-x guix-… to show profile generations. | |
• Generation Keys | Key bindings in generation “list” buffer. |
Next: Generation Keys, Up: Generations [Contents][Index]
As with commands for displaying packages (see Package Commands), commands for displaying generations also use the current profile and can be called with a prefix argument.
List all the generations.
List the N last generations. You will be prompted for the number of generations.
List generations matching time period. You will be prompted for the period using Org mode time prompt based on Emacs calendar (see The date/time prompt in The Org Manual).
If you use Guix System, you may also look at the system generations using the similar commands (see System Commands).
Previous: Generation Commands, Up: Generations [Contents][Index]
Along with the general “list” keys (see List buffer), a “generation-list” buffer additionally provides the following bindings:
Display packages installed in the current generation.
Display “search paths” environment variables for the marked generations. This command is similar to the one for a list of profiles (see Profiles).
Switch profile to the current generation.
Mark the current generation for deletion (with prefix, mark all generations).
Execute actions on the marked generations—i.e., delete generations.
Run Ediff (see The Ediff Manual) on package outputs installed in the 2 marked generations. With prefix argument, run Ediff on manifests of the marked generations.
Run Diff (see Diff Mode in The GNU Emacs Manual) on package outputs installed in the 2 marked generations. With prefix argument, run Diff on manifests of the marked generations.
List package outputs added to the latest marked generation comparing with another marked generation.
List package outputs removed from the latest marked generation comparing with another marked generation.
Next: Store Items, Previous: Profiles and Generations, Up: Top [Contents][Index]
This chapter describes Emacs-Guix features related to Guix System, in particular:
• System From File | Interface for operating-system declaration.
| |
• Services | Interface for system services. | |
• System Commands | Other M-x guix-… related to system. |
Your system configuration file (for Guix System) contains
operating-system
declaration (see operating-system
Reference in The GNU Guix Reference Manual).
And Emacs-Guix provides an interface for this operating-system
,
where you can look at the packages, services, initrd modules that this
system will install and some other stuff.
Find your system configuration file and look at the system it provides.
Next: System Commands, Previous: System From File, Up: System [Contents][Index]
If you use Guix System, you may have a wish to become more familiar with the system services (see Services in The GNU Guix Reference Manual). Emacs-Guix provides several commands to display these services.
• Service Commands | M-x guix-… to show services. | |
• Service Locations | Interface for locations of services. |
Next: Service Locations, Up: Services [Contents][Index]
The interface for services is very similar to the interface for packages (see Packages). The following commands allows you to look at the Guix System services.
Display all available services.
Display services from %base-services
(see Base Services in The GNU Guix Reference Manual) or %desktop-services
(see Desktop Services in The GNU Guix Reference Manual).
You will be prompted in the minibuffer for the variable name
(completions available).
Display service(s) with the specified name.
Search for services by a specified regexp. By default, “name” and
“description” of the services will be searched. This can be changed
by modifying guix-service-search-params
variable.
Display service(s) located in the specified file.
Display services from the specified file with operating-system
declaration.
Previous: Service Commands, Up: Services [Contents][Index]
Similarly to the package locations (see Package Locations), you may look at the service locations:
Display a list of files with service locations. Press RET there to display services placed in the current location.
Open a file with service definitions (press TAB to choose the file from a completion list).
Go to the service location—i.e., open a file with the specified service and move the point to its definition.
Along with the commands for services and operating-system
,
there are commands to look at the system profile
(/var/guix/profiles/system), its generations and packages
installed in it.
Display “info” interface for the system profile.
Display generations of the system profile. These commands have the same meaning as the usual generation commands (see Generation Commands).
Display packages installed in the system profile.
Display packages/services from the specified system configuration file. You can also look at these packages/services from the “system-info” interface (see System From File).
Next: Package Licenses, Previous: System, Up: Top [Contents][Index]
Your /gnu/store is full of items, and Emacs-Guix provides
several commands that allow you to look at these items closely. Most
of these commands are analogous to guix gc
shell commands with
the according options (--referrers
, --derivers
, etc.)
(see Invoking guix gc in The GNU Guix Reference Manual).
• Store Item Commands | M-x guix-… to show store items. | |
• Store Item Keys | Key bindings in store item “list” buffer. |
Next: Store Item Keys, Up: Store Items [Contents][Index]
Display some info on the specified store file.
Display referrers of the specified store file.
Display references of the specified store file.
Display requisites of the specified store file.
Display derivers of the specified store file.
Display store items corresponding to cached build failures.
Display live store items. Note that this and the next commands may take a long time if your store is big.
Display dead store items.
Previous: Store Item Commands, Up: Store Items [Contents][Index]
Along with the general “list” keys (see List buffer), a “store-item-list” buffer additionally provides the following key bindings:
Go to the current store item.
Mark the current store item for deletion (with prefix, mark all store items).
Execute operation on the marked store items—i.e., attempt to delete
them. This is similar to guix gc --delete …
.
Show minibuffer message with total size of the marked store items.
Show derivers of the current (or marked) store item(s).
Show requisites of the current (or marked) store item(s).
Show referrers of the current (or marked) store item(s).
Show references of the current (or marked) store item(s).
Next: Popup Interface, Previous: Store Items, Up: Top [Contents][Index]
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:
Choose a license from a completion list to browse its URL using
browse-url
function (see Browse-URL in The GNU Emacs
Manual).
Display a list of available licenses. You can press P key there to display packages with this license in the same way as M-x guix-packages-by-license would do (see Package Commands).
Open …/guix/licenses.scm file.
Open …/guix/licenses.scm and move to the specified license.
Next: Prettify Mode, Previous: Package Licenses, Up: Top [Contents][Index]
If you ever used Magit, you know what “popup interface” is (see Magit-Popup User Manual). Even if you are not acquainted with Magit, there should be no worries as it is very intuitive.
So, M-x guix command provides a top-level popup interface for almost all the available Emacs-Guix commands. It has 2 advantages comparing with calling M-x guix-… commands directly:
If you use M-x guix often, you may wish to bind it to some easy accessible key combination, for example, to super-g:
(global-set-key (kbd "s-g") 'guix)
• Guix Popup Interface |
Up: Popup Interface [Contents][Index]
There is one rather special sub-popup in M-x guix. It is
bind to c by default, and you can call it separately with
M-x guix-command. It is a popup interface for
guix …
shell commands. It is probably not very
useful, as it provides all the options and flags for all the shell
actions and subcommands, so it may be confusing to see them all at
once. Nevertheless, a description of this thing follows.
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 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:
guix …
command directly in shell, as there is no
need to run another guile process and to load required modules there.
guix-run-in-shell-function
variable to fine tune the shell buffer
you want to use.
Several commands (guix graph
, guix system
shepherd-graph
and guix system extension-graph
) also have a
“View graph” action, which allows you to view a generated graph
(see Graph Configuration).
Next: Prettify Variables, Previous: Popup Interface, Up: Top [Contents][Index]
Emacs-Guix also comes with “guix-prettify.el”. It provides a minor mode for abbreviating store file names by replacing hash sequences of symbols with “…”:
/gnu/store/72f54nfp6g1hz873w8z3gfcah0h4nl9p-foo-0.1 ⇒ /gnu/store/…-foo-0.1
Enable/disable prettifying for the current buffer.
Enable/disable prettifying globally.
If you wish to enable global-guix-prettify-mode
automatically
on Emacs start, you may do it by adding the following line to your
Emacs init file:
(add-hook 'after-init-hook 'global-guix-prettify-mode)
If you want to enable it only for specific major modes, add it to the mode hooks (see Hooks in The GNU Emacs Manual), for example:
(add-hook 'shell-mode-hook 'guix-prettify-mode) (add-hook 'dired-mode-hook 'guix-prettify-mode)
Next: Build Log Mode, Previous: Prettify Mode, Up: Top [Contents][Index]
Emacs-Guix provides a major mode based on sh-mode
for
prettifying environment-variables and profile files. It
will split all exported variables and separate them with a newline.
All /tmp/guix-build-*-*.drv-*/environment-variables and
/etc/profile will be prettified by default.
If you want to disable this prettifying, set
guix-env-var-enable-formatting
variable to nil.
You could also directly use guix-env-var-prettify-buffer
to
prettify the current buffer without changing its major mode and
guix-env-var-prettify-variable
to prettify a variable at
current line.
Enable/disable prettifying for the current buffer.
Prettify current buffer without switching to guix-env-var-mode
.
Prettify variable assignment at current line.
Next: Completions, Previous: Prettify Variables, Up: Top [Contents][Index]
Emacs-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 guix build --log-file …
command
(see Invoking guix build in The GNU Guix Reference Manual),
you may call 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:
Move to the next build phase.
Move to the previous build phase.
Toggle (show/hide) the body of the current build phase.
Toggle (show/hide) the bodies of all build phases.
There is also M-x guix-build-log-minor-mode which also provides the same highlighting and the same key bindings as the major mode, but prefixed with C-c. You may find this minor mode useful for shell buffers (see Interactive Shell in The GNU Emacs Manual). It can be enabled there like this:
(add-hook 'shell-mode-hook 'guix-build-log-minor-mode)
Next: Development, Previous: Build Log Mode, Up: Top [Contents][Index]
Another available feature is completing guix
subcommands,
options, packages and other things in shell
(see Interactive
Shell in The GNU Emacs Manual) and eshell
(see Eshell: The Emacs Shell) buffers.
It works the same way as other completions do. Just press TAB when your intuition tells you.
And here are some examples, where pressing TAB may complete something:
guix pa
TAB
guix package -
TAB
guix package --
TAB
guix package -i gei
TAB
guix build -L/tm
TAB
guix build --sy
TAB
guix build --system=i
TAB
guix system rec
TAB
guix lint --checkers=sy
TAB
guix lint --checkers=synopsis,des
TAB
guix graph --backend=
TAB
Next: List/Info Interface, Previous: Completions, Up: Top [Contents][Index]
If you often work with Guix package files, you may want to see some highlighting and to have some indentation rules specific for Guix keywords. There is a minor mode to help you—M-x guix-devel-mode. It can be enabled in Scheme buffers like this:
(add-hook 'scheme-mode-hook 'guix-devel-mode)
Along with highlighting and indentation, this minor mode provides the following key bindings:
Copy the name of the current Guile module into kill ring
(guix-devel-copy-module-as-kill
).
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 ,use (some module)
there. You may just use this command
instead (guix-devel-use-module
).
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 C-M-x (see To eval or not to
eval in Geiser User Manual)
(guix-devel-build-package-definition
).
Build a source derivation of the package defined by the current
variable definition. This command has the same meaning as guix
build -S
shell command (see Invoking guix build in The GNU
Guix Reference Manual) (guix-devel-build-package-source
).
Download a source of the package defined by the current variable
definition. This command is the same as running guix download
shell command on the package source (see Invoking guix download in The GNU Guix Reference Manual)
(guix-devel-download-package-source
).
Lint (check) a package defined by the current variable definition
(see Invoking guix lint in The GNU Guix Reference Manual)
(guix-devel-lint-package
).
Edit description
or synopsis
of the current package in
texinfo-mode
(guix-devel-code-block-edit
).
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 (see Autodoc and friends in 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.
To find a patch file at point with M-x ffap command, you may use:
(add-to-list 'ffap-alist '("\\.patch" . guix-devel-ffap-patch))
Next: Configuration, Previous: Development, Up: Top [Contents][Index]
As you probably already know, there are multiple commands that display various lists (of packages, licenses, etc.). This is so-called “list” interface. Also you can get the same data displayed in “info” interface. This chapter describes these interfaces.
• List/Info Keys | Common keys for both interfaces. | |
• “List” buffer | List-like interface. | |
• “Info” buffer | Help-like interface. |
Next: List buffer, Up: List/Info Interface [Contents][Index]
The following keys are available for both “list” and “info” interfaces:
Show “hint” (a message with available key bindings).
Go backward/forward by the history of the displayed results (this
history is similar to the history of the Emacs help-mode
or
Info-mode
).
Revert current buffer: update (receive it again) the currently displayed data and redisplay it.
Redisplay current buffer (without updating the data).
Describe current mode.
Also some buffers provide the following keys:
Apply manifest file to the current profile (see guix-apply-manifest
).
Go to the Guix REPL (see The REPL in Geiser User Manual).
Hint: If you need several “list” or “info” buffers, you can simply M-x clone-buffer them, and each buffer will have its own history.
Next: Info buffer, Previous: List/Info Keys, Up: List/Info Interface [Contents][Index]
An interface of a “list” buffer is similar to the interface provided by “package.el” (see Package Menu in The GNU Emacs Manual).
And here are the default key bindings (some of them may be rebound to more specific commands):
Mark the current entry (with prefix, mark all entries).
Unmark the current entry (with prefix, unmark all entries).
Unmark backward.
Display “info” interface for the marked entries (or the current entry if nothing is marked).
Sort entries by column specified by the prefix argument (counting from 0).
Previous: List buffer, Up: List/Info Interface [Contents][Index]
The interface of an “info” buffer is similar to the interface of
help-mode
(see Help Mode in The GNU Emacs Manual),
or rather Custom-mode
(see Easy Customization in The
GNU Emacs Manual), as it is full of various buttons that can be used
to open files, browse URLs, do some actions (like installing/removing
packages), etc.
As always, you may use TAB / S-TAB to move between buttons and RET to press a button, or you can just use mouse (see Mouse References in The GNU Emacs Manual).
Finally, you can copy any button label (a link to an URL or a file) by pressing c on a button.
Next: Miscellaneous Commands, Previous: List/Info Interface, Up: Top [Contents][Index]
There are many variables you can modify to change the appearance or behavior of Emacs-Guix. Some of these variables are described in this section. Also you can use Custom Interface (see Easy Customization in The GNU Emacs Manual) to explore/set variables and faces—M-x customize-group RET guix.
• Graph Configuration | Set external viewer for graphs, etc. | |
• Guile and Build Options | Settings for Guix REPL, Guile, etc. | |
• List/Info Configuration | Variables for various interfaces. | |
• Buffer Names | Names of Guix buffers. | |
• Keymaps | Configuring key bindings. | |
• Miscellaneous Configuration | Other configuration variables. |
Next: Guile and Build Options, Up: Configuration [Contents][Index]
Some commands may display a graph image. Currently Guix provides 2 graph backends (see Invoking guix graph in The GNU Guix Reference Manual):
d3js
Such graph will be displayed in your browser using browse-url
function (see Browse-URL in The GNU Emacs Manual).
graphviz
Such graph will be displayed inside Emacs by default, but this can be configured …
… Graphs are opened using guix-find-file-function
, so if
you want to use an external viewer, you need to set this variable.
Probably the easiest way to set an external viewer is to use a
functionality provided by the Org Mode. For example, if you want to
open the generated graphs (PNG files) with sxiv
image viewer,
you can do it like this:
(setq guix-find-file-function 'org-open-file) (add-to-list 'org-file-apps '("\\.png\\'" . "sxiv %s"))
Now some deeper details and configuration options.
The graphviz
graph is converted into an image file using
dot
command specified by guix-dot-program
and
guix-dot-default-arguments
variables. By default, a PNG file is
generated and saved as /tmp/emacs-guix-XXXXXX/graph-XXXXXX.png.
If you want to change an output format (for example, into PDF), you also
need to change guix-dot-file-name-function
(to make .pdf
extension of the output file). This can be done like this:
(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)
Next: List/Info Configuration, Previous: Graph Configuration, Up: Configuration [Contents][Index]
guix-guile-program
If you have some special needs for starting a Guile process, you may
set this variable. For example, by default, Guile is started with
--no-auto-compile
flag (because auto-compilation may take a
very long time), so if you just want guile
without any flags,
you may just use:
(setq guix-guile-program "guile")
guix-load-path
guix-load-compiled-path
Directory or a list of directories prepended to Guile’s
%load-path
and %load-compiled-path
(see Load Paths in The GNU Guile Reference Manual).
If you use Guix from a git checkout (see Running Guix Before It Is Installed in The GNU Guix Reference Manual), you may want Emacs-Guix to use the same guix from git. All you need is to point Emacs-Guix to this checkout:
(setq guix-load-path "/path/to/guix-git-dir")
Note that setting guix-load-compiled-path
is not needed when
Scheme (.scm
) and compiled (.go
) files are placed in the
same directories.
guix-use-substitutes
Has the same meaning as --no-substitutes
option
(see Invoking guix build in The GNU Guix Reference
Manual)—i.e., when non-nil, substitutes are enabled.
guix-dry-run
Has the same meaning as --dry-run
option (see Invoking guix
build in The GNU Guix Reference Manual)—i.e., when non-nil,
do not build the derivations.
guix-repl-use-server
By default, along with the main Guix REPL, an additional (internal) REPL is started. This allows you to display packages, generations and to receive other info from the Scheme side, while there is some active process in the main Guix REPL (e.g., while downloading or building packages). If you don’t want to have the second REPL, set this variable to nil.
guix-repl-use-latest
Set this variable to nil, if you don’t want to use the latest Guix
code received with guix pull
command (see Invoking guix
pull in The GNU Guix Reference Manual).
Next: Buffer Names, Previous: Guile and Build Options, Up: Configuration [Contents][Index]
If you wish to change the appearance of various “list” and “info”
buffers (see List/Info Interface), you may look at
guix-ENTRY-TYPE-BUFFER-TYPE-…
variables. Here,
BUFFER-TYPE is either list
or info
, and
ENTRY-TYPE is one of the following:
package
package-location
output
profile
generation
system
system-generation
service
service-location
license
The main variable of them is
guix-ENTRY-TYPE-BUFFER-TYPE-format
: it defines what parameters,
in what order and in what way are displayed. You are welcome to play
with these “format” variables and to explore the other ones.
Next: Keymaps, Previous: List/Info Configuration, Up: Configuration [Contents][Index]
Default names of various Emacs-Guix buffers (“*Guix …*”) may be changed with the following variables:
guix-ENTRY-TYPE-BUFFER-TYPE-buffer-name
See List/Info Configuration, for the meaning of ENTRY-TYPE
and BUFFER-TYPE
.
guix-ui-buffer-name-function
By default, many Guix buffers contain profile name (e.g., *Guix
Packages: <profile>*
). This variable allows you to control how this
profile name is displayed. If you want to remove profile name from
the buffer names, you can do it like this:
(setq guix-ui-buffer-name-function 'guix-ui-buffer-name-simple)
guix-repl-buffer-name
guix-internal-repl-buffer-name
guix-search-paths-buffer-name
guix-help-buffer-name
guix-about-buffer-name
Next: Miscellaneous Configuration, Previous: Buffer Names, Up: Configuration [Contents][Index]
If you want to change default key bindings, look at the following keymaps (see Init Rebinding in The GNU Emacs Manual):
guix-ui-map
Parent keymap with general keys for buffers used for Guix package management.
guix-ENTRY-TYPE-BUFFER-TYPE-mode-map
See List/Info Configuration, for the meaning of ENTRY-TYPE
and BUFFER-TYPE
.
guix-build-log-common-map
guix-build-log-mode-map
guix-build-log-minor-mode-map
guix-devel-keys-map
guix-devel-mode-map
Previous: Keymaps, Up: Configuration [Contents][Index]
guix-support-dired
Some Emacs-Guix commands (for example, M-x guix-hash or M-x
guix-package-from-file) may or may not support dired-mode
(see Dired in The GNU Emacs Manual). By default, whenever
you run them in a Dired buffer, they will use the file name at
point—i.e., you will not be prompted for it. If you wish to disable
this feature, set guix-support-dired
variable to nil.
guix-file-size-string-function
You may meet a string with file size in several places, in particular, in interface for store items (see Store Items). By default, this string looks like this: ‘96.5k (98765 bytes)’. You can modify this format by using your own function, for example:
(defun my-guix-file-size-string (size) (file-size-human-readable size 'si)) (setq guix-file-size-string-function 'my-guix-file-size-string)
Next: Help, Previous: Configuration, Up: Top [Contents][Index]
And some more commands that were not covered by the other chapters.
Open a mail buffer to report a bug for GNU Guix similarly to M-x report-emacs-bug command.
Set current Emacs environment according to a specified profile. Note that there is no way to restore the original environment (you have to restart Emacs if you wish to do it).
It is the same as guix pull
shell command (see Invoking
guix pull in The GNU Guix Reference Manual). With C-u,
make it verbose.
Once guix pull
has succeeded, the Guix REPL is
restarted2. This allows you to keep
using the Emacs interface with the updated Guix code.
Compute and copy to the kill ring (see Yanking in The GNU Emacs Manual) the SHA256 hash of a file (see Invoking guix hash in The GNU Guix Reference Manual). With C-u, prompt for a hash format.
If you call this command on a directory, its hash will be calculated recursively without version-controlled files (so you can use this hash in a package recipe).
Next: Concept Index, Previous: Miscellaneous Commands, Up: Top [Contents][Index]
So many commands, so many buffers! This chapter describes few more commands that should help you not to get lost.
Display a buffer with the summary of the available Emacs-Guix commands. Buttons in this buffer allow you to run commands and to look at their docstrings and manual entries.
Show this Emacs-Guix info manual. With prefix argument, show the Guix info manual.
Switch to one of the Emacs-Guix buffers. This is like a usual
switch-to-buffer
(bound to C-x b by default), except it
completes only Guix buffers names. If you are going to use this
command, it is probably better to bind it to some key, for example:
(global-set-key (kbd "C-x B") 'guix-switch-to-buffer)
Run Emacs-Guix command. This is like M-x (see M-x in The GNU Emacs Manual), except it completes only Guix command names. And again, this is not a very useful command unless it is bound to some key, for example:
(global-set-key (kbd "M-X") 'guix-extended-command)
Next: Command Index, Previous: Help, Up: Top [Contents][Index]
Jump to: | B C F G I P S |
---|
Jump to: | B C F G I P S |
---|
Next: Variable Index, Previous: Concept Index, Up: Top [Contents][Index]
Jump to: | G |
---|
Jump to: | G |
---|
Previous: Command Index, Up: Top [Contents][Index]
Jump to: | G |
---|
Jump to: | G |
---|
It is not recommended to mix several
installations (in particular, installations from Guix and MELPA), as
it may lead to incompatibilities in the source (.scm
) and
compiled (.go
) Guile files.
Note that name/version pairs cannot be used to identify packages (because a name is not necessarily unique), so Emacs-Guix 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 g).