all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Jordan Wilson <jordan.t.wilson@gmx.com>
Cc: 33791@debbugs.gnu.org
Subject: bug#33791: 26.1; Eshell on Windows connecting to GNU/Linux machine using TRAMP and plink: env: ‘c:/home/jordan/test.sh’: No such file or directory
Date: Sat, 29 Dec 2018 10:14:05 +0100	[thread overview]
Message-ID: <87wonsr8yq.fsf@gmx.de> (raw)
In-Reply-To: <87bm55tpvc.fsf@gmx.com> (Jordan Wilson's message of "Fri, 28 Dec 2018 19:25:59 +0000")

Jordan Wilson <jordan.t.wilson@gmx.com> writes:

Hi Jordan,

>> Can you provide a reproducing recipe starting from "emacs -Q"?
>
> - Have putty in $PATH (version 0.70 on my machine)
> - Load Eli's/Michael's patched files.el (error appears regardless)
>     (load "files.el")
> - M-x eshell
> - connect to GNU/Linux machine using plink:
>       /plink:jordan@domain.com:/home/jordan/
> - run executable in working directory
>       ./test.sh
> returns "env: ‘c:/home/jordan/test.sh’: No such file or directory"

I've tried to reproduce the problem with

--8<---------------cut here---------------start------------->8---
GNU Emacs 27.0.50 (build 1, x86_64-w64-mingw32)
 of 2018-10-05
--8<---------------cut here---------------end--------------->8---

This is the Emacs version offered on <https://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-27/>.

The error does not happen. Likely, this is due to the following commit:

--8<---------------cut here---------------start------------->8---
commit bbcd5787cb077f8b6c4eba5c1704ad953a298fd7
Author: Michael Albinus <michael.albinus@gmx.de>
Date:   Thu Mar 22 09:58:56 2018 +0100

    Fix commit c24c5dc4a4
    
    * lisp/net/tramp.el (tramp-handle-substitute-in-file-name): Drop volume
    letter of localname substitution.  Reported by Chris Zheng
    <chriszheng99@gmail.com>.
--8<---------------cut here---------------end--------------->8---

What happens, if you redefine tramp-handle-substitute-in-file-name after
loading Tramp?

--8<---------------cut here---------------start------------->8---

(defun tramp-handle-substitute-in-file-name (filename)
  "Like `substitute-in-file-name' for Tramp files.
\"//\" and \"/~\" substitute only in the local filename part."
  ;; Check, whether the local part is a quoted file name.
  (if (tramp-compat-file-name-quoted-p filename)
      filename
    ;; First, we must replace environment variables.
    (setq filename (tramp-replace-environment-variables filename))
    (with-parsed-tramp-file-name filename nil
      ;; We do not want to replace environment variables, again.  "//"
      ;; has a special meaning at the beginning of a file name on
      ;; Cygwin and MS-Windows, we must remove it.
      (let (process-environment)
	;; Ignore in LOCALNAME everything before "//" or "/~".
	(when (stringp localname)
	  (if (string-match "//\\(/\\|~\\)" localname)
	      (setq filename
                    (replace-regexp-in-string
                     "\\`/+" "/" (substitute-in-file-name localname)))
	    (setq filename
		  (concat (file-remote-p filename)
			  (replace-regexp-in-string
                           "\\`/+" "/"
			   ;; We must disable cygwin-mount file name
			   ;; handlers and alike.
			   (tramp-run-real-handler
			    'substitute-in-file-name (list localname))))))))
      ;; "/m:h:~" does not work for completion.  We use "/m:h:~/".
      (if (and (stringp localname) (string-equal "~" localname))
	  (concat filename "/")
	filename))))
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.





  parent reply	other threads:[~2018-12-29  9:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 15:00 bug#33791: 26.1; Eshell on Windows connecting to GNU/Linux machine using TRAMP and plink: env: ‘c:/home/jordan/test.sh’: No such file or directory Jordan Wilson
2018-12-22  9:23 ` Eli Zaretskii
2018-12-22 10:25   ` Michael Albinus
2018-12-22 10:38     ` Eli Zaretskii
2018-12-22 12:35       ` Michael Albinus
2018-12-22 14:36         ` Eli Zaretskii
2018-12-22 15:54       ` Jordan Wilson
2018-12-23 12:40       ` Jordan Wilson
2018-12-23 15:58         ` Eli Zaretskii
2018-12-23 16:42           ` Michael Albinus
2018-12-23 16:51             ` Eli Zaretskii
2018-12-27 13:33           ` Michael Albinus
2018-12-28  8:15             ` Eli Zaretskii
2018-12-28 17:23               ` Jordan Wilson
2018-12-28 18:48                 ` Eli Zaretskii
2018-12-28 19:25                   ` Jordan Wilson
2018-12-29  9:10                     ` Eli Zaretskii
2018-12-29  9:25                       ` Michael Albinus
2018-12-29 10:00                         ` Eli Zaretskii
2018-12-29 11:12                           ` Michael Albinus
2018-12-29 13:43                             ` Jordan Wilson
2018-12-29 14:19                               ` Michael Albinus
2018-12-29 15:36                             ` Eli Zaretskii
2018-12-29  9:14                     ` Michael Albinus [this message]
2018-12-29  8:18             ` Eli Zaretskii
2018-12-29  8:38               ` Michael Albinus
2018-12-29  9:48                 ` Eli Zaretskii
2018-12-29 10:40                   ` Michael Albinus
2018-12-22 15:45   ` Jordan Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wonsr8yq.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=33791@debbugs.gnu.org \
    --cc=jordan.t.wilson@gmx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.