diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/update-emacs-daemon-environment | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/update-emacs-daemon-environment b/bin/update-emacs-daemon-environment new file mode 100755 index 00000000..57a59f1b --- /dev/null +++ b/bin/update-emacs-daemon-environment @@ -0,0 +1,28 @@ +#!/bin/sh + +# Update Emacs daemon environment vars for a new interactive session. This +# allows us to have the Emacs daemon survive restarts of the graphical desktop +# environment, and to update Emacs on a remote host when there is a new +# forwarded SSH agent socket. +# +# Note that this will start the Emacs daemon if it not up already. + +which emacsclient >/dev/null || exit 0 + +for var in DISPLAY \ + SSH_ASKPASS \ + SSH_AUTH_SOCK \ + SSH_AGENT_PID \ + SSH_CONNECTION \ + WINDOWID \ + XAUTHORITY; do + eval isset=\${$var+x} + if [ "$isset" = "x" ]; then + eval value=\$$var + emacsclient -eval '(setenv "'$var'" "'$value'")' + fi +done + +# finally, also call a function which now updates the values in our Lisp image +# from Emacs' values (unimplemented) +# emacsclient -eval '(spw/update-lisp-image-environment)' |