summaryrefslogtreecommitdiff
path: root/emacsterm.sh
diff options
context:
space:
mode:
Diffstat (limited to 'emacsterm.sh')
-rw-r--r--emacsterm.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/emacsterm.sh b/emacsterm.sh
new file mode 100644
index 0000000..ac3e186
--- /dev/null
+++ b/emacsterm.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# emacs-xterm-handler
+
+cmd=${SHELL?/bin/sh}
+set -- $(getopt -n $0 -o e -- "$@")
+if [ $? -ne 0 ]; then
+ echo "Usage $0 [-e CMD]" >> /dev/stderr
+fi
+
+for o do
+ case "$o" in
+ -e) shift; cmd=$1; shift;;
+ esac
+done
+
+elisp_expr="(emacs-terminal-emulator \"$cmd\")"
+
+emacsclient -a "" -c -n --eval "$elisp_expr" \
+ '(set-window-dedicated-p (selected-window) t)'