From 54ba76d88ce39db80c7c3dbcac4fb9dbfcf032a5 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 11 Dec 2014 16:15:57 -0800 Subject: [PATCH] Fix editor once and for all by using editor.sh file. --- dotfiles/lib/editor.sh | 2 ++ dotfiles/lib/shellenv/emacs.sh | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100755 dotfiles/lib/editor.sh diff --git a/dotfiles/lib/editor.sh b/dotfiles/lib/editor.sh new file mode 100755 index 00000000..fac0e444 --- /dev/null +++ b/dotfiles/lib/editor.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env zsh +[ -z "$*" ] && emacs || emacs_open "$@" diff --git a/dotfiles/lib/shellenv/emacs.sh b/dotfiles/lib/shellenv/emacs.sh index b6924a28..2f00a33d 100644 --- a/dotfiles/lib/shellenv/emacs.sh +++ b/dotfiles/lib/shellenv/emacs.sh @@ -77,7 +77,6 @@ function time_emacs { } # Make emacs the default editor. -export EDITOR="e() { zsh -c 'emacs_open '"'"$@"; return 0; }; e' +export EDITOR="$HOME/.lib/editor.sh" export VISUAL="$EDITOR" -# This is ugly as sin but I can't figure out how else to do it. -export GIT_EDITOR="zsh -c 'emacs_open '"'"$@"; return 0' +export GIT_EDITOR="$EDITOR"