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: Mon, 19 Oct 2015 17:49:10 +0300 Message-ID: <8737x6ewwp.fsf@gmail.com> References: <877fmnkj61.fsf@gmail.com> <87si5buswd.fsf@gnu.org> <87twpqy8qp.fsf@gmail.com> <87wpulk49m.fsf@gnu.org> <87oafxsdkm.fsf@gmail.com> <871tcsi0j1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoBkN-00030t-KZ for guix-devel@gnu.org; Mon, 19 Oct 2015 10:49:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoBkJ-0004Mw-EJ for guix-devel@gnu.org; Mon, 19 Oct 2015 10:49:11 -0400 In-Reply-To: <871tcsi0j1.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 18 Oct 2015 18:50:26 +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-18 19:50 +0300) wrote: > Alex Kost skribis: > >> Ludovic Court=C3=A8s (2015-10-17 16:34 +0300) wrote: > > [...] > >>> 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-pro= gram=E2=80=99 is an >>> absolute file name. >> >> I think (executable-find "dot") is more reliable than just "dot" which >> may not exist. > > Agreed! I was just saying that an empty string is odd, and that setting > it to =E2=80=98dot=E2=80=99 would be aesthetically more pleasing. Not for me, but OK. > So the only different is that the above would become: > > (defcustom guix-dot-program > (if (absolute-file-name-p guix-config-dot-program) > guix-config-dot-program > (executable-find "dot"))) > > Does it make sense? Yes, now I see what you mean. I still prefer an empty string, but I don't mind the variant you suggest. The updated patch is attached, thanks! --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-build-Set-DOT_USER_PROGRAM-for-Emacs-interface.patch Content-Transfer-Encoding: quoted-printable >From 0cc7c8d44b88e7df9a0f443d8939c6b8ac14232e Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 16 Oct 2015 20:34:32 +0300 Subject: [PATCH] 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. --- configure.ac | 1 + emacs/guix-config.el.in | 4 ++++ emacs/guix-external.el | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bb3d947..00e7c7b 100644 --- a/configure.ac +++ b/configure.ac @@ -206,6 +206,7 @@ AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) AC_CONFIG_FILES([test-env], [chmod +x test-env]) =20 dnl Emacs interface. +AC_PATH_PROG([DOT_USER_PROGRAM], [dot], [dot]) AM_PATH_LISPDIR AM_CONDITIONAL([HAVE_EMACS], [test "x$EMACS" !=3D "xno"]) =20 diff --git a/emacs/guix-config.el.in b/emacs/guix-config.el.in index 16434ce..c7affb8 100644 --- a/emacs/guix-config.el.in +++ b/emacs/guix-config.el.in @@ -1,6 +1,7 @@ ;;; guix-config.el --- Compile-time configuration of Guix. =20 ;; Copyright =C2=A9 2015 Mathieu Lirzin +;; Copyright =C2=A9 2015 Alex Kost =20 ;; This file is part of GNU Guix. =20 @@ -35,6 +36,9 @@ strings of the form: =20 Where ARGS is a list of arguments to the guile program.") =20 +(defconst guix-config-dot-program "@DOT_USER_PROGRAM@" + "Name of the 'dot' executable defined at configure time.") + (provide 'guix-config) =20 ;;; guix-config.el ends here diff --git a/emacs/guix-external.el b/emacs/guix-external.el index 580676e..cf4bd26 100644 --- a/emacs/guix-external.el +++ b/emacs/guix-external.el @@ -23,11 +23,16 @@ =20 ;;; Code: =20 +(require 'guix-config) + (defgroup guix-external nil "Settings for external programs." :group 'guix) =20 -(defcustom guix-dot-program (executable-find "dot") +(defcustom guix-dot-program + (if (file-name-absolute-p guix-config-dot-program) + guix-config-dot-program + (executable-find "dot")) "Name of the 'dot' executable." :type 'string :group 'guix-external) --=20 2.5.0 --=-=-=--