From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#1267: Emacsclient can't find terminal in daemon mode Date: Wed, 29 Oct 2008 19:39:05 -0400 Message-ID: <87zlknvuna.fsf@cyd.mit.edu> References: <87r660gw33.fsf@cyd.mit.edu> <200810292306.m9TN6fE0017904@mothra.ics.uci.edu> Reply-To: Chong Yidong , 1267@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1225324221 28011 80.91.229.12 (29 Oct 2008 23:50:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Oct 2008 23:50:21 +0000 (UTC) Cc: 1267@emacsbugs.donarmstrong.com To: Dan Nicolaescu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 30 00:51:22 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KvKos-000170-5P for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 Oct 2008 00:51:22 +0100 Original-Received: from localhost ([127.0.0.1]:41300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvKnl-0000xN-Op for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Oct 2008 19:50:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvKni-0000xI-Pf for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2008 19:50:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvKng-0000x6-Bx for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2008 19:50:09 -0400 Original-Received: from [199.232.76.173] (port=56050 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvKng-0000x3-5i for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2008 19:50:08 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:38712) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KvKnf-0004AT-KS for bug-gnu-emacs@gnu.org; Wed, 29 Oct 2008 19:50:07 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9TNo3Oq008968; Wed, 29 Oct 2008 16:50:03 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9TNj3ml007758; Wed, 29 Oct 2008 16:45:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 29 Oct 2008 23:45:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1267 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1267-submit@emacsbugs.donarmstrong.com id=B1267.12253235426425 (code B ref 1267); Wed, 29 Oct 2008 23:45:03 +0000 Original-Received: (at 1267) by emacsbugs.donarmstrong.com; 29 Oct 2008 23:39:02 +0000 Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9TNcxAl006409 for <1267@emacsbugs.donarmstrong.com>; Wed, 29 Oct 2008 16:39:00 -0700 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 8986857E0BE; Wed, 29 Oct 2008 19:39:05 -0400 (EDT) In-Reply-To: <200810292306.m9TN6fE0017904@mothra.ics.uci.edu> (Dan Nicolaescu's message of "Wed, 29 Oct 2008 16:06:41 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Wed, 29 Oct 2008 19:50:09 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:22016 Archived-At: Dan Nicolaescu writes: > In you particular emacsly Emacs uses the "initial frame" to show the > file, which is probably not ideal. > This particular case can be solved by trying to see if the > `(selected-frame)' is FRAME_INITIAL_P (which is not exposed to elisp). > We can guess that if there's no window-system and tty-type frame > parameter we are dealing with the initial frame. > > Not sure if this is good enough to cover all possible cases... The patch you sent won't work on a text-only terminal. I think a better approach is to change emacsclient so that it sends the tty name/type if it is supposed to "use the current frame" (normally, it doesn't do this unless the -t option is provided). Then, the Emacs server should check whether it can actually use the current frame; if not, it tries X; if that fails, it falls back on using the tty specified by emacsclient.