diff options
Diffstat (limited to '.config/bash/rc.d')
-rw-r--r-- | .config/bash/rc.d/emacs.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/.config/bash/rc.d/emacs.sh b/.config/bash/rc.d/emacs.sh index b402932..354c8f3 100644 --- a/.config/bash/rc.d/emacs.sh +++ b/.config/bash/rc.d/emacs.sh @@ -5,12 +5,13 @@ if [[ $TERM == eterm* ]]; then EDITOR=$SELECTED_EDITOR VISUAL=$SELECTED_EDITOR export SELECTED_EDITOR EDITOR VISUAL + export PAGER=cat ## Primatives for interacting with Emacs ############################### # _emacs_run LISP _emacs_run() { - emacsclient -f "$HOME/.emacs.d/server-$HOSTNAME/server" -e "$*" 2>/dev/null + emacsclient -f "$HOME/.emacs.d/server-$HOSTNAME/server" -a false -e "$*" 2>/dev/null } # _emacs_quote UNQUOTED_STRING _emacs_quote() { @@ -85,6 +86,7 @@ if [[ $TERM == eterm* ]]; then # Set the shell's X11 display (emacs -> shell) _emacs_set_shell_DISPLAY() { export DISPLAY=$(_emacs_unquote "$(_emacs_run "(cdr (assoc 'display (frame-parameters)))")") + [[ $DISPLAY != nil ]] || unset DISPLAY } ## Do those things ##################################################### @@ -94,5 +96,7 @@ if [[ $TERM == eterm* ]]; then _emacs_set_remote_dir _emacs_set_shell_DISPLAY } - PROMPT_COMMAND=_emacs_PROMPT_COMMAND + if _emacs_run '()' >/dev/null; then + PROMPT_COMMAND=_emacs_PROMPT_COMMAND + fi fi |