From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH] doc: emacs: Document "View graph" popup action. Date: Fri, 16 Oct 2015 19:57:57 +0300 Message-ID: <87wpumycmi.fsf_-_@gmail.com> References: <87a8rjkj8y.fsf@gmail.com> <8737xbw7nd.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn8KO-0000BC-W1 for guix-devel@gnu.org; Fri, 16 Oct 2015 12:58:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zn8KK-0005Tx-UT for guix-devel@gnu.org; Fri, 16 Oct 2015 12:58:00 -0400 In-Reply-To: <8737xbw7nd.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 16 Oct 2015 10:16:06 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s (2015-10-16 11:16 +0300) wrote: > Alex Kost skribis: > >> From 79027171c9be2cececde951caf54758c4e1bb8f5 Mon Sep 17 00:00:00 2001 >> From: Alex Kost >> Date: Thu, 15 Oct 2015 22:10:32 +0300 >> Subject: [PATCH] emacs: Add "View graph" actions to system graph command= s. >> >> * emacs/guix-command.el (guix-command-additional-execute-arguments, >> guix-command-special-executors): Add "View graph" actions for >> 'dmd-graph' and 'extension-graph' commands. >> * doc/emacs.texi (Emacs Popup Interface): Document "View graph" action. > > Excellent! > > Perhaps the documentation part should go in a separate commit since it=E2= =80=99s > not strictly related to the new commands? Yes, I agree. I have split it and pushed the part to add "View graph" actions. >> +Several commands (@command{guix graph}, @command{guix system dmd-graph} >> +and @command{guix system extension-graph}) also have a ``View graph'' >> +action, which allows to view a generated graph using @command{dot} > ^^^ > =E2=80=9Cwhich allows you to view=E2=80=9D Fixed. >> +command (specified by @code{guix-dot-program} variable). By default a >> +PNG file will be saved in @file{/tmp} directory and will be opened > > Not directly related to this patch, but I wonder if this would work with > a PDF opened with DocView? That would allow people to zoom in etc. Sure, you can generate any type of graph and open it inside or outside emacs, whatever you want. I have added an example for this case (in the attached patch), so please report if it's not clear. Thanks! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-doc-emacs-Document-View-graph-popup-action.patch >From 70e53141ee1767e09fdc2b0a48e3cf82323b3482 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 16 Oct 2015 17:50:36 +0300 Subject: [PATCH] doc: emacs: Document "View graph" popup action. * doc/emacs.texi (Emacs Popup Interface): Document "View graph" action. --- doc/emacs.texi | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/doc/emacs.texi b/doc/emacs.texi index ab69515..0e901e1 100644 --- a/doc/emacs.texi +++ b/doc/emacs.texi @@ -531,6 +531,49 @@ GNU Emacs Manual}). @end itemize +Several commands (@command{guix graph}, @command{guix system dmd-graph} +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 + @node Emacs Prettify @section Guix Prettify Mode -- 2.5.0 --=-=-=--