I'm using emacs under Ubuntu
If I want to edit a.txt then I either click on the emacs icon or use
$ emacs --geometry 10x10 --fullscreen --no-splash ~/a.txt &
from bash. My .emacs file starts the emacs server.
If I then want to edit another file from the command line, I use
$ emacsclient -n ~/b.txt
to load the file into the existing emacs.
but I keep getting it wrong, and all hell breaks loose in various ways.
How would I make a bash command 'e', that checks whether the emacs server is already running, and executes the appropriate command?
Attempts to use the emacsclient -a
switch invariably produce undesirable and ill-determined behaviour.
Extra points if it can 'do the right thing' when run on a console too.