Next: , Previous: , Up: Top   [Contents][Index]


13 Development

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:

C-c . k

Copy the name of the current Guile module into kill ring (guix-devel-copy-module-as-kill).

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 ,use (some module) there. You may just use this command instead (guix-devel-use-module).

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 C-M-x (see To eval or not to eval in Geiser User Manual) (guix-devel-build-package-definition).

C-c . s

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).

C-c . d

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).

C-c . l

Lint (check) a package defined by the current variable definition (see Invoking guix lint in The GNU Guix Reference Manual) (guix-devel-lint-package).

C-c . '

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: , Previous: , Up: Top   [Contents][Index]