emacs: use open frame if there is one present

Fixes #5779
Fixes #5405
This commit is contained in:
Marc Cornellà 2019-04-09 19:01:10 +02:00 committed by GitHub
parent b31106b341
commit cab1ac6e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ _emacsfun()
# get list of emacs frames.
frameslist=`emacsclient --alternate-editor '' --eval '(frame-list)' 2>/dev/null | egrep -o '(frame)+'`
if [ "$(echo "$frameslist" | sed -n '$=')" -ge 2 ] ;then
if [ "$(echo "$frameslist" | sed -n '$=')" -ge 1 ] ;then
# prevent creating another X frame if there is at least one present.
emacsclient --alternate-editor "" "$@"
else