From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacsclient bug Date: Wed, 06 Feb 2008 12:29:15 -0500 Message-ID: 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 1202319030 22910 80.91.229.12 (6 Feb 2008 17:30:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 Feb 2008 17:30:30 +0000 (UTC) Cc: Dan Nicolaescu , lenbok@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Sascha Wilde Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 06 18:30:51 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 1JMo6R-00067i-6r for ged-emacs-devel@m.gmane.org; Wed, 06 Feb 2008 18:30:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMo5y-00088W-B6 for ged-emacs-devel@m.gmane.org; Wed, 06 Feb 2008 12:30:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMo5U-0007v2-TB for emacs-devel@gnu.org; Wed, 06 Feb 2008 12:29:32 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMo5T-0007u9-Et for emacs-devel@gnu.org; Wed, 06 Feb 2008 12:29:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMo5T-0007u0-6T for emacs-devel@gnu.org; Wed, 06 Feb 2008 12:29:31 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMo5H-0004Xh-N9; Wed, 06 Feb 2008 12:29:27 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAO58qUfO+J95dGdsb2JhbACQMgEwnHyBAA X-IronPort-AV: E=Sophos;i="4.25,313,1199682000"; d="scan'208";a="13767369" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 06 Feb 2008 12:29:15 -0500 Original-Received: from pastel.home ([206.248.159.121]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id MTJ69515; Wed, 06 Feb 2008 12:29:15 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 43A027FD7; Wed, 6 Feb 2008 12:29:15 -0500 (EST) In-Reply-To: (Sascha Wilde's message of "Thu, 31 Jan 2008 18:15:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:88346 Archived-At: > 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. 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. Stefan