[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23186: closed (Re: bug#23186: 25.0.92; Tramp: Windows does not alway

From: Jerry Asher
Subject: bug#23186: closed (Re: bug#23186: 25.0.92; Tramp: Windows does not always set COMSPEC, tramp blows up in a string-match)
Date: Sat, 2 Apr 2016 10:50:14 -0700

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.

We are ALREADY talking about a very specific setting IN emacs FOR Windows. God forbid we should ask the maintainers to discuss how emacs is configured on Windows in that context.

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.

And I agree, setting the variable to nil where it is guaranteed to blow up, and is reported to do so as my search shows is FAR FAR better than finding a reasonable default that will work most of the time.

On Sat, Apr 2, 2016 at 10:37 AM, Jerry Asher <address@hidden> wrote:
Your bug closing excuse is defamatory, there were no personal attacks on you. 

There was criticism of your behavior and how you examine and respond to bug reports. None of that constitutes a personal attack on you.

Your closing a bug report that describes a valid bug because you dislike how the conversation you initiated went, is support for my criticism of how you respond to bug reports.

On Sat, Apr 2, 2016 at 10:32 AM, Jerry Asher <address@hidden> wrote:
Heh, a bug report is a bug report REGARDLESS of how you felt you were treated.

Since you started off your response to me 

+ disparaging my bug report
+ misrepresenting what I said
+ summarizing it inaccurately
+ dismissing the evidence

You received in kind a report filled with frustration.

I can just see other people closing bug reports that discuss a clearly documented and widely reported bug as seen by google searches with responses like "I felt reporter was mean to me so I closed this bug report."


On Sat, Apr 2, 2016 at 10:28 AM, GNU bug Tracking System <address@hidden> wrote:
Your bug report

#23186: 25.0.92; Tramp: Windows does not always set COMSPEC, tramp blows up in a string-match

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to address@hidden.

23186: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23186
GNU Bug Tracking System
Contact address@hidden with problems

---------- Forwarded message ----------
From: Eli Zaretskii <address@hidden>
To: address@hidden
Date: Sat, 02 Apr 2016 20:26:41 +0300
Subject: Re: 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
> From: Eli Zaretskii <address@hidden>
> Cc: address@hidden
> What is the full contents of the environment of the Emacs process when
> you run that zapped binary?

Since the OP refused to answer even the above simplest question, and
instead sent off-list a hostile email with personal attacks on me, I'm
closing this bug report.

---------- Forwarded message ----------
From: Jerry Asher <address@hidden>
To: address@hidden
Date: Sat, 2 Apr 2016 09:06:57 -0700
Subject: 25.0.92; Tramp: Windows does not always set COMSPEC, tramp blows up in a string-match

--text follows this line--

I started the 64 bit version of windows emacs from a shortcut on my taskbar. I
created the shortcut a few minutes ago by running emacs from the command
line, then pinning the shortcut. (There is a big caveat and I'll discuss
that at the end.)

Starting emacs up in restoring my desktop it loaded a python file. That
python file triggered python mode. Somewhere in there, ...

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("cmd\\.exe" nil)
  (if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c")
  eval((if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c"))
  custom-initialize-reset(tramp-encoding-command-switch (if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c"))
  custom-declare-variable(tramp-encoding-command-switch (if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c") "Use this switch together with `tramp-encoding-shell' for local commands.\nSee the variable `tramp-encoding-shell' for more information." :group tramp :type string)
  byte-code("\300\301!\210\302\303\304\305\306\307\306\310\311\312\313\314& \210\315\316\317\320\306\303\321\322& \210\315\323\324\325\306\303\321\326& \210\327\330!\203:

I believe the problem is in tramp.el which assumes that COMSPEC has been set.

(defcustom tramp-encoding-shell
  (if (memq system-type '(windows-nt))
      (getenv "COMSPEC")

The problem is that Windows can sometimes (see caveat below) start emacs such that COMSPEC is not defined.

I think perhaps a fix would be something along the lines of:

(defcustom tramp-encoding-shell
  (if (memq system-type '(windows-nt))
      (or (getenv "COMSPEC")
          (concat (getenv "systemroot") "\\system32\\cmd.exe"))

I'm not a windows developer, but it seems that modulo the systemroot, the system32\cmd.exe path is always (?) the right path.

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. 

But I've seen other users report the basic cmd.exe tramp-encoding-shell string match problem, see:


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.

So why not assign tramp-encoding-shell a default that will probably work instead?


Jerry Asher

In GNU Emacs (x86_64-w64-mingw32)
 of 2016-03-03 built on KAEL
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --prefix=/tmp/emacs --without-imagemagick 'CFLAGS=-O2
 -fomit-frame-pointer -g0''

Configured features:

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  shell-dirtrack-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Mark saved where search started
Mark set
Unable to load color "peach"
Mark set [3 times]
Mark saved where search started [2 times]
Unable to load color "peach" [2 times]

Load-path shadows:
c:/Users/Jerry/.emacs.d/user-library/loaddefs hides c:/gnu/emacs-bin-w64-25.0.92-O2/emacs/share/emacs/25.0.92/lisp/loaddefs
c:/Users/Jerry/Dropbox/elpa/seq-2.15/seq hides c:/gnu/emacs-bin-w64-25.0.92-O2/emacs/share/emacs/25.0.92/lisp/emacs-lisp/seq
c:/gnu/emacs-bin-w64-25.0.92-O2/emacs/share/emacs/25.0.92/lisp/emacs-lisp/cl-generic hides c:/Users/Jerry/Dropbox/elpa/cl-generic-0.2/cl-generic

(shadow sort mail-extr emacsbug message rfc822 mml mml-sec epg mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils thingatpt find-or-tag
find-func dired-aux dired misearch multi-isearch vc vc-dispatcher vc-git
diff-mode easy-mmode warnings tramp-compat auth-source gnus-util mm-util
help-fns mail-prsvr password-cache tramp-loaddefs trampver ucs-normalize
shell pcomplete format-spec advice json map ido seq seq-25 grep compile
files-x etags xref project eieio byte-opt bytecomp byte-compile cl-extra
help-mode cconv eieio-core cus-edit wid-edit projectile-init
paredit-init package-sync-init nssh-mode-init neotree-init
multiple-cursor-init modeline-tweaks markdown-init magit-init
_javascript_-init find-or-tag-init expand-region-init edmacro kmacro
eldoc-init dired-init dev-requires desktop-init cygwin-init cygwin-mount
ange-ftp comint ansi-color ring basic-defuns.el cl-seq cl-macs gv
cl-loaddefs pcase cl-lib amazon-tweaks update-auto-loads utf-coding
required-libraries print-list key-bindings finder-inf slime-autoloads
info package easymenu epg-config time cus-start cus-load time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
w32notify dbusbind w32 multi-tty make-network-process emacs)

Memory information:
((conses 16 369391 18287)
 (symbols 56 30368 0)
 (miscs 48 160 430)
 (strings 32 54134 10687)
 (string-bytes 1 1555262)
 (vectors 16 45846)
 (vector-slots 8 806255 5532)
 (floats 8 306 365)
 (intervals 56 11467 2656)
 (buffers 976 28))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]