From 97a0d713317036d773df6476f8ae47a1e423276f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 4 Jan 2019 10:18:06 +1300 Subject: Further attempts at sane Emacs VISUAL setting --- sh/profile.d/visual.sh | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'sh') diff --git a/sh/profile.d/visual.sh b/sh/profile.d/visual.sh index f79158b8..d5280abd 100644 --- a/sh/profile.d/visual.sh +++ b/sh/profile.d/visual.sh @@ -1,24 +1,8 @@ -# If an Emacs is installed, and ~/.emacs exists, use emacs as the visual -# editor; otherwise, use the system's vi -if command -v emacs >/dev/null 2>&1 && - [ -f "$HOME"/.emacs ] ; then - - # Use or start a GNU Emacs client, if possible - if command -v pgrep >/dev/null 2>&1 && - pgrep -fxu "$USER" 'emacs --daemon' >/dev/null || - emacs --daemon 2>/dev/null ; then - VISUAL=emacsclient - - # If no GNU Emacs daemon is available, just create a new instance every - # time - else - VISUAL=emacs - fi - -# If an Emacs isn't installed, just use good old vi +# If my Emacs wrapper is installed, use emacs as the visual editor; otherwise, +# use the system's vi +if command -v emacsm >/dev/null 2>&1 ; then + VISUAL='emacsm' else - VISUAL=vi + VISUAL='vi' fi - -# Export final editor decision export VISUAL -- cgit v1.2.3