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.
This commit is contained in:
soredake
2016-07-19 01:20:59 +03:00
committed by Marc Cornellà
parent d0610931db
commit eb244d9ec0
2 changed files with 9 additions and 10 deletions

View File

@ -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
}