Browse Source

Fix EDITOR environment variable issue for emacs

Have programs using the $EDITOR environment variable use emacsclient if
a daemon is running but otherwise fallback to plain emacs.

See: http://www.emacswiki.org/emacs/EmacsAsDaemon

Signed-off-by: Collin J. Doering <rekahsoft@gmail.com>
master
2 changed files with 7 additions and 2 deletions
  1. +4
    -1
      .bashrc
  2. +3
    -1
      .zshrc

+ 4
- 1
.bashrc View File

@@ -66,4 +66,7 @@ fi
#eval `keychain --eval --timeout 10 --quiet --agents ssh id_rsa`

# Default editor
export EDITOR="emacs -nw"
export ALTERNATE_EDITOR=""
export EDITOR="emacsclient -t" # $EDITOR should open in terminal
export VISUAL="emacsclient -c -a emacs" # $VISUAL opens in GUI with non-daemon as alternate


+ 3
- 1
.zshrc View File

@@ -99,4 +99,6 @@ fi
#eval `keychain --eval --timeout 10 --quiet --agents ssh id_rsa`

# Default editor
export EDITOR="emacs -nw"
export ALTERNATE_EDITOR=""
export EDITOR="emacsclient -t" # $EDITOR should open in terminal
export VISUAL="emacsclient -c -a emacs" # $VISUAL opens in GUI with non-daemon as alternate

Loading…
Cancel
Save