From 27c017fe0991a28f6a326cf32bdf1e8b11a539a8 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 25 Jun 2014 10:51:43 +0100 Subject: zsh: Generalise ec function to work outside daemon --- tag-zsh/config/zsh/zshrc | 6 +++--- 1 file 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 -- cgit 1.4.1