Question

I want to pass an empty string to emacsclient so that it will auto-start the emacs server if it's not already running. On the command line if I type emacsclient -t -a '', this does exactly what I just described. In my bashrc file I have:

alias ec="emacsclient -t -a \'\'"

Which does not do what I want. I get this error

emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: error executing alternate editor "''"

How do I pass an empty string as an argument?

Était-ce utile?

La solution

You don't need to escape the single quotes within double quotes:

alias ec="emacsclient -t -a ''"
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top