From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jem Newsgroups: gmane.emacs.help Subject: emacsclient frame reuse Date: Tue, 4 Aug 2009 14:07:15 -0700 (PDT) Organization: http://groups.google.com Message-ID: <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: 7bit X-Trace: ger.gmane.org 1249446009 9883 80.91.229.12 (5 Aug 2009 04:20:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Aug 2009 04:20:09 +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 06:20: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 1MYXyr-0004kx-5c for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Aug 2009 06:20:01 +0200 Original-Received: from localhost ([127.0.0.1]:60975 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYXyq-0002oH-90 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Aug 2009 00:20:00 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!c1g2000yqi.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 54 Original-NNTP-Posting-Host: 66.241.32.158 Original-X-Trace: posting.google.com 1249420035 13700 127.0.0.1 (4 Aug 2009 21:07:15 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 4 Aug 2009 21:07:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c1g2000yqi.googlegroups.com; posting-host=66.241.32.158; posting-account=uQI20AoAAADpGc1FO8dUEAsKl32pIiX7 User-Agent: G2/1.0 X-HTTP-Via: 1.1 alaproxy01 (NetCache NetApp/6.0.4) X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.12) Gecko/2009070811 Ubuntu/9.04 (jaunty) Firefox/3.0.12, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:171569 X-Mailman-Approved-At: Wed, 05 Aug 2009 00:18:42 -0400 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:66756 Archived-At: I've been testing the new 23 build and the --daemon option and have a question how to get it to operate as I used to have gnuserv working. Here's the scenario -- I have running in the background an emacs instance using the --daemon flag. Now, I want to edit a new file in an X window frame so I have a script that will launch: emacsclient -c -n file This fires a new frame with the file and returns. Now I want to edit a second file, in the same frame. If I use the same command emacsclient -c -n file2 I get a new frame, where I wanted to share the previous frame. Instead I have to use emacsclient -n file2 to reuse the frame. If I don't have any running frames (either TTY or X) and use the emacsclient -n file command, there is a quick flash in the terminal then it goes away as the client assumes TTY and the process terminates. I would like to have a single script that I can invoke that will do the right thing. If there is no visible frame, use the -c option. If there is a visible frame do not use the -c option. The problem is, I can't find a way to determine if there is a visible frame. Because of the -n option, the previous emacsclient process has exited. In the older model with gnuserv I was able to add (setq gnuserv-frame (car (frame-list))) and my startup script looked like gunclient -n $@ 2>/dev/null if [ $? -ne 0 ] then emacs $@ & fi which would start emacs if not started (I loaded gnuserv in the init.el file) or connect to the existing one and share the frame. How can you detect if there is already a running frame with the newest version? Thanks Jere ~