summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Ehrhardt <jan.ehrhardt@gmail.com>2014-03-24 12:10:18 +0100
committerJan Ehrhardt <jan.ehrhardt@gmail.com>2014-03-24 12:10:18 +0100
commitc451ff4bf317188da20bfe18021a93640d54133b (patch)
tree757cf614be74a5fde603832cc7c5de745e495325
parentffc17b6b4d55f74b9d3786ba790b7340865e5014 (diff)
downloadzsh-c451ff4bf317188da20bfe18021a93640d54133b.tar.gz
zsh-c451ff4bf317188da20bfe18021a93640d54133b.tar.bz2
zsh-c451ff4bf317188da20bfe18021a93640d54133b.zip
Add check for display list equals nil
Emacs returns either a sequence of availbale displays or nil. Checking nil fixes this script to work as expected.
-rwxr-xr-xplugins/emacs/emacsclient.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh
index 38d419813..625201a16 100755
--- a/plugins/emacs/emacsclient.sh
+++ b/plugins/emacs/emacsclient.sh
@@ -3,7 +3,7 @@
# get list of available X windows.
x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null`
-if [ -z "$x" ] ;then
+if [ -z "$x" ] || [ "$x" = "nil" ] ;then
# Create one if there is no X window yet.
emacsclient --alternate-editor "" --create-frame "$@"
else