From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: [PATCH] gnu: guix: Set 'guix-dot-program' emacs variable. Date: Sat, 17 Oct 2015 18:46:17 +0300 Message-ID: <87oafxsdkm.fsf@gmail.com> References: <877fmnkj61.fsf@gmail.com> <87si5buswd.fsf@gnu.org> <87twpqy8qp.fsf@gmail.com> <87wpulk49m.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnTga-0003q3-Qm for guix-devel@gnu.org; Sat, 17 Oct 2015 11:46:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnTgV-0000Kl-Qw for guix-devel@gnu.org; Sat, 17 Oct 2015 11:46:20 -0400 In-Reply-To: <87wpulk49m.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 17 Oct 2015 15:34:29 +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 Ludovic Court=C3=A8s (2015-10-17 16:34 +0300) wrote: > Alex Kost skribis: > >> From dd793147718cb18766268c8aad50d24b88ffe6b6 Mon Sep 17 00:00:00 2001 >> From: Alex Kost >> 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=3DUTF-8 >> Content-Transfer-Encoding: 8bit >> >> Suggested by Ludovic Court=C3=A8s . >> >> * 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.") > > =E2=80=9Cat configure time=E2=80=9D Thanks. > The docstring should mention that it can be the empty string. > Alternately, =E2=80=98configure=E2=80=99 could set DOT_USER_PROGRAM to = =E2=80=9Cdot=E2=80=9D when it=E2=80=99s > 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=3D "" guix-config-dot-program) >> + (executable-find "dot") >> + guix-config-dot-program) > > Thus here we=E2=80=99d be checking whether =E2=80=98guix-config-dot-progr= am=E2=80=99 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 =E2=80=98guix-dot-pro= gram=E2=80=99 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 =E2=80=98guix-dot-arguments=E2=80=99 function). While with just "dot" a= s you suggest, there will be some unpleasant error in Guix REPL (it will happen in =E2=80=98pipe-guix-output=E2=80=99 proc in =E2=80=9Cemacs/guix-ma= in.scm=E2=80=9D). --=20 Alex