From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.help Subject: Re: making emacsclient create/destroy a frame Date: Tue, 14 Oct 2003 19:24:55 +0100 Organization: None Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1066156345 24498 80.91.224.253 (14 Oct 2003 18:32:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Oct 2003 18:32:25 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 14 20:32:23 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A9Ty3-0006fR-00 for ; Tue, 14 Oct 2003 20:32:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A9Twa-0005hM-Ps for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Oct 2003 14:30:52 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!ucberkeley!skynet.be!skynet.be!newsgate.cistron.nl!news2.euro.net!nntpfeed-01.ops.asmr-01.energis-idc.net!lightspeed.eweka.nl!62.45.52.242.MISMATCH!newsfeed.kabelfoon.nl!195.129.110.21.MISMATCH!bnewsfeed00.bru.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!lnewsinpeer00.lnd.ops.eu.uu.net!emea.uu.net!server1.netnews.ja.net!pegasus.csx.cam.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: xpc14.ast.cam.ac.uk X-Spook: BATF root-servers.net smuggle hack cray political ICBM X-Attribution: GM Mail-Copies-To: never User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) Cancel-Lock: sha1:AehkMLKteCrUqRxIpxZKniqTNhc= Original-Xref: shelby.stanford.edu gnu.emacs.help:117253 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13182 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13182 Roland Roberts wrote: > I'm trying to figure out a way to make "emacsclient FOO" create a new > frame for editing FOO, then have C-x # destroy the frame. It's > sort-of working.... > > > (delete-frame > (setq server-window (make-frame))) Oh, I didn't understand what this bit of code was for until now. > (defun rbr:server-done-hook () > (if (boundp 'server-window) > (delete-frame server-window))) > > (setq server-done-hook 'rbr:server-done-hook) > > Okay, the first thing is creating and destroying the initial frame is > kludgey beyond words, but once done makes server-switch-buffer do the > right thing. Does the following strike you as any less kludgey? (add-hook 'server-visit-hook '(lambda () (setq server-window (make-frame)))) (add-hook 'server-done-hook '(lambda () ;; Insert boundp safety test, etc, if being thorough. (delete-frame server-window) (setq server-window nil)))