From c451ff4bf317188da20bfe18021a93640d54133b Mon Sep 17 00:00:00 2001 From: Jan Ehrhardt Date: Mon, 24 Mar 2014 12:10:18 +0100 Subject: [PATCH] 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. --- plugins/emacs/emacsclient.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 38d41981..625201a1 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