summaryrefslogtreecommitdiff
path: root/plugins/emacs
diff options
context:
space:
mode:
authorTristan Carel <tcarel@exalead.com>2011-10-10 18:04:13 +0200
committerTristan Carel <tcarel@exalead.com>2011-10-10 18:04:13 +0200
commit3a408f326f1436a81ae481610c76c8938903df4f (patch)
tree9176d2ccbbe184f670a9eaa71dd3f76e7676f91a /plugins/emacs
parentdb90589c8a02e98e657af17bb0b460b752d9ed61 (diff)
downloadzsh-3a408f326f1436a81ae481610c76c8938903df4f.tar.gz
zsh-3a408f326f1436a81ae481610c76c8938903df4f.tar.bz2
zsh-3a408f326f1436a81ae481610c76c8938903df4f.zip
Comment
Diffstat (limited to 'plugins/emacs')
-rwxr-xr-xplugins/emacs/emacsclient.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh
index 7fc2ad202..38d419813 100755
--- a/plugins/emacs/emacsclient.sh
+++ b/plugins/emacs/emacsclient.sh
@@ -1,9 +1,10 @@
#!/bin/sh
-# Starts emacs daemon if not already started.
-
+# get list of available X windows.
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
+
if [ -z "$x" ] ;then
+ # Create one if there is no X window yet.
emacsclient --alternate-editor "" --create-frame "$@"
else
# prevent creating another X frame if there is at least one present.