From 1a36a4497f417f008c9a5e19fcbdfc30f813db17 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 8 Sep 2011 19:13:46 -0400 Subject: Add e and emacsterm, two emacs utitlities. * e evaluates some emacslisp, * emacsterm launches an x-terminal-emulator in emacs (requires the emacs function 'emacs-terminal-emulator') --- emacsterm.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 emacsterm.sh (limited to 'emacsterm.sh') 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)' -- cgit v1.2.3