Better mechanism to choose the default editor (and avoid vi if possible)?
Marcin Kasperski
Marcin.Kasperski at mekk.waw.pl
Fri Jun 5 15:47:14 UTC 2020
> If Mercurial would work harder to find some editor, this could be
> reduced to the tiny fraction of people who have neither nano, nor vi,
> nor emacs, no notepad, nor … installed.
Risky business, hunting editors. Just some realistic examples
1. $EDITOR=gedit
a) hg commit
(everything works OK)
b) hg commit
(immediate failure due to lack of error message)
Case b) happens if some gedit is already running, maybe on another
virtual desktop. Yes, one can use `gedit --standalone`, of course
depending on the version installed as this option is rather new.
2. $EDITOR=emacs
Well, I love emacs but with my convoluted config it starts 20s
on my laptop.
3. $EDITOR=emacsclient
Mostly OK except occasional
M-! hg commit
(calling from inside emacs) which deadlocks
4. $EDITOR=anythingguish
… and I happen to commit from ssh session to remote desktop machine.
Of course I don't expect mercurial to resolve all those issues, hunt
editors and their versions etc. Providing good easy to copy config
snippet(s) is less magical but makes user know where exactly this
config is and gives him a chance to find it and know it in case of
problems.
Well, elsewhere mayhaps some editors.rc in line with mergetools.rc
(list of editors, with proper options, clauses which allow/disallow
their use etc). But is it worth it?
More information about the Mercurial
mailing list