Am Donnerstag, dem 02.11.2023 um 10:43 +0100 schrieb Simon Tournier:
> Hi,
> 
> The command “guix edit” returns “+N path/to/file” that is then passed
> to $EDITOR.  Therefore $EDITOR needs the command line:
> 
>     $ $EDITOR +N /path/to/file
> 
> Well, that is accepted by many $EDITOR, to my knowledge.  At least,
> Emacs, Vi or less are fine with it.
This appears to be a somewhat archaic convention.  Since less used +N,
many other tools inherited it from it; POSIX requires -p for more since
2008 instead (ironically, it laments the incompatibility with vi and
ex, which use -c).

> However, some other $EDITOR does not.  I have in mind “kate” or
> “VSCode“,
> 
>     $ kate -l N path/to/file
>     $ code --goto path/to/file:N
> 
> This had been raised in #44272 [1].  The current fix is to wrap
> $EDITOR and then make the current correct call.
> 
> The question is:
> 
>   do we tweak “guix edit” for behaving differently depending on
> $EDITOR?
> 
> or
> 
>   do we provide some wrappers for the issues that already popped up?
I think we should at least document our behaviour, so that there's
"less surprise" (at the very least, we can point surprised folk towards
the manual/cookbook then).  Going forward, we might want to call upon
some standards committee to finally have +LINE:COL or similar
standardized behaviour for $EDITOR and $VISUAL and then use that.

Cheers

Reply via email to