guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable.


From: Alex Kost
Subject: Re: [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable.
Date: Sat, 17 Oct 2015 18:46:17 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Ludovic Courtès (2015-10-17 16:34 +0300) wrote:

> Alex Kost <address@hidden> skribis:
>
>> From dd793147718cb18766268c8aad50d24b88ffe6b6 Mon Sep 17 00:00:00 2001
>> From: Alex Kost <address@hidden>
>> Date: Fri, 16 Oct 2015 20:34:32 +0300
>> Subject: [PATCH 1/2] build: Set DOT_USER_PROGRAM for Emacs interface.
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>>
>> Suggested by Ludovic Courtès <address@hidden>.
>>
>> * configure.ac: Set DOT_USER_PROGRAM variable.
>> * emacs/guix-config.el.in (guix-config-dot-program): New constant.
>> * emacs/guix-external.el (guix-dot-program): Use it.
>
> [...]
>
>> +(defconst guix-config-dot-program "@DOT_USER_PROGRAM@"
>> +  "Name of the 'dot' executable defined at the configure time.")
>
> “at configure time”

Thanks.

> The docstring should mention that it can be the empty string.
> Alternately, ‘configure’ could set DOT_USER_PROGRAM to “dot” when it’s
> not found, which I think is ever preferable.  WDYT?

IMO an empty string is preferable (explained below), so I would like to
leave it like this (with an improved docstring as you pointed), if you
don't mind.

>> +(defcustom guix-dot-program
>> +  (if (string= "" guix-config-dot-program)
>> +      (executable-find "dot")
>> +    guix-config-dot-program)
>
> Thus here we’d be checking whether ‘guix-config-dot-program’ is an
> absolute file name.

I think (executable-find "dot") is more reliable than just "dot" which
may not exist.  So if there is no "dot" program, then ‘guix-dot-program’
variable will be set to nil.  And once "dot" will be needed, a user will
get a useful (I hope) emacs error that "dot" is missing (it is handled
by ‘guix-dot-arguments’ function).  While with just "dot" as you
suggest, there will be some unpleasant error in Guix REPL (it will
happen in ‘pipe-guix-output’ proc in “emacs/guix-main.scm”).

-- 
Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]