GNU bug report logs - #30147
Simplify “scripts/guix”

Previous Next

Package: guix-patches;

Reported by: Mathieu Lirzin <mthl <at> gnu.org>

Date: Wed, 17 Jan 2018 19:26:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mathieu Lirzin <mthl <at> gnu.org>
To: ludo <at> gnu.org (Ludovic Courtès)
Cc: 30147-done <at> debbugs.gnu.org
Subject: [bug#30147] Simplify “scripts/guix”
Date: Wed, 24 Jan 2018 12:45:16 +0100
[Message part 1 (text/plain, inline)]
Hello again,

ludo <at> gnu.org (Ludovic Courtès) writes:

> Mathieu Lirzin <mthl <at> gnu.org> skribis:
>
>> From 77379bbf2642762927c01cc7f10eb5761626f172 Mon Sep 17 00:00:00 2001
>> From: Mathieu Lirzin <mthl <at> gnu.org>
>> Date: Tue, 23 Jan 2018 12:52:33 +0100
>> Subject: [PATCH] guix: Refactor script.
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>>
>> * scripts/guix.in: Remove empty surrounding ‘let’.  Define 'main' as the
>> procedure called when running the script.
>> (maybe-augment-load-paths!): Rename to ...
>> (augment-load-paths!): ... this.  Use 'and=>' for 'file-exists?'.
>> (run-guix-main): Rename to ...
>> (main): ... this.  Call 'augment-load-paths!'.
>
> Works for me.  Applied and pushed, thanks!

Thanks for applying this.

I didn't notice that Emacs stopped setting ‘scheme-mode’ automatically
due to the extra line implied by the use of the Guile meta switch.

Here is a fix to please Emacs.

[0001-guix-Let-Emacs-detect-scripts-guix.in-appropriate-mo.patch (text/x-patch, inline)]
From a798d6b7fa3b71faf85b4d415de99abccbfe7aab Mon Sep 17 00:00:00 2001
From: Mathieu Lirzin <mthl <at> gnu.org>
Date: Wed, 24 Jan 2018 12:29:17 +0100
Subject: [PATCH] =?UTF-8?q?guix:=20Let=20Emacs=20detect=20=E2=80=9Cscripts?=
 =?UTF-8?q?/guix.in=E2=80=9D=20appropriate=20mode.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since commit 6f774d481839f87178c5895ac2d661e141f879b8 which introduces the use
of Guile's meta switch in “scripts/guix.in”, Emacs was not using ‘scheme-mode’
for this file.

* scripts/guix.in: Replace "-*- scheme -*-" with a local variable.
---
 scripts/guix.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/guix.in b/scripts/guix.in
index e0f0ae7e0..d1c12eae5 100644
--- a/scripts/guix.in
+++ b/scripts/guix.in
@@ -1,6 +1,5 @@
 #!@GUILE@ \
 --no-auto-compile -e main -s
--*- scheme -*-
 !#
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Mark H Weaver <mhw <at> netris.org>
@@ -57,3 +56,7 @@
     ;; but since the 'guix' command is not updated by 'guix pull', we cannot
     ;; really do it now.
     (apply guix-main args)))
+
+;;; Local Variables:
+;;; mode: scheme
+;;; End:
-- 
2.16.0

[Message part 3 (text/plain, inline)]
Sorry for the mess.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37

This bug report was last modified 7 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.