You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

785 lines
25 KiB

  1. @node Emacs Interface
  2. @chapter Emacs Interface
  3. @cindex Emacs
  4. GNU Guix comes with several useful modules (known as ``guix.el'') for
  5. GNU@tie{}Emacs which are intended to make an Emacs user interaction with
  6. Guix convenient and fun.
  7. @menu
  8. * Initial Setup: Emacs Initial Setup. Preparing @file{~/.emacs}.
  9. * Package Management: Emacs Package Management. Managing packages and generations.
  10. * Popup Interface: Emacs Popup Interface. Magit-like interface for guix commands.
  11. * Prettify Mode: Emacs Prettify. Abbreviating @file{/gnu/store/@dots{}} file names.
  12. * Build Log Mode: Emacs Build Log. Highlighting Guix build logs.
  13. * Completions: Emacs Completions. Completing @command{guix} shell command.
  14. * Development: Emacs Development. Tools for Guix developers.
  15. * Hydra: Emacs Hydra. Interface for Guix build farm.
  16. @end menu
  17. @node Emacs Initial Setup
  18. @section Initial Setup
  19. On the Guix System Distribution (@pxref{GNU Distribution}), ``guix.el''
  20. is ready to use, provided Guix is installed system-wide, which is the
  21. case by default. So if that is what you're using, you can happily skip
  22. this section and read about the fun stuff.
  23. If you're not yet a happy user of GuixSD, a little bit of setup is needed.
  24. To be able to use ``guix.el'', you need to install the following
  25. packages:
  26. @itemize
  27. @item
  28. @uref{http://www.gnu.org/software/emacs/, GNU Emacs}, version 24.3 or
  29. later;
  30. @item
  31. @uref{http://nongnu.org/geiser/, Geiser}, version 0.3 or later: it is
  32. used for interacting with the Guile process.
  33. @item
  34. @uref{https://github.com/magit/magit/, magit-popup library}. You
  35. already have this library if you use Magit 2.1.0 or later. This library
  36. is an optional dependency---it is required only for @kbd{M-x@tie{}guix}
  37. command (@pxref{Emacs Popup Interface}).
  38. @end itemize
  39. When it is done ``guix.el'' may be configured by requiring a special
  40. @code{guix-init} file---i.e., by adding the following code into your
  41. init file (@pxref{Init File,,, emacs, The GNU Emacs Manual}):
  42. @example
  43. (add-to-list 'load-path "/path/to/directory-with-guix.el")
  44. (require 'guix-init nil t)
  45. @end example
  46. So the only thing you need to figure out is where the directory with
  47. elisp files for Guix is placed. It depends on how you installed Guix:
  48. @itemize
  49. @item
  50. If it was installed by a package manager of your distribution or by a
  51. usual @code{./configure && make && make install} command sequence, then
  52. elisp files are placed in a standard directory with Emacs packages
  53. (usually it is @file{/usr/share/emacs/site-lisp/}), which is already in
  54. @code{load-path}, so there is no need to add that directory there.
  55. @item
  56. If you used a binary installation method (@pxref{Binary Installation}),
  57. then Guix is installed somewhere in the store, so the elisp files are
  58. placed in @file{/gnu/store/@dots{}-guix-0.8.2/share/emacs/site-lisp/} or
  59. alike. However it is not recommended to refer directly to a store
  60. directory. Instead you can install Guix using Guix itself with
  61. @command{guix package -i guix} command (@pxref{Invoking guix package})
  62. and add @file{~/.guix-profile/share/emacs/site-lisp/} directory to
  63. @code{load-path} variable.
  64. @item
  65. If you did not install Guix at all and prefer a hacking way
  66. (@pxref{Running Guix Before It Is Installed}), along with augmenting
  67. @code{load-path} you need to set @code{guix-load-path} variable to the
  68. same directory, so your final configuration will look like this:
  69. @example
  70. (let ((dir "/path/to/your-guix-git-tree/emacs"))
  71. (add-to-list 'load-path dir)
  72. (setq guix-load-path dir))
  73. (require 'guix-init nil t)
  74. @end example
  75. @end itemize
  76. By default, along with autoloading (@pxref{Autoload,,, elisp, The GNU
  77. Emacs Lisp Reference Manual}) the main interactive commands for
  78. ``guix.el'' (@pxref{Emacs Commands}), requiring @code{guix-init} will
  79. also autoload commands for the Emacs packages installed in your user
  80. profile.
  81. To disable automatic loading of installed Emacs packages, set
  82. @code{guix-package-enable-at-startup} variable to @code{nil} before
  83. requiring @code{guix-init}. This variable has the same meaning for
  84. Emacs packages installed with Guix, as @code{package-enable-at-startup}
  85. for the built-in Emacs package system (@pxref{Package Installation,,,
  86. emacs, The GNU Emacs Manual}).
  87. You can activate Emacs packages installed in your profile whenever you
  88. want using @kbd{M-x@tie{}guix-emacs-load-autoloads}.
  89. @node Emacs Package Management
  90. @section Package Management
  91. Once ``guix.el'' has been successfully configured, you should be able to
  92. use a visual interface for routine package management tasks, pretty much
  93. like the @command{guix package} command (@pxref{Invoking guix package}).
  94. Specifically, it makes it easy to:
  95. @itemize
  96. @item browse and display packages and generations;
  97. @item search, install, upgrade and remove packages;
  98. @item display packages from previous generations;
  99. @item do some other useful things.
  100. @end itemize
  101. @menu
  102. * Commands: Emacs Commands. @kbd{M-x guix-@dots{}}
  103. * General information: Emacs General info. Common for both interfaces.
  104. * ``List'' buffer: Emacs List buffer. List-like interface.
  105. * ``Info'' buffer: Emacs Info buffer. Help-like interface.
  106. * Configuration: Emacs Configuration. Configuring the interface.
  107. @end menu
  108. @node Emacs Commands
  109. @subsection Commands
  110. All commands for displaying packages and generations use the current
  111. profile, which can be changed with
  112. @kbd{M-x@tie{}guix-set-current-profile}. Alternatively, if you call any
  113. of these commands with prefix argument (@kbd{C-u}), you will be prompted
  114. for a profile just for that command.
  115. Commands for displaying packages:
  116. @table @kbd
  117. @item M-x guix-all-available-packages
  118. @itemx M-x guix-newest-available-packages
  119. Display all/newest available packages.
  120. @item M-x guix-installed-packages
  121. Display all installed packages.
  122. @item M-x guix-obsolete-packages
  123. Display obsolete packages (the packages that are installed in a profile
  124. but cannot be found among available packages).
  125. @item M-x guix-search-by-name
  126. Display package(s) with the specified name.
  127. @item M-x guix-search-by-regexp
  128. Search for packages by a specified regexp. By default ``name'',
  129. ``synopsis'' and ``description'' of the packages will be searched. This
  130. can be changed by modifying @code{guix-package-search-params} variable.
  131. @end table
  132. By default, these commands display each output on a separate line. If
  133. you prefer to see a list of packages---i.e., a list with a package per
  134. line, use the following setting:
  135. @example
  136. (setq guix-package-list-type 'package)
  137. @end example
  138. Commands for displaying generations:
  139. @table @kbd
  140. @item M-x guix-generations
  141. List all the generations.
  142. @item M-x guix-last-generations
  143. List the @var{N} last generations. You will be prompted for the number
  144. of generations.
  145. @item M-x guix-generations-by-time
  146. List generations matching time period. You will be prompted for the
  147. period using Org mode time prompt based on Emacs calendar (@pxref{The
  148. date/time prompt,,, org, The Org Manual}).
  149. @end table
  150. You can also invoke the @command{guix pull} command (@pxref{Invoking
  151. guix pull}) from Emacs using:
  152. @table @kbd
  153. @item M-x guix-pull
  154. With @kbd{C-u}, make it verbose.
  155. @end table
  156. Once @command{guix pull} has succeeded, the Guix REPL is restared. This
  157. allows you to keep using the Emacs interface with the updated Guix.
  158. @node Emacs General info
  159. @subsection General information
  160. The following keys are available for both ``list'' and ``info'' types of
  161. buffers:
  162. @table @kbd
  163. @item l
  164. @itemx r
  165. Go backward/forward by the history of the displayed results (this
  166. history is similar to the history of the Emacs @code{help-mode} or
  167. @code{Info-mode}).
  168. @item g
  169. Revert current buffer: update information about the displayed
  170. packages/generations and redisplay it.
  171. @item R
  172. Redisplay current buffer (without updating information).
  173. @item M
  174. Apply manifest to the current profile or to a specified profile, if
  175. prefix argument is used. This has the same meaning as @code{--manifest}
  176. option (@pxref{Invoking guix package}).
  177. @item C-c C-z
  178. @cindex REPL
  179. @cindex read-eval-print loop
  180. Go to the Guix REPL (@pxref{The REPL,,, geiser, Geiser User Manual}).
  181. @item h
  182. @itemx ?
  183. Describe current mode to see all available bindings.
  184. @end table
  185. @emph{Hint:} If you need several ``list'' or ``info'' buffers, you can
  186. simlpy @kbd{M-x clone-buffer} them, and each buffer will have its own
  187. history.
  188. @emph{Warning:} Name/version pairs cannot be used to identify packages
  189. (because a name is not necessarily unique), so ``guix.el'' uses special
  190. identifiers that live only during a guile session, so if the Guix REPL
  191. was restarted, you may want to revert ``list'' buffer (by pressing
  192. @kbd{g}).
  193. @node Emacs List buffer
  194. @subsection ``List'' buffer
  195. An interface of a ``list'' buffer is similar to the interface provided
  196. by ``package.el'' (@pxref{Package Menu,,, emacs, The GNU Emacs Manual}).
  197. Default key bindings available for both ``package-list'' and
  198. ``generation-list'' buffers:
  199. @table @kbd
  200. @item m
  201. Mark the current entry (with prefix, mark all entries).
  202. @item u
  203. Unmark the current entry (with prefix, unmark all entries).
  204. @item @key{DEL}
  205. Unmark backward.
  206. @item S
  207. Sort entries by a specified column.
  208. @end table
  209. A ``package-list'' buffer additionally provides the following bindings:
  210. @table @kbd
  211. @item @key{RET}
  212. Describe marked packages (display available information in a
  213. ``package-info'' buffer).
  214. @item i
  215. Mark the current package for installation.
  216. @item d
  217. Mark the current package for deletion.
  218. @item U
  219. Mark the current package for upgrading.
  220. @item ^
  221. Mark all obsolete packages for upgrading.
  222. @item e
  223. Edit the definition of the curent package (go to its location). This is
  224. similar to @command{guix edit} command (@pxref{Invoking guix edit}), but
  225. for opening a package recipe in the current Emacs instance.
  226. @item x
  227. Execute actions on the marked packages.
  228. @item B
  229. Display latest builds of the current package (@pxref{Emacs Hydra}).
  230. @end table
  231. A ``generation-list'' buffer additionally provides the following
  232. bindings:
  233. @table @kbd
  234. @item @key{RET}
  235. List packages installed in the current generation.
  236. @item i
  237. Describe marked generations (display available information in a
  238. ``generation-info'' buffer).
  239. @item s
  240. Switch profile to the current generation.
  241. @item d
  242. Mark the current generation for deletion (with prefix, mark all
  243. generations).
  244. @item x
  245. Execute actions on the marked generations---i.e., delete generations.
  246. @item e
  247. Run Ediff (@pxref{Top,,, ediff, The Ediff Manual}) on package outputs
  248. installed in the 2 marked generations. With prefix argument, run Ediff
  249. on manifests of the marked generations.
  250. @item D
  251. @itemx =
  252. Run Diff (@pxref{Diff Mode,,, emacs, The GNU Emacs Manual}) on package
  253. outputs installed in the 2 marked generations. With prefix argument,
  254. run Diff on manifests of the marked generations.
  255. @item +
  256. List package outputs added to the latest marked generation comparing
  257. with another marked generation.
  258. @item -
  259. List package outputs removed from the latest marked generation comparing
  260. with another marked generation.
  261. @end table
  262. @node Emacs Info buffer
  263. @subsection ``Info'' buffer
  264. The interface of an ``info'' buffer is similar to the interface of
  265. @code{help-mode} (@pxref{Help Mode,,, emacs, The GNU Emacs Manual}).
  266. ``Info'' buffer contains some buttons (as usual you may use @key{TAB} /
  267. @kbd{S-@key{TAB}} to move between buttons---@pxref{Mouse References,,,
  268. emacs, The GNU Emacs Manual}) which can be used to:
  269. @itemize @bullet
  270. @item (in a ``package-info'' buffer)
  271. @itemize @minus
  272. @item install/remove a package;
  273. @item jump to a package location;
  274. @item browse home page of a package;
  275. @item describe packages from ``Inputs'' fields.
  276. @end itemize
  277. @item (in a ``generation-info'' buffer)
  278. @itemize @minus
  279. @item remove a generation;
  280. @item switch to a generation;
  281. @item list packages installed in a generation;
  282. @item jump to a generation directory.
  283. @end itemize
  284. @end itemize
  285. It is also possible to copy a button label (a link to an URL or a file)
  286. by pressing @kbd{c} on a button.
  287. @node Emacs Configuration
  288. @subsection Configuration
  289. There are many variables you can modify to change the appearance or
  290. behavior of Emacs user interface. Some of these variables are described
  291. in this section. Also you can use Custom Interface (@pxref{Easy
  292. Customization,,, emacs, The GNU Emacs Manual}) to explore/set variables
  293. (not all) and faces.
  294. @menu
  295. * Guile and Build Options: Emacs Build Options. Specifying how packages are built.
  296. * Buffer Names: Emacs Buffer Names. Names of Guix buffers.
  297. * Keymaps: Emacs Keymaps. Configuring key bindings.
  298. * Appearance: Emacs Appearance. Settings for visual appearance.
  299. @end menu
  300. @node Emacs Build Options
  301. @subsubsection Guile and Build Options
  302. @table @code
  303. @item guix-guile-program
  304. If you have some special needs for starting a Guile process, you may set
  305. this variable, for example:
  306. @example
  307. (setq guix-guile-program '("/bin/guile" "--no-auto-compile"))
  308. @end example
  309. @item guix-use-substitutes
  310. Has the same meaning as @code{--no-substitutes} option (@pxref{Invoking
  311. guix build}).
  312. @item guix-dry-run
  313. Has the same meaning as @code{--dry-run} option (@pxref{Invoking guix
  314. build}).
  315. @end table
  316. @node Emacs Buffer Names
  317. @subsubsection Buffer Names
  318. Default names of ``guix.el'' buffers (``*Guix@tie{}@dots{}*'') may be
  319. changed with the following variables:
  320. @table @code
  321. @item guix-package-list-buffer-name
  322. @item guix-output-list-buffer-name
  323. @item guix-generation-list-buffer-name
  324. @item guix-package-info-buffer-name
  325. @item guix-output-info-buffer-name
  326. @item guix-generation-info-buffer-name
  327. @item guix-repl-buffer-name
  328. @item guix-internal-repl-buffer-name
  329. @end table
  330. By default, the name of a profile is also displayed in a ``list'' or
  331. ``info'' buffer name. To change this behavior, use
  332. @code{guix-ui-buffer-name-function} variable.
  333. For example, if you want to display all types of results in a single
  334. buffer (in such case you will probably use a history (@kbd{l}/@kbd{r})
  335. extensively), you may do it like this:
  336. @example
  337. (let ((name "Guix Universal"))
  338. (setq
  339. guix-package-list-buffer-name name
  340. guix-output-list-buffer-name name
  341. guix-generation-list-buffer-name name
  342. guix-package-info-buffer-name name
  343. guix-output-info-buffer-name name
  344. guix-generation-info-buffer-name name))
  345. @end example
  346. @node Emacs Keymaps
  347. @subsubsection Keymaps
  348. If you want to change default key bindings, use the following keymaps
  349. (@pxref{Init Rebinding,,, emacs, The GNU Emacs Manual}):
  350. @table @code
  351. @item guix-buffer-map
  352. Parent keymap with general keys for any buffer type.
  353. @item guix-ui-map
  354. Parent keymap with general keys for buffers used for Guix package
  355. management (for packages, outputs and generations).
  356. @item guix-list-mode-map
  357. Parent keymap with general keys for ``list'' buffers.
  358. @item guix-package-list-mode-map
  359. Keymap with specific keys for ``package-list'' buffers.
  360. @item guix-output-list-mode-map
  361. Keymap with specific keys for ``output-list'' buffers.
  362. @item guix-generation-list-mode-map
  363. Keymap with specific keys for ``generation-list'' buffers.
  364. @item guix-info-mode-map
  365. Parent keymap with general keys for ``info'' buffers.
  366. @item guix-package-info-mode-map
  367. Keymap with specific keys for ``package-info'' buffers.
  368. @item guix-output-info-mode-map
  369. Keymap with specific keys for ``output-info'' buffers.
  370. @item guix-generation-info-mode-map
  371. Keymap with specific keys for ``generation-info'' buffers.
  372. @item guix-info-button-map
  373. Keymap with keys available when a point is placed on a button.
  374. @end table
  375. @node Emacs Appearance
  376. @subsubsection Appearance
  377. You can change almost any aspect of ``list'' / ``info'' buffers using
  378. the following variables (@dfn{ENTRY-TYPE} means @code{package},
  379. @code{output} or @code{generation}):
  380. @table @code
  381. @item guix-ENTRY-TYPE-list-format
  382. @itemx guix-ENTRY-TYPE-list-titles
  383. Specify the columns, their names, what and how is displayed in ``list''
  384. buffers.
  385. @item guix-ENTRY-TYPE-info-format
  386. @itemx guix-ENTRY-TYPE-info-titles
  387. @itemx guix-info-ignore-empty-values
  388. @itemx guix-info-param-title-format
  389. @itemx guix-info-multiline-prefix
  390. @itemx guix-info-indent
  391. @itemx guix-info-fill
  392. @itemx guix-info-delimiter
  393. Various settings for ``info'' buffers.
  394. @end table
  395. @node Emacs Popup Interface
  396. @section Popup Interface
  397. If you ever used Magit, you know what ``popup interface'' is
  398. (@pxref{Top,,, magit-popup, Magit-Popup User Manual}). Even if you are
  399. not acquainted with Magit, there should be no worries as it is very
  400. intuitive.
  401. So @kbd{M-x@tie{}guix} command provides a top-level popup interface for
  402. all available guix commands. When you select an option, you'll be
  403. prompted for a value in the minibuffer. Many values have completions,
  404. so don't hesitate to press @key{TAB} key. Multiple values (for example,
  405. packages or lint checkers) should be separated by commas.
  406. After specifying all options and switches for a command, you may choose
  407. one of the available actions. The following default actions are
  408. available for all commands:
  409. @itemize
  410. @item
  411. Run the command in the Guix REPL. It is faster than running
  412. @code{guix@tie{}@dots{}} command directly in shell, as there is no
  413. need to run another guile process and to load required modules there.
  414. @item
  415. Run the command in a shell buffer. You can set
  416. @code{guix-run-in-shell-function} variable to fine tune the shell buffer
  417. you want to use.
  418. @item
  419. Add the command line to the kill ring (@pxref{Kill Ring,,, emacs, The
  420. GNU Emacs Manual}).
  421. @end itemize
  422. Several commands (@command{guix graph}, @command{guix system dmd-graph}
  423. and @command{guix system extension-graph}) also have a ``View graph''
  424. action, which allows you to view a generated graph using @command{dot}
  425. command (specified by @code{guix-dot-program} variable). By default a
  426. PNG file will be saved in @file{/tmp} directory and will be opened
  427. directly in Emacs. This behavior may be changed with the following
  428. variables:
  429. @table @code
  430. @item guix-find-file-function
  431. Function used to open a generated graph. If you want to open a graph in
  432. an external program, you can do it by modifying this variable---for
  433. example, you can use a functionality provided by the Org Mode
  434. (@pxref{Top,,, org, The Org Manual}):
  435. @example
  436. (setq guix-find-file-function 'org-open-file)
  437. (add-to-list 'org-file-apps '("\\.png\\'" . "sxiv %s"))
  438. @end example
  439. @item guix-dot-default-arguments
  440. Command line arguments to run @command{dot} command. If you change an
  441. output format (for example, into @code{-Tpdf}), you also need to change
  442. the next variable.
  443. @item guix-dot-file-name-function
  444. Function used to define a name of the generated graph file. Default
  445. name is @file{/tmp/guix-emacs-graph-XXXXXX.png}.
  446. @end table
  447. So, for example, if you want to generate and open a PDF file in your
  448. Emacs, you may change the settings like this:
  449. @example
  450. (defun my-guix-pdf-graph ()
  451. "/tmp/my-current-guix-graph.pdf")
  452. (setq guix-dot-default-arguments '("-Tpdf")
  453. guix-dot-file-name-function 'my-guix-pdf-graph)
  454. @end example
  455. @node Emacs Prettify
  456. @section Guix Prettify Mode
  457. GNU@tie{}Guix also comes with ``guix-prettify.el''. It provides a minor
  458. mode for abbreviating store file names by replacing hash sequences of
  459. symbols with ``@dots{}'':
  460. @example
  461. /gnu/store/72f54nfp6g1hz873w8z3gfcah0h4nl9p-foo-0.1
  462. @result{} /gnu/store/…-foo-0.1
  463. @end example
  464. Once you set up ``guix.el'' (@pxref{Emacs Initial Setup}), the following
  465. commands become available:
  466. @table @kbd
  467. @item M-x guix-prettify-mode
  468. Enable/disable prettifying for the current buffer.
  469. @item M-x global-guix-prettify-mode
  470. Enable/disable prettifying globally.
  471. @end table
  472. To automatically enable @code{guix-prettify-mode} globally on Emacs
  473. start, add the following line to your init file:
  474. @example
  475. (global-guix-prettify-mode)
  476. @end example
  477. If you want to enable it only for specific major modes, add it to the
  478. mode hooks (@pxref{Hooks,,, emacs, The GNU Emacs Manual}), for example:
  479. @example
  480. (add-hook 'shell-mode-hook 'guix-prettify-mode)
  481. (add-hook 'dired-mode-hook 'guix-prettify-mode)
  482. @end example
  483. @node Emacs Build Log
  484. @section Build Log Mode
  485. GNU@tie{}Guix provides major and minor modes for highlighting build
  486. logs. So when you have a file with a package build output---for
  487. example, a file returned by @command{guix build --log-file @dots{}}
  488. command (@pxref{Invoking guix build}), you may call @kbd{M-x
  489. guix-build-log-mode} command in the buffer with this file. This major
  490. mode highlights some lines specific to build output and provides the
  491. following key bindings:
  492. @table @kbd
  493. @item M-n
  494. Move to the next build phase.
  495. @item M-p
  496. Move to the previous build phase.
  497. @item @key{TAB}
  498. Toggle (show/hide) the body of the current build phase.
  499. @item S-@key{TAB}
  500. Toggle (show/hide) the bodies of all build phases.
  501. @end table
  502. There is also @kbd{M-x guix-build-log-minor-mode} which also provides
  503. the same highlighting and the same key bindings as the major mode, but
  504. prefixed with @kbd{C-c}. By default, this minor mode is enabled in
  505. shell buffers (@pxref{Interactive Shell,,, emacs, The GNU Emacs
  506. Manual}). If you don't like it, set
  507. @code{guix-build-log-minor-mode-activate} to nil.
  508. @node Emacs Completions
  509. @section Shell Completions
  510. Another feature that becomes available after configuring Emacs interface
  511. (@pxref{Emacs Initial Setup}) is completing of @command{guix}
  512. subcommands, options, packages and other things in @code{shell}
  513. (@pxref{Interactive Shell,,, emacs, The GNU Emacs Manual}) and
  514. @code{eshell} (@pxref{Top,,, eshell, Eshell: The Emacs Shell}).
  515. It works the same way as other completions do. Just press @key{TAB}
  516. when your intuition tells you.
  517. And here are some examples, where pressing @key{TAB} may complete
  518. something:
  519. @itemize @w{}
  520. @item @code{guix pa}@key{TAB}
  521. @item @code{guix package -}@key{TAB}
  522. @item @code{guix package --}@key{TAB}
  523. @item @code{guix package -i gei}@key{TAB}
  524. @item @code{guix build -L/tm}@key{TAB}
  525. @item @code{guix build --sy}@key{TAB}
  526. @item @code{guix build --system=i}@key{TAB}
  527. @item @code{guix system rec}@key{TAB}
  528. @item @code{guix lint --checkers=sy}@key{TAB}
  529. @item @code{guix lint --checkers=synopsis,des}@key{TAB}
  530. @end itemize
  531. @node Emacs Development
  532. @section Development
  533. By default, when you open a Scheme file, @code{guix-devel-mode} will be
  534. activated (if you don't want it, set @code{guix-devel-activate-mode} to
  535. nil). This minor mode provides the following key bindings:
  536. @table @kbd
  537. @item C-c . k
  538. Copy the name of the current Guile module into kill ring
  539. (@code{guix-devel-copy-module-as-kill}).
  540. @item C-c . u
  541. Use the current Guile module. Often after opening a Scheme file, you
  542. want to use a module it defines, so you switch to the Geiser REPL and
  543. write @code{,use (some module)} there. You may just use this command
  544. instead (@code{guix-devel-use-module}).
  545. @item C-c . b
  546. Build a package defined by the current variable definition. The
  547. building process is run in the current Geiser REPL. If you modified the
  548. current package definition, don't forget to reevaluate it before calling
  549. this command---for example, with @kbd{C-M-x} (@pxref{To eval or not to
  550. eval,,, geiser, Geiser User Manual})
  551. (@code{guix-devel-build-package-definition}).
  552. @item C-c . s
  553. Build a source derivation of the package defined by the current variable
  554. definition. This command has the same meaning as @code{guix build -S}
  555. shell command (@pxref{Invoking guix build})
  556. (@code{guix-devel-build-package-source}).
  557. @item C-c . l
  558. Lint (check) a package defined by the current variable definition
  559. (@pxref{Invoking guix lint}) (@code{guix-devel-lint-package}).
  560. @end table
  561. Unluckily, there is a limitation related to long-running REPL commands.
  562. When there is a running process in a Geiser REPL, you are not supposed
  563. to evaluate anything in a scheme buffer, because this will ``freeze''
  564. the REPL: it will stop producing any output (however, the evaluating
  565. process will continue---you will just not see any progress anymore). Be
  566. aware: even moving the point in a scheme buffer may ``break'' the REPL
  567. if Autodoc (@pxref{Autodoc and friends,,, geiser, Geiser User Manual})
  568. is enabled (which is the default).
  569. So you have to postpone editing your scheme buffers until the running
  570. evaluation will be finished in the REPL.
  571. Alternatively, to avoid this limitation, you may just run another Geiser
  572. REPL, and while something is being evaluated in the previous REPL, you
  573. can continue editing a scheme file with the help of the current one.
  574. @node Emacs Hydra
  575. @section Hydra
  576. The continuous integration server at @code{hydra.gnu.org} builds all
  577. the distribution packages on the supported architectures and serves
  578. them as substitutes (@pxref{Substitutes}). Continuous integration is
  579. currently orchestrated by @uref{https://nixos.org/hydra/, Hydra}.
  580. This section describes an Emacs interface to query Hydra to know the
  581. build status of specific packages, discover recent and ongoing builds,
  582. view build logs, and so on. This interface is mostly the same as the
  583. ``list''/``info'' interface for displaying packages and generations
  584. (@pxref{Emacs Package Management}).
  585. The following commands are available:
  586. @table @kbd
  587. @item M-x guix-hydra-latest-builds
  588. Display latest failed or successful builds (you will be prompted for a
  589. number of builds). With @kbd{C-u}, you will also be prompted for other
  590. parameters (project, jobset, job and system).
  591. @item M-x guix-hydra-queued-builds
  592. Display scheduled or currently running builds (you will be prompted for
  593. a number of builds).
  594. @item M-x guix-hydra-jobsets
  595. Display available jobsets (you will be prompted for a project).
  596. @end table
  597. In a list of builds you can press @kbd{L} key to display a build log of
  598. the current build. Also both a list of builds and a list of jobsets
  599. provide @kbd{B} key to display latest builds of the current job or
  600. jobset (don't forget about @kbd{C-u}).