diff options
author | Bob Williams <bobwilliams.ii@gmail.com> | 2014-03-14 10:32:03 -0400 |
---|---|---|
committer | Bob Williams <bobwilliams.ii@gmail.com> | 2014-03-14 10:32:03 -0400 |
commit | 223fd60ba597b8c23569c65878d766c3c933fa70 (patch) | |
tree | 33c5c6a150293e6cf81f26f0f1b9c733dcf8aab7 /plugins/emacs/emacsclient.sh | |
parent | 185cb6e37352cc0d92042e35d259b0de3f5f3886 (diff) | |
parent | ee21fe94473404b58cbaea5b2c279f7a07c34ce1 (diff) | |
download | zsh-223fd60ba597b8c23569c65878d766c3c933fa70.tar.gz zsh-223fd60ba597b8c23569c65878d766c3c933fa70.tar.bz2 zsh-223fd60ba597b8c23569c65878d766c3c933fa70.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'plugins/emacs/emacsclient.sh')
-rwxr-xr-x | plugins/emacs/emacsclient.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh new file mode 100755 index 000000000..38d419813 --- /dev/null +++ b/plugins/emacs/emacsclient.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +# 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. + emacsclient --alternate-editor "" "$@" +fi |