From eb244d9ec03a5f83102efa89d8d2231282f3c408 Mon Sep 17 00:00:00 2001 From: soredake Date: Tue, 19 Jul 2016 01:20:59 +0300 Subject: Update emacs plugin. (#5201) - Updated minimal version from 23 to 24. - Added new aliases that fix unexpected close with -nw option. - Removed some old aliases. - Fixed line that detects open frames. --- plugins/emacs/emacsclient.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/emacs/emacsclient.sh') diff --git a/plugins/emacs/emacsclient.sh b/plugins/emacs/emacsclient.sh index 41682512d..26b28d495 100755 --- a/plugins/emacs/emacsclient.sh +++ b/plugins/emacs/emacsclient.sh @@ -2,15 +2,15 @@ _emacsfun() { - # get list of available X windows. - x=`emacsclient --alternate-editor '' --eval '(x-display-list)' 2>/dev/null` + # get list of emacs frames. + frameslist=`emacsclient --alternate-editor '' --eval '(frame-list)' 2>/dev/null | egrep -o '(frame)+'` - if [ -z "$x" ] || [ "$x" = "nil" ] ;then - # Create one if there is no X window yet. - emacsclient --alternate-editor "" --create-frame "$@" - else + if [ "$(echo "$frameslist" | sed -n '$=')" -ge 2 ] ;then # prevent creating another X frame if there is at least one present. emacsclient --alternate-editor "" "$@" + else + # Create one if there is no X window yet. + emacsclient --alternate-editor "" --create-frame "$@" fi } -- cgit v1.2.3-70-g09d2