Le lundi 12 août 2024, 11:36:37 UTC Richard Lewis a écrit :
> Bastien Roucariès <ro...@debian.org> writes:
> 
> > Sensible-editor could now use EDITOR="emacsclient -n -c" and accept
> > that sh -c accept
> >
> > My goal is to create a sensible-editor.desktop that will lauch by
> > default the sensible-editor of choice
> >
> > For this I plan:
> > - to allow by alternative mechanism to have an sensible-editor-tty
> > (may be better wording) sensible-editor-$XDG_CURRENT_DESKTOP
> > in order to allow default customization
> > - SENSIBLE_EDITOR is not set, sensible-editor will first try
> > sensible-editor-$XDG_CURRENT_DESKTOP XDG_CURRENT_DESKTOP (if
> > $XDG_CURRENT_DESKTOP
> > is set) then  sensible-editor-tty (using if needed sensible-terminal)
> >
> 
> Can you set out how this affects users
> 
> If i am using gnome, i want something pretty simple
> 
> a) opening a file with the mouse should use gnome's default (which can
>  change in settings)

No change except if you associate to sensible-editor
> 
> b) but if im in a terminal (even if running in gnome) then i want a
>  terminal-based editor (based on what i installed)

depends for me I prefer to run under emacsclient so you could do something like
SENSIBLE_EDITOR='if [ -t 0 ]; then sensible-editor-GNOME ; else 
sensible-editor-tty; fi;'

For now I have some gui program that try to run editor from gui and fail, 
because you should attach a console.

> 
> (b) also means no failures if i get a dpkg "edit conffile" situation
> while upgrading -- graphical editors may fail to start, or i might be on
> the linux console when dist-upgrading.

Yes and sensible editor will try fallback, I do for now for nano that fail on 
DUMP terminal, and I have also corner case with other editor
so I should write wrapper...

>  
> 
> i think this all works great today, will it still work with your
> proposal?  what extra cases are you proposing to support?

do not fail to run sensible-editor from a GUI, and if run a console of choice 
before with the editor on it.
 
> > I will also like to allow sensible-editor-STUFF to support +4:3 FILE
> > command line, so
> > editor +4:3 somefile.txt will open somefile.txt and if possible go to
> > line 4 column 3 (and silently ignore if not possible)
> >
> 
> sounds great (and separate to the above), although i wonder how you will
> tell whether the underlying editor supports it.

Yes that why I propose wrapper

editor in a POSIX sense is a wrapper against vi. minimal command line is 
documented for ex.

It could only open one file passed as last argument

so for me editor is
editor [file]

I only propose to add

editor [+line[:column]] [file] for the wrapper

bastien

> 
> 
> 

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to