a183bcbc6d8d61bd9c1077b45d1c5b3239e96a71

Author
Tristan Carel <tristan.carel@gmail.com>
Committer
Tristan Carel <tristan.carel@gmail.com>
Date

Message

More comments

Diff

 1diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh
 2index bca79e70e67989d30e6ec81c1ce575e6fb67ea8f..62d9fbccc72bd2fe3aa84c889aeafeed425e72ea 100644
 3--- a/plugins/emacs/emacs.plugin.zsh
 4+++ b/plugins/emacs/emacs.plugin.zsh
 5@@ -1,11 +1,30 @@
 6-# Use daemon capabilities of emacs 23
 7+# Emacs 23 daemon capability is a killing feature.
 8+# One emacs process handles all your frames whether
 9+# you use a frame opened in a terminal via a ssh connection or X frames 
10+# opened on the same host.
11+
12+# Benefits are multiple
13+# - You don't have the cost of starting Emacs all the time anymore
14+# - Opening a file is as fast as Emacs does not have anything else to do.
15+# - You can share opened buffered across opened frames.
16+# - Configuration changes made at runtime are applied to all frames.
17+
18+
19 if "$ZSH/tools/require_tool.sh" emacs 23 2>/dev/null ; then
20     export EDITOR="$ZSH/plugins/emacs/emacsclient.sh"
21     alias emacs="$EDITOR --no-wait"
22     alias e=emacs
23 
24+    # same than M-x eval but from outside Emacs.
25+    alias eeval="emacs --eval"
26+    # create a new X frame
27+    alias eframe='emacsclient --alternate-editor "" --create-frame'
28+
29+    # to code all night long
30     alias emasc=emacs
31     alias emcas=emacs
32-    # create a new X frame
33-    alias emacs_frame='emacsclient --alternate-editor "" --create-frame'
34 fi
35+
36+## Local Variables:
37+## mode: sh
38+## End:
39diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh
40index 3475926a61aa44a6405c15913898f7da12d993d2..b098fd24ad49ee3190bb5f9f877390cf0ce5ab58 100755
41--- a/plugins/emacs/emacsclient.sh
42+++ b/plugins/emacs/emacsclient.sh
43@@ -6,5 +6,6 @@ x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
44 if [ -z "$x" ] ;then
45     emacsclient --alternate-editor "" --create-frame $@
46 else
47+    # prevent creating another X frame if there is at least one present.
48     emacsclient --alternate-editor "" $@
49 fi