From 43f45210630f6491b52af46bc7e85693a3961709 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 13 May 2011 11:05:26 -0400 Subject: Make it so that editor can be called without a filename or other argument --- .bash.d/emacs.sh | 3 --- .profile | 1 + .selected_editor | 1 + bin/v-editor | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.bash.d/emacs.sh b/.bash.d/emacs.sh index b3c5c53..66b5558 100644 --- a/.bash.d/emacs.sh +++ b/.bash.d/emacs.sh @@ -1,8 +1,5 @@ case "$SELECTED_EDITOR" in emacsclient*) - if [ -n "$DISPLAY" ]; then - export VISUAL="$SELECTED_EDITOR -c" - fi case "$TERM" in eterm*) SELECTED_EDITOR="$SELECTED_EDITOR -n" diff --git a/.profile b/.profile index 8808917..07fa59a 100644 --- a/.profile +++ b/.profile @@ -25,6 +25,7 @@ fi if [ -f "$HOME/.selected_editor" ]; then . "$HOME/.selected_editor" export SELECTED_EDITOR + export ALTERNATE_EDITOR export EDITOR="${EDITOR:-$SELECTED_EDITOR}" export VISUAL="${VISUAL:-$SELECTED_EDITOR}" fi diff --git a/.selected_editor b/.selected_editor index 095d9cf..1bb91d9 100644 --- a/.selected_editor +++ b/.selected_editor @@ -1,2 +1,3 @@ # Generated by /usr/bin/select-editor SELECTED_EDITOR="emacsclient -a ''" +ALTERNATE_EDITOR="$SELECTED_EDITOR -c" \ No newline at end of file diff --git a/bin/v-editor b/bin/v-editor index dc141bc..86d1f50 100755 --- a/bin/v-editor +++ b/bin/v-editor @@ -1,7 +1,7 @@ #!/bin/sh -if [ -n "$DISPLAY" ]; then +(if [ -n "$DISPLAY" ]; then ${VISUAL:-$SELECTED_EDITOR} $@ else ${EDITOR:-$SELECTED_EDITOR} $@ -fi +fi) || ${ALTERNATE_EDITOR:-false} $@ \ No newline at end of file -- cgit v1.1-4-g5e80