From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: emacsclient bug Date: Wed, 06 Feb 2008 09:40:33 -0800 Message-ID: <200802061740.m16HeX90025576@sallyv1.ics.uci.edu> References: <200801271541.m0RFfGE6016267@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1202320016 26693 80.91.229.12 (6 Feb 2008 17:46:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Feb 2008 17:46:56 +0000 (UTC) Cc: Sascha Wilde , lenbok@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 06 18:47:13 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 1JMoMZ-0004dX-1U for ged-emacs-devel@m.gmane.org; Wed, 06 Feb 2008 18:47:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMoM6-00041I-OO for ged-emacs-devel@m.gmane.org; Wed, 06 Feb 2008 12:46:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMoJc-0002Gs-JX for emacs-devel@gnu.org; Wed, 06 Feb 2008 12:44:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMoJb-0002Fh-IF for emacs-devel@gnu.org; Wed, 06 Feb 2008 12:44:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMoJb-0002FL-CS for emacs-devel@gnu.org; Wed, 06 Feb 2008 12:44:07 -0500 Original-Received: from sallyv1.ics.uci.edu ([128.195.1.109]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.60) (envelope-from ) id 1JMoJX-0000Ca-CV; Wed, 06 Feb 2008 12:44:03 -0500 X-ICS-MailScanner-Watermark: 1202924434.1092@ADSRWOas0eEt5/FZhTCrag Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by sallyv1.ics.uci.edu (8.13.7+Sun/8.13.7) with ESMTP id m16HeX90025576; Wed, 6 Feb 2008 09:40:33 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Wed, 06 Feb 2008 12:29:15 -0500") Original-Lines: 38 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) 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:88347 Archived-At: Stefan Monnier writes: > > emacsclient -d $DISPLAY -c > > works, but this is very annoying, because there are many situations > > where emacsclient is handy but determining the current display is not so > > easy. > > > For example I use the ViewSourceWith Firefox extension, with emacsclient > > as editor and `-c $f' as parameters, ($f is expanded by the plugin). > > How did you do it with Emacs-22? > > The -c argument is not very clearly specified: it just says "use a new > frame", so if the current Emacs frame is on a tty, creating a new frame > on that same tty seems like a correct choice. > > If you don't want tty frames, then maybe you shouldn't start your Emacs > server on a tty? > > Of course, if your Emacs server has both X11 and tty frames, then "-c" > will arbitrarily open either a tty frame or an X11 frame depending on > which frame happens to be selected when the emacsclient connects to it. Given that, taking into account the current frame when emacsclient connects does not seem like a good idea. > Maybe there should be some kind of affinity: look at the emacsclient > context (its tty and its $DISPLAY setting) and then look for an existing > frame (or terminal) that is "similar" (same tty or same $DISPLAY). > This would remove/reduce the "arbitrary" part of the behavior. IMO: - if -c is given, and $DISPLAY is present in the emacsclient environment (-d is not on the command line), then it should be equivalent to -c -d $DISPLAY - if $DISPLAY is not present, then it should be equivalent to -t