In my .profile
I've
export EDITOR="emacsclient -qa \"emacs --no-window-system --no-desktop\""
Doing sudo -e /somefile
doesn't work even when Emacs server is running. I get
emacsclient: unrecognized option '--no-window-system'
Try 'emacsclient --help' for more information
sudo: /somefile unchanged
However, git commit
does the right thing (Emacs editor for writing up my commit message) with both Emacs server running and not (opens inside terminal).
export EDITOR="emacsclient -qa nano"
Now sudo -e
is happy. So it looks like git
is OK with the spaces in the -a
(alternate editor) option's argument while sudo
is not. But, shouldn't this be a emacsclient
problem? Why do I see these different behaviours.
EDITOR
is a variable (ab)used by different programs differently. It's not because ofemacsclient
itself. – legends2k Dec 31 '19 at 8:36