From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "A.Politz" Newsgroups: gmane.emacs.help Subject: Re: emacsclient frame reuse Date: Tue, 4 Aug 2009 15:18:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <1c9c248b-a2e4-441a-9bd7-5ca49bc7694c@c1g2000yqi.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1249425668 1789 80.91.229.12 (4 Aug 2009 22:41:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Aug 2009 22:41:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 05 00:41:02 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MYSgm-0007NY-PB for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Aug 2009 00:41:00 +0200 Original-Received: from localhost ([127.0.0.1]:44477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYSgm-00055K-8s for geh-help-gnu-emacs@m.gmane.org; Tue, 04 Aug 2009 18:41:00 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!t13g2000yqt.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: 84.59.96.228 Original-X-Trace: posting.google.com 1249424340 28660 127.0.0.1 (4 Aug 2009 22:19:00 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 4 Aug 2009 22:19:00 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t13g2000yqt.googlegroups.com; posting-host=84.59.96.228; posting-account=Cb0eCQoAAADOp8Qt5mU0s83Gs6qJzY70 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.11) Gecko/2009061208 Iceweasel/3.0.9 (Debian-3.0.9-1),gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:171571 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:66749 Archived-At: On Aug 4, 11:07=A0pm, jem wrote: > How can you detect if there is already a running frame with the newest > version? > > Thanks > > Jere > ~ #!/bin/sh EMACS=3Demacs-23.1 EMACSCLIENT=3Demacsclient-23.1 FLAGS=3D-n $EMACSCLIENT -e nil >/dev/null || $EMACS --daemon NR_FRAMES=3D$($EMACSCLIENT -e '(1- (length (frame-list)))') if [ $NR_FRAMES -eq 0 ];then FLAGS=3D"$FLAGS -c" fi $EMACSCLIENT $FLAGS "$@" There seems to be an invisible frame, representing the daemon or something.