summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-09-08 19:13:46 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-09-08 19:13:46 -0400
commit1a36a4497f417f008c9a5e19fcbdfc30f813db17 (patch)
tree047c09e64ee8c5922372586ebdcb626c2ed3af97
parent43db73a86f57829558ae85f1945c9aa65eab8edc (diff)
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')
-rw-r--r--.gitignore2
-rw-r--r--Makefile22
-rw-r--r--e.sh2
-rw-r--r--emacsterm.sh19
4 files changed, 36 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index ea20e2a..7cee854 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,5 @@ hangman
sysfiles
daemon
emacsmail
+emacsterm
+e
diff --git a/Makefile b/Makefile
index e33f078..59161c0 100644
--- a/Makefile
+++ b/Makefile
@@ -6,20 +6,22 @@ RM = rm -f
BINFILES = \
arg \
- ord \
- urldecode \
- roll \
- v-www-browser \
- v-editor \
- whatismyip \
chardiff \
chardiff_pre \
chardiff_post \
- newegg \
+ daemon \
+ e \
+ emacsmail \
+ emacsterm \
hangman \
+ newegg \
+ ord \
+ roll \
sysfiles \
- daemon \
- emacsmail
+ urldecode \
+ v-www-browser \
+ v-editor \
+ whatismyip
all: build .gitignore
@@ -41,6 +43,8 @@ clean:
cat $< >$@
chmod a+x $@
+# Note that this rule would be way simpler if I could count on 'arg'
+# already being installed ("arg '*~' $(BINFILES) > $@")
.gitignore: Makefile
echo '*~' > $@
for file in $(BINFILES); do echo "$$file"; done >> $@
diff --git a/e.sh b/e.sh
new file mode 100644
index 0000000..ba97edc
--- /dev/null
+++ b/e.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+emacsclient -a "" -e "$@" 2>/dev/null
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)'