Browse code

Add new plugin emacs, to take benefit of daemon capabilities of emacs >=23

Tristan Carel authored on 13/04/2011 at 15:34:51
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+# Use daemon capabilities of emacs 23
1
+if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
2
+    export EDITOR="$ZSH/plugins/emacs/emacsclient.sh"
3
+    alias emacs="$EDITOR --no-wait"
4
+    alias e=emacs
5
+
6
+    alias emasc=emacs
7
+    alias emcas=emacs
8
+    # create a new X frame
9
+    alias emacs_frame='emacsclient --alternate-editor "" --create-frame'
10
+fi
0 11
new file mode 100755
... ...
@@ -0,0 +1,10 @@
0
+#!/bin/sh
1
+
2
+# Starts emacs daemon if not already started.
3
+
4
+x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
5
+if [ -z "$x" ] ;then
6
+    emacsclient --alternate-editor "" --create-frame $@
7
+else
8
+    emacsclient --alternate-editor "" $@
9
+fi