Update server file stuff for ubuntu.

This commit is contained in:
Ivan Malison 2014-10-27 13:28:27 +00:00
parent 26b00ec84c
commit 607d515ee0
2 changed files with 12 additions and 2 deletions

View File

@ -20,10 +20,13 @@ if is_osx; then
export CPPFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments
add_to_back_of_path "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/" add_to_back_of_path "/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/"
export JAVA_HOME="$(find /Library/Java/JavaVirtualMachines -depth 1 | head -n 1)/Contents/Home" export JAVA_HOME="$(find /Library/Java/JavaVirtualMachines -depth 1 | head -n 1)/Contents/Home"
add_to_front_of_path "$JAVA_HOME/bin"
# Access gnu man pages. # Access gnu man pages.
hash brew 2> /dev/null && export MANPATH="$(brew --prefix)/opt/coreutils/libexec/gnuman:$MANPATH" hash brew 2> /dev/null && export MANPATH="$(brew --prefix)/opt/coreutils/libexec/gnuman:$MANPATH"
else
export JAVA_HOME="$(update-alternatives --config java | get_cols ' -1' | head -n 1)"
fi fi
add_to_front_of_path "$JAVA_HOME/bin"
add_to_back_of_path "$(dotfiles_directory)/resources/python" add_to_back_of_path "$(dotfiles_directory)/resources/python"
add_to_back_of_path "/usr/local/sbin" add_to_back_of_path "/usr/local/sbin"

View File

@ -6,10 +6,17 @@ alias ec='_emacs -n '
function _emacs { function _emacs {
local directory="$(git rev-parse --show-toplevel 2> /dev/null || pwd)" local directory="$(git rev-parse --show-toplevel 2> /dev/null || pwd)"
local server_name="$(_dot_directory $directory)" 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" emacsclient $* --server-file="$server_name"
} }
function _emacs_daemon_exists {
! test -z "$(ps aux | grep -v grep | grep -i "emacs.*--daemon=.*$1$")"
}
function _dot_directory { function _dot_directory {
echo $1 | sed "s:/:.:g" echo $1 | sed "s:/:.:g"
} }