From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Davis Herring" Newsgroups: gmane.emacs.devel Subject: Re: Change in emacsclient behavior Date: Tue, 4 Sep 2007 16:08:24 -0700 (PDT) Message-ID: <59272.128.165.123.18.1188947304.squirrel@webmail.lanl.gov> References: <87veaw5ds5.fsf@baldur.tsdh.de> <87veatxcrz.fsf@jurta.org> Reply-To: herring@lanl.gov NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1188947446 13656 80.91.229.12 (4 Sep 2007 23:10:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2007 23:10:46 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Juri Linkov" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 05 01:10:41 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IShXZ-0002o3-8l for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2007 01:10:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IShXX-0008R3-M6 for ged-emacs-devel@m.gmane.org; Tue, 04 Sep 2007 19:10:35 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IShVW-0005jm-3S for emacs-devel@gnu.org; Tue, 04 Sep 2007 19:08:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IShVV-0005jS-Cm for emacs-devel@gnu.org; Tue, 04 Sep 2007 19:08:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IShVV-0005jO-6O for emacs-devel@gnu.org; Tue, 04 Sep 2007 19:08:29 -0400 Original-Received: from mailwasher.lanl.gov ([192.65.95.54] helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IShVU-0003DE-If for emacs-devel@gnu.org; Tue, 04 Sep 2007 19:08:28 -0400 Original-Received: from mailrelay3.lanl.gov (mailrelay3.lanl.gov [128.165.4.104]) by mailwasher-b.lanl.gov (8.13.8/8.13.6/(ccn-5)) with ESMTP id l84N8RWG016866; Tue, 4 Sep 2007 17:08:27 -0600 Original-Received: from webmail1.lanl.gov (webmail1.lanl.gov [128.165.4.106]) by mailrelay3.lanl.gov (8.13.8/8.13.8/(ccn-5)) with ESMTP id l84N8OXw004978; Tue, 4 Sep 2007 17:08:24 -0600 Original-Received: from webmail1.lanl.gov (localhost.localdomain [127.0.0.1]) by webmail1.lanl.gov (8.12.11.20060308/8.12.11) with ESMTP id l84N8ORG031476; Tue, 4 Sep 2007 17:08:24 -0600 Original-Received: (from apache@localhost) by webmail1.lanl.gov (8.12.11.20060308/8.12.11/Submit) id l84N8OXD031473; Tue, 4 Sep 2007 16:08:24 -0700 X-Authentication-Warning: webmail1.lanl.gov: apache set sender to herring@lanl.gov using -f Original-Received: from 128.165.123.18 (SquirrelMail authenticated user 196434) by webmail.lanl.gov with HTTP; Tue, 4 Sep 2007 16:08:24 -0700 (PDT) In-Reply-To: <87veatxcrz.fsf@jurta.org> User-Agent: SquirrelMail/1.4.8-6.el3.2lanl X-Priority: 3 (Normal) Importance: Normal X-CTN-5-MailScanner-Information: Please see http://network.lanl.gov/email/virus-scan.php X-CTN-5-MailScanner: Found to be clean X-CTN-5-MailScanner-From: herring@lanl.gov X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:77797 Archived-At: > 1. When invoked without arguments, display the current frame (-c uses the > current frame, but this could be customizable to display the initial frame > or any of existing frames). And if we're on a text link to a host that was previously running only graphical Emacs? It seems there that it would be much more useful to create a new tty frame where emacsclient was run. Reading the rest of this list, I come to the conclusion that what UI emacsclient should expose or create and what action it should take should be entirely decoupled (up to, perhaps, some reasonable default UIs for certain actions that are beyond the scope of this message). As a disclaimer, I am not an expert in old or new emacsclient, or multi-tty in general. However, it seems that a clean design for emacsclient can be had that supports (almost) all uses, from remote or local terminals. I have kept Emacs option names where they seemed relevant, but ignored extant emacsclient convention entirely. So here goes: For the UI, emacsclient can: 1. Create and become a tty for Emacs (with at least one frame). 2. Create and raise a graphical frame for Emacs on the current $DISPLAY. 3. Raise an existing graphical frame for Emacs on the current $DISPLAY, or elsewhere if no such exists. 4. Try to raise an existing frame, or create one if it doesn't exist. 5. Become a pipe for Emacs (which may or may not produce any terminal output). 2 and 4 should devolve to 1 if there is no suitable $DISPLAY available. These choices can be expressed as options. I'd put #4 as the default, and let --select give #3, --create give #2, -nw give #1, and -batch give #5. Then there is the question of what to do. Call the frame newly created or raised the "target" frame. 1. Do nothing (let the target frame show what it does or likes): no arguments 2. Visit some number of files (which may or may not create additional frames, depending on `pop-up-frames' and/or --select): file arguments, possibly with line/column numbers, etc. 3. Evaluate Lisp (in the target frame if not -batch; in some other frame (TBD) otherwise). In the case of #5, that Lisp gets `emacsclient-pipe' bound to a process object representing the pipe to emacsclient. This operation is selected by --eval or perhaps -f for a simple function call. Finally, of course, an emacsclient that does not become a tty or pipe (#2, #3, #4) may wait or not on some signal from Emacs that editing is done; whether the command that sends that signal destroys the frames that emacsclient created (if any) is a user option completely outside the scope of emacsclient. Davis -- This product is sold by volume, not by mass. If it appears too dense or too sparse, it is because mass-energy conversion has occurred during shipping.