I want to use emacs command as a substitution for emacsclient -c -a "", which according to man connects to an existing emacs daemon, or creates a new daemon and connects to it otherwise. So i created a shell script emacs, which calls the aforementioned command in my ~/bin, which itself is included in $PATH. But when i run emacs, it repeats the following numerously:
emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
and then also numerously:
Error: Could not start the Emacs daemon
The content of ~/bin/emacs is:
#!/bin/bash
emacsclient -c -a ""
According to Emacs devs, emacsclient internally calls emacs from $PATH, so calling it enters an infinite recursion. What should i do, so i can use custom emacs executable with the same behavior?