From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23186: 25.0.92; Tramp: Windows does not always set COMSPEC, tramp blows up in a string-match Date: Sat, 02 Apr 2016 19:44:18 +0300 Message-ID: <8337r4rme5.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1459615522 27649 80.91.229.3 (2 Apr 2016 16:45:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Apr 2016 16:45:22 +0000 (UTC) Cc: 23186@debbugs.gnu.org To: Jerry Asher Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 02 18:45:10 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1amOfd-0004Hn-Se for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Apr 2016 18:45:10 +0200 Original-Received: from localhost ([::1]:50267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amOfc-0006R0-Uo for geb-bug-gnu-emacs@m.gmane.org; Sat, 02 Apr 2016 12:45:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amOfZ-0006Pd-97 for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 12:45:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amOfW-0007Wx-3V for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 12:45:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51913) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amOfW-0007Wt-0P for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 12:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1amOfV-0003bd-S8 for bug-gnu-emacs@gnu.org; Sat, 02 Apr 2016 12:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Apr 2016 16:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23186 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23186-submit@debbugs.gnu.org id=B23186.145961550013838 (code B ref 23186); Sat, 02 Apr 2016 16:45:01 +0000 Original-Received: (at 23186) by debbugs.gnu.org; 2 Apr 2016 16:45:00 +0000 Original-Received: from localhost ([127.0.0.1]:49040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amOfU-0003b8-3N for submit@debbugs.gnu.org; Sat, 02 Apr 2016 12:45:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1amOfS-0003av-B5 for 23186@debbugs.gnu.org; Sat, 02 Apr 2016 12:44:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amOfJ-0007Te-U8 for 23186@debbugs.gnu.org; Sat, 02 Apr 2016 12:44:53 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amOfJ-0007Ta-QM; Sat, 02 Apr 2016 12:44:49 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1425 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1amOfJ-00027l-4g; Sat, 02 Apr 2016 12:44:49 -0400 In-reply-to: (message from Jerry Asher on Sat, 2 Apr 2016 09:06:57 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115877 Archived-At: > From: Jerry Asher > Date: Sat, 2 Apr 2016 09:06:57 -0700 > > So here's the caveat, I have poked the emacs.exe image so that it does not start as a console app, but so > that it starts as a windows app. Now, I am not a windows developer, I do not know that this is why COMSPEC > has not been set, but boy, it's got to be, right? ? > > For more on how to poke the emacs.exe image to start as a windows app, see here > https://github.com/jerryasher/consoleAppToWin basically, doing so seems to make both ntemacs and cygwin > emacs run a bit nicer, and so far, this is the only issue I've seen crop up. > > Now, you might reasonably claim that since I am starting up emacs in a very non-standard unsupported > manner, the issue is totally mine and no fix is necessary. And there is some logic to that. > > Regardless, I would say the assumption that COMSPEC is always set and so therefore if it fails it is okay to > assign nil to tramp-encoding-shell knowing that later on it will be in a string-match is problematic in and of > itself. Tramp is designed to work with Emacs as released by the Emacs development team. That Emacs doesn't have this problem. I think it would be unreasonable for anyone to expect the Tramp maintainers to cater to arbitrary changes in the Emacs code or in how it is configured on Windows, let alone if you poke some addresses in the PE headers of the produced binary. > I don't know that my fix would fix those issues as well, but those issues point to a basic problem where > tramp-encoding-shell is set to nil and then later compared in string-match. Your fix is AFAIK incorrect because the directory where cmd.exe lives is not necessarily C:\Windows\system32. It just happens to be there on the particular system where you tried that. What is the full contents of the environment of the Emacs process when you run that zapped binary?