summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-09-30 09:00:37 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-09-30 22:34:19 -0700
commit56f668ec94d02884062b6bcaa4c6a02a1dd16e69 (patch)
treeaac4f49e1b810a9427127fcbdb028414f2ac35c6
parent8752999091271b8651931052da39f16b19ecacc0 (diff)
downloaddotfiles-56f668ec94d02884062b6bcaa4c6a02a1dd16e69.tar.gz
~/.shenv: simplify setting EDITOR & VISUAL
-rwxr-xr-x.shenv22
1 files changed, 8 insertions, 14 deletions
diff --git a/.shenv b/.shenv
index c6879f0e..3258adaf 100755
--- a/.shenv
+++ b/.shenv
@@ -16,21 +16,15 @@ else
ec_opt="-t"
fi
-# Either GNU Emacs, or UNIX vi -- lightweight Emacs alternatives like
-# mg and zile are so rarely installed, so let's have a constant
-# fallback which is almost certainly available and which I can use
-# well enough. When GNU Emacs is available, set ALTERNATE_EDITOR to
-# the empty string so that an `emacs --daemon` process is spawned
-if [ -e "$HOME/src/emacs/admin/flagfile.melete" \
- -a -x "$HOME/src/emacs/lib-src/emacsclient" \
- -a -d "/usr/share/emacs-snapshot/site-lisp/elpa" ]; then
- EDITOR="$HOME/src/emacs/lib-src/emacsclient $ec_opt"
- ALTERNATE_EDITOR=""
- export ALTERNATE_EDITOR
-elif command -v emacsclient >/dev/null; then
+# Either GNU Emacs, or UNIX vi -- lightweight Emacs alternatives like mg and
+# zile are so rarely installed, so let's have a constant fallback which is
+# almost certainly available and which I can use well enough.
+#
+# Rely on my ~/src/dotfiles/bin/emacsclient wrapper to start up an Emacs
+# daemon: don't bother setting ALTERNATE_EDITOR. Check that there's an Emacs
+# on (as yet unmodified) PATH, else that wrapper might fail.
+if command -v emacs >/dev/null; then
EDITOR="emacsclient $ec_opt"
- ALTERNATE_EDITOR=""
- export ALTERNATE_EDITOR
else
EDITOR="vi"
fi