2014-10-27 03:20:32 -06:00
alias emacs = 'cemacs'
alias cemacs = '_emacs -c -n'
alias temacs = '_emacs -t'
2014-10-27 04:21:33 -06:00
alias ec = '_emacs -n '
2014-10-27 02:55:02 -06:00
function _emacs {
2014-10-27 03:20:32 -06:00
local directory = " $( git rev-parse --show-toplevel 2> /dev/null || pwd ) "
local server_name = " $( _dot_directory $directory ) "
2014-10-27 04:21:33 -06:00
test -z " $( ps aux | grep -v grep | grep -i " emacs -nw --daemon=.* $server_name $" ) " && echo " Starting emacs with server name ' $server_name ' " && \e macs --daemon= " $server_name "
2014-10-27 03:20:32 -06:00
emacsclient $* --server-file= " $server_name "
2014-10-27 02:55:02 -06:00
}
2014-10-27 03:20:32 -06:00
function _dot_directory {
2014-10-27 04:21:33 -06:00
echo $1 | sed "s:/:.:g"
2014-10-27 02:55:02 -06:00
}