summary refs log tree commit diff stats
path: root/tag-zsh
diff options
context:
space:
mode:
Diffstat (limited to 'tag-zsh')
-rwxr-xr-xtag-zsh/config/zsh/zshrc6
1 files changed, 3 insertions, 3 deletions
diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc
index 9d2da84e..451f2121 100755
--- a/tag-zsh/config/zsh/zshrc
+++ b/tag-zsh/config/zsh/zshrc
@@ -341,14 +341,14 @@ emacs_change_focus () {
 }
 
 ec () {
-	local visibleFrames
-	visibleFrames=`emacsclient -e '(length (visible-frame-list))'`
+	local frameNeeded
+	frameNeeded=`emacsclient -e '(>= (if (daemonp) 2 1) (length (visible-frame-list)))'`
 	if [[ $? -ne 0 ]]; then
 		print "Daemon not running"
 		return 1
 	fi
 
-	if [[ $visibleFrames -eq 1 ]]; then
+	if [[ $frameNeeded == 't' ]]; then
 		emacsclient -n -c "$@" && emacs_change_focus
 	else
 		emacs_change_focus