summaryrefslogtreecommitdiff
path: root/.config/bash/rc.d/emacs.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/bash/rc.d/emacs.sh')
-rw-r--r--.config/bash/rc.d/emacs.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/.config/bash/rc.d/emacs.sh b/.config/bash/rc.d/emacs.sh
index 165d71e..bb6454b 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 -e "$*" 2>/dev/null
+ emacsclient -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