From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dhruva Newsgroups: gmane.emacs.devel Subject: Re: emacsclient on WXP does not work (as it used to) Date: Fri, 31 Oct 2008 18:22:19 +0530 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1225457861 18869 80.91.229.12 (31 Oct 2008 12:57:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2008 12:57:41 +0000 (UTC) Cc: Eli Zaretskii , emacs-devel@gnu.org To: "Juanma Barranquero" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 31 13:58:43 2008 connect(): Connection refused 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 1Kvta8-0000MF-QV for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2008 13:58:31 +0100 Original-Received: from localhost ([127.0.0.1]:46552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvtYx-0007bb-9z for ged-emacs-devel@m.gmane.org; Fri, 31 Oct 2008 08:57:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KvtUQ-0006E0-Lm for emacs-devel@gnu.org; Fri, 31 Oct 2008 08:52:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KvtUN-0006CH-0X for emacs-devel@gnu.org; Fri, 31 Oct 2008 08:52:34 -0400 Original-Received: from [199.232.76.173] (port=56648 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KvtUM-0006CC-TE for emacs-devel@gnu.org; Fri, 31 Oct 2008 08:52:30 -0400 Original-Received: from ti-out-0910.google.com ([209.85.142.190]:32759) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KvtUH-0002eP-Ec; Fri, 31 Oct 2008 08:52:26 -0400 Original-Received: by ti-out-0910.google.com with SMTP id u5so646911tia.10 for ; Fri, 31 Oct 2008 05:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=GEMYvt+9BTFmuUC4vi3KH9LZMuVCNY5QEzfXbd/+IZs=; b=ROg7owr1Id+jsNOUmVxTddlOFnPNEldfKXuaL8Y9ogbRc42xM2fHsMheTn8OLAApl7 DGE0+uKgXYKXXO6mYsnWnL4Or7r0kbrj2BuD2Lc9629VD3FK0NZFh5RFx6sEDO5sxdqq ExIKddc4G8fFfXQuUmMWAosu4REuxB/76RJt4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=w1lx4c+3/3uAjDyaU+JNuWAAasosUbImhW+mbj5/bYNWMObQ0jt4p1DvV5EaRqAtpO krx4QIzQF9yWx6Tqw47TSOwrGYeiajBQ9RKHfod8w33N1uIY6AbDUCMWk3Up6DdQMc+i ADx8mBO+TxRW2ojcuvFGzQ1k1fQWZveHggM+8= Original-Received: by 10.110.57.6 with SMTP id f6mr8375633tia.46.1225457539368; Fri, 31 Oct 2008 05:52:19 -0700 (PDT) Original-Received: by 10.110.93.2 with HTTP; Fri, 31 Oct 2008 05:52:19 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:105195 Archived-At: That was premature, it does not work.. I apologise for that. On Fri, Oct 31, 2008 at 6:16 PM, dhruva wrote: > The following patch fixes this issue since tty and TERM does not make > sense on windows (a wild guess though) ... > > diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c > index 0bbc385..0452cb3 100644 > --- a/lib-src/emacsclient.c > +++ b/lib-src/emacsclient.c > @@ -1446,7 +1446,6 @@ main (argc, argv) > char *tty_name = NULL; > #ifndef WINDOWSNT > tty_name = ttyname (fileno (stdout)); > -#endif > > if (! tty_name) > { > @@ -1468,15 +1467,19 @@ main (argc, argv) > " is not supported\n", progname); > fail (); > } > +#endif > + > #if !defined (NO_SOCKETS_IN_FILE_SYSTEM) > init_signals (); > #endif > > +#ifndef WINDOWSNT > send_to_emacs (emacs_socket, "-tty "); > quote_argument (emacs_socket, tty_name); > send_to_emacs (emacs_socket, " "); > quote_argument (emacs_socket, type); > send_to_emacs (emacs_socket, " "); > +#endif > } > > if (window_system) > > On Fri, Oct 31, 2008 at 5:57 PM, Juanma Barranquero wrote: >> On Fri, Oct 31, 2008 at 12:15, Eli Zaretskii wrote: >> >>> Can you please explain why is this a problem on Windows? I understand >>> that the addition of current_frame to the `if' clause causes it to be >>> entered on Windows, whereas it wasn't before, but how does that, and >>> the fact that tty_name is NULL, cause emacsclient failure reported by >>> dhruva? >> >> I don't know why dhruva got the "connect" error message. My guess is >> that they are two different problems: >> >> 1.- emacsclient opened the socket (so no INVALID_SOCKET), but couldn't connect >> 2.- emacsclient couldn't get the terminal name, and it didn't have >> alternate-editor >> >> though I don't know how or why 2) would happen, unless there were two >> different emacsclients involved, called through alternate-editor (and >> even so, it doesn't make much sense). >> >> But anyway, my point was just that the very next code after the if() is >> >> char *type = egetenv ("TERM"); >> char *tty_name = NULL; >> #ifndef WINDOWSNT >> tty_name = ttyname (fileno (stdout)); >> #endif >> >> if (! tty_name) >> { >> message (TRUE, "%s: could not get terminal name\n", progname); >> fail (); >> } >> >> so entering the if() is *always* going to fail(). I'm unable to see >> how that be useful on Windows. >> >>> Agreed (to the ``ugly'' part). >> >> Glad we agree on this :) >> >> Have you any comment about the other part? ("Are there legitimate uses >> of tty == 1 on Windows?") >> >>> I'd like to try to find a less ugly fix. >> >> It's Chong's patch, perhaps he can shed a bit of light. >> >> Juanma >> > > > > -- > Contents reflect my personal views only! > -- Contents reflect my personal views only!