From 9140387a74920bf0bbfceaf7c7440f098bbe4093 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 24 Dec 2016 14:38:54 -0500 Subject: [PATCH] editor/emacs: refactor aliases.zsh --- editor/emacs/aliases.zsh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/editor/emacs/aliases.zsh b/editor/emacs/aliases.zsh index f49442b4..21353491 100644 --- a/editor/emacs/aliases.zsh +++ b/editor/emacs/aliases.zsh @@ -1,16 +1,15 @@ -if is-callable emacs; then - if [[ "$OSTYPE" == darwin* ]]; then - alias emacs='emacs -nw' - e() { # Emacs version of v - if pgrep Emacs 2>&1 >/dev/null; then - emacsclient -n $@ - else - /Applications/Emacs.app/Contents/MacOS/Emacs $@ & - fi - } - else - alias e='emacsclient -n' - fi +if [[ "$OSTYPE" == darwin* ]]; then + alias emacs='emacs -nw' - ediff() { e --eval "(ediff-files \"$1\" \"$2\")"; } + e() { # Emacs version of v + if pgrep Emacs 2>&1 >/dev/null; then + emacsclient -n $@ + else + /Applications/Emacs.app/Contents/MacOS/Emacs $@ & + fi + } +else + alias e='emacsclient -n' fi + +ediff() { e --eval "(ediff-files \"$1\" \"$2\")"; }