Am Donnerstag, dem 16.11.2023 um 16:25 +0100 schrieb Ludovic Courtès:
> Liliana Marie Prikler <liliana.prik...@gmail.com> skribis:
> 
> > 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.
> 
> “Archaic” is one way to describe it; I’d have said “standard”.  :-)
> (Implemented by Vi(m), Emacs, Nano, less, more, etc.)
I said “archaic”, because POSIX specifically says “all options should
be preceded by the '-' character”, with special exceptions for more,
etc. for backwards compatibility.  It's a bit of a pain, because the
argument that used to be standard among all those tools has (in POSIX
at least) been replaced by several dashed ones.

> > > 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
> 
> It’d be nice to support these as well.  However, how do we know we’re
> dealing with kate or VSCode?  By checking the basename of $EDITOR?
> Kinda ugly and brittle, but probably better than nothing.
Maybe we can check for a guix_editor shell function and invoke that
rather than EDITOR if defined?

Cheers 

Reply via email to