[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCHES] Fix some ‘guix edit’ bad assumptions.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCHES] Fix some ‘guix edit’ bad assumptions. |
Date: |
Sat, 21 Nov 2015 17:05:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Mathieu Lirzin <address@hidden> skribis:
> export VISUAL="emacsclient --alternate-editor=''"
I didn’t know that including arguments in $VISUAL was supposed to work.
Does it actually work with other programs?
> + (let ((editor-args (string-split (%editor) #\space))
> + (file-names (append-map package->location-specification
> + packages)))
> + (match editor-args
> + ((editor . args)
> + (apply execlp editor (append editor-args file-names)))
The problem is that this doesn’t correspond to shell tokenization.
I think the right fix would be to do:
(system (string-append editor (string-join file-names)))
so that the thing is invoked via /bin/sh. (We must exit with the value
that ‘system’ returns.)
> Moreover I think that assuming a running emacs daemon by default if
> $VISUAL and $EDITOR are not set is not an obvious decision. My first
> intuition would be to use GNU Nano which is often installed on GNU
> systems. But after trying to edit a package with it... I have come to
> the conclusion that it was more reasonable to use 'emacs' instead.
It could also be Zile or whatever. The thing is, whatever choice we
make, it remains a last resort, and something that may not actually
work.
> From 7988fd52a23811720c82f20b5b65eb527564a7f6 Mon Sep 17 00:00:00 2001
> From: Mathieu Lirzin <address@hidden>
> Date: Sat, 21 Nov 2015 15:05:07 +0100
> Subject: [PATCH 2/2] edit: Don't assume that an emacs daemon is running.
>
> * guix/scripts/edit.scm (%editor): Use Emacs as a default value.
This is fine with me.
Thanks,
Ludo’.