help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacsclient frame reuse


From: jem
Subject: Re: emacsclient frame reuse
Date: Tue, 4 Aug 2009 17:40:06 -0700 (PDT)
User-agent: G2/1.0

On Aug 4, 8:22 pm, jem <jere.mcdev...@gmail.com> wrote:
> On Aug 4, 6:18 pm, "A.Politz" <poli...@googlemail.com> wrote:
>
>
>
> > On Aug 4, 11:07 pm, jem <jere.mcdev...@gmail.com> wrote:
>
> > > How can you detect if there is already a running frame with the newest
> > > version?
>
> > > Thanks
>
> > > Jere
> > > ~
>
> > #!/bin/sh
>
> > EMACS=emacs-23.1
> > EMACSCLIENT=emacsclient-23.1
> > FLAGS=-n
>
> > $EMACSCLIENT -e nil >/dev/null || $EMACS --daemon
>
> > NR_FRAMES=$($EMACSCLIENT -e '(1- (length (frame-list)))')
>
> > if [ $NR_FRAMES -eq 0 ];then
> >     FLAGS="$FLAGS -c"
> > fi
>
> > $EMACSCLIENT $FLAGS "$@"
>
> > There seems to be an invisible frame, representing the daemon or
> > something.
>
> Thanks, this works quite well.
>
> Jere

Had to make one minor change:

   (- 1 (length (frame-list)))

but otherwise it works great.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]