Updated in response to comments from @bucaran
Port of oh-my-zsh emacs plugin.
Includes a function to kill emacs from command line once
a daemon has started.
More information included in plugins/emacs/README.md.
See reference plugin here:
https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/emacs
This is a port of a bash function I wrote almost five years ago:
https://gist.github.com/bobthecow/757788
The fish version is better though ;)
I only have OS X with iTerm and Terminal to test on, but it should be possible to add support for other terminals on other OS. Send a pull request!