forked from colonelpanic/dotfiles
Update server file stuff for ubuntu.
This commit is contained in:
@@ -6,10 +6,17 @@ alias ec='_emacs -n '
|
||||
function _emacs {
|
||||
local directory="$(git rev-parse --show-toplevel 2> /dev/null || pwd)"
|
||||
local server_name="$(_dot_directory $directory)"
|
||||
test -z "$(ps aux | grep -v grep | grep -i "emacs -nw --daemon=.*$server_name$")" && echo "Starting emacs with server name '$server_name'" && \emacs --daemon="$server_name"
|
||||
if ! _emacs_daemon_exists "$server_name"; then
|
||||
echo "Starting emacs with server name '$server_name'"
|
||||
\emacs --daemon="$server_name"
|
||||
fi
|
||||
emacsclient $* --server-file="$server_name"
|
||||
}
|
||||
|
||||
function _emacs_daemon_exists {
|
||||
! test -z "$(ps aux | grep -v grep | grep -i "emacs.*--daemon=.*$1$")"
|
||||
}
|
||||
|
||||
function _dot_directory {
|
||||
echo $1 | sed "s:/:.:g"
|
||||
}
|
||||
|
Reference in New Issue
Block a user