From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: emacsclient's option decoding code Date: Thu, 13 Nov 2008 06:10:49 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1226549470 27543 80.91.229.12 (13 Nov 2008 04:11:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2008 04:11:10 +0000 (UTC) Cc: lekktu@gmail.com, cyd@stupidchicken.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 13 05:12:10 2008 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 1L0TYw-0004qS-Cx for ged-emacs-devel@m.gmane.org; Thu, 13 Nov 2008 05:12:10 +0100 Original-Received: from localhost ([127.0.0.1]:52201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0TXo-0002Oz-8F for ged-emacs-devel@m.gmane.org; Wed, 12 Nov 2008 23:11:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0TXY-0002Kv-Ok for emacs-devel@gnu.org; Wed, 12 Nov 2008 23:10:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0TXX-0002KW-V1 for emacs-devel@gnu.org; Wed, 12 Nov 2008 23:10:44 -0500 Original-Received: from [199.232.76.173] (port=55614 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0TXX-0002KR-Ij for emacs-devel@gnu.org; Wed, 12 Nov 2008 23:10:43 -0500 Original-Received: from mtaout2.012.net.il ([84.95.2.4]:29589) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0TXX-0002iC-ML for emacs-devel@gnu.org; Wed, 12 Nov 2008 23:10:43 -0500 Original-Received: from conversion-daemon.i_mtaout2.012.net.il by i_mtaout2.012.net.il (HyperSendmail v2004.12) id <0KA9003007FU4R00@i_mtaout2.012.net.il> for emacs-devel@gnu.org; Thu, 13 Nov 2008 06:12:32 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.205.49]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KA9006MS7OV2VA0@i_mtaout2.012.net.il>; Thu, 13 Nov 2008 06:12:32 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 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:105623 Archived-At: > From: Stefan Monnier > Cc: lekktu@gmail.com, cyd@stupidchicken.com, emacs-devel@gnu.org > Date: Wed, 12 Nov 2008 15:56:25 -0500 > > > But this is guesswork at best, and cannot possibly DTRT in every > > possible use-case, because emacsclient have no way of knowing what the > > Emacs server can or cannot do. > > Some of the decisions could benefit from being moved to/from the client > from/to the server, indeed. > But returning an error if the user requests something that can't be done > is often better than trying to be clever. I don't see why erroring out is better. > > . if --display=DISPLAY was specified, try the given DISPLAY, if that > > fails, try ":0.0", if that fails, try using a tty; > > :0.0 may be miles away from the user's eyes, so if $DISPLAY fails, > better signal an error and let the user manually switch to :0.0 if > that's what he wants to do. If :0.0 is miles away, there's no difference between an error and display miles away: in both cases, the user needs to fix something and reinvoke. What I suggest is better because if :0.0 is NOT miles away, it does TRT, while erroring does not. > It might be OK to provide an option to do that, but silently doing so > without the user's constent may be worse than signalling an error and > letting *her* switch to the appropriate tty. We do it today already, with the kind of guesswork we have in emacsclient.