summaryrefslogtreecommitdiff
path: root/emacsterm.sh
blob: ac3e186ad0dae7014838475b30d70af32e4fc3d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)'