diff --git a/dotfiles/emacs.d b/dotfiles/emacs.d index 37df87cf..bdd1bd0e 160000 --- a/dotfiles/emacs.d +++ b/dotfiles/emacs.d @@ -1 +1 @@ -Subproject commit 37df87cf386d3645b2a88ee40d2451d1063423ba +Subproject commit bdd1bd0e3bc2f989e268147e0569540028d2ba34 diff --git a/dotfiles/lib/shellenv.sh b/dotfiles/lib/shellenv.sh index 82a9e10c..4b7097c8 100644 --- a/dotfiles/lib/shellenv.sh +++ b/dotfiles/lib/shellenv.sh @@ -32,3 +32,7 @@ add_to_back_of_path "/usr/local/sbin" # Load RVM into a shell session *as a function* [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" + +function shellrc { + zsh -c "source ~/.zshrc && ""$@" +} diff --git a/dotfiles/lib/shellrc/aliases.sh b/dotfiles/lib/shellrc/aliases.sh index 8f4fd3d2..c040ccef 100644 --- a/dotfiles/lib/shellrc/aliases.sh +++ b/dotfiles/lib/shellrc/aliases.sh @@ -7,7 +7,6 @@ alias prj='cd ~/Projects' alias t27='tox -e py27 -- ' alias tvenv='tox -e venv -- ' alias reload_tmux='tmux source-file ~/.tmux.conf' -alias which='type' alias ssh='ssh -A ' # enables the sudoing of aliases. diff --git a/dotfiles/lib/shellrc/emacs.sh b/dotfiles/lib/shellrc/emacs.sh index dc57c10b..42aa21b6 100644 --- a/dotfiles/lib/shellrc/emacs.sh +++ b/dotfiles/lib/shellrc/emacs.sh @@ -1,4 +1,4 @@ -alias e='emacs_open' +alias e='emacs_open -n ' alias emacs='_emacs -c -n ' is_osx && alias emacs='cocoa_emacs' alias terminal_emacs='_emacs -t' @@ -40,7 +40,7 @@ function _current_dot_directory { function existing_emacs { # Return any existing emacs server file or the one that should # be created if it doesn't exist. - local server_file="$(\ls ~/.emacs.d/server | head -n1)" + local server_file="$(emacs_get_running_instances | head -n1)" [ -z "$server_file" ] && server_file="$(_emacs_server_file)" echo $server_file } @@ -64,11 +64,10 @@ function emacs_open { fi local server_file="$(emacs_get_running_instances | head -n1)" emacs_make_frame_if_none_exists $server_file - [ ! -z "$@" ] && emacsclient "$@" -n --server-file="$server_file" + [ ! -z "$@" ] && emacsclient "$@" --server-file="$server_file" focus_emacs } # Make emacs the default editor. -export EDITOR="$(which emacsclient) -n -s " -export ALTERNATE_EDITOR="" +export EDITOR="zsh -c 'source ~/.zshrc && emacs_open '"'"$@"' export VISUAL="$EDITOR"