Next: , Up: Configuration   [Contents][Index]

15.1 Graph Configuration

Some commands may display a graph image. Currently Guix provides 2 graph backends (see Invoking guix graph in The GNU Guix Reference Manual):


Such graph will be displayed in your browser using browse-url function (see Browse-URL in The GNU Emacs Manual).


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

(setq guix-dot-default-arguments '("-Tpdf")
      guix-dot-file-name-function 'my-guix-pdf-graph)