guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCHES] Fix some ‘guix edit’ bad assumptions.


From: Mathieu Lirzin
Subject: Re: [PATCHES] Fix some ‘guix edit’ bad assumptions.
Date: Sat, 21 Nov 2015 18:37:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> 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?

It works with ‘git commit/rebase’ and using the 'v' key in ‘less’.
After a second thought, I must admit that the fact that this “should”
work is not obvious.  ;)

>> +          (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.)

This is definitely a better solution.  Is this updated patch OK?

Attachment: 0001-edit-Allow-command-line-arguments-in-VISUAL-and-EDIT.patch
Description: Text Data

Thanks for your suggestion,

--
Mathieu Lirzin

reply via email to

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