all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: jem <jere.mcdevitt@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: emacsclient frame reuse
Date: Tue, 4 Aug 2009 17:40:06 -0700 (PDT)	[thread overview]
Message-ID: <d72eaa47-8f2e-4a8e-a696-c0a97a18e8c4@18g2000yqa.googlegroups.com> (raw)
In-Reply-To: de3fc0a4-d2e1-4b23-84eb-22df639c3b64@j32g2000yqh.googlegroups.com

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	other threads:[~2009-08-05  0:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-04 21:07 emacsclient frame reuse jem
2009-08-04 22:18 ` A.Politz
2009-08-05  0:22   ` jem
2009-08-05  0:40     ` jem [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d72eaa47-8f2e-4a8e-a696-c0a97a18e8c4@18g2000yqa.googlegroups.com \
    --to=jere.mcdevitt@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.