all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: jordan.t.wilson@gmx.com, 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 12:12:56 +0100	[thread overview]
Message-ID: <87d0pkr3gn.fsf@gmx.de> (raw)
In-Reply-To: <83a7ko64au.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 29 Dec 2018 12:00:25 +0200")

[-- Attachment #1: Type: text/plain, Size: 3261 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli & Jordan,

>> As you see, it requires two changes, in esh-proc.el and tramp.el.
>
> I think both can be cherry-picked to emacs-26.

Done. The change in tramp.el needed some massage.

Jordan, could you pls test whether the changes I have applied to the
emacs-26 branch work for you? See attachment for the changes.

> But do you know why we need expand-file-name here at all?

Well, in Emacs 26 we couldn't adapt exec-path for remote
processes. This is available since Emacs 27 only.

> At the very least, the comment about start-process should be removed,
> I think.

Done.

>> > Btw, isn't it confusing that start-file-process needs only the "local"
>> > part of COMMAND?  Why cannot its handler DTRT internally instead?
>> 
>> What do you do, if COMMAND is another remote location than
>> default-directory?
>
> Why is that a problem?  We always run the process in
> default-directory, right?

I said "another *remote* location". I don't want to see

(let ((default-directory "/ssh:user@host:directory"))
  (start-file-process "foo" buffer
  "/ssh:another-user@another-host:foo"))

Of course one could raise an error. But usually, this construct doesn't
appear as direct as in the example.

I believe using a local name for PROGRAM isn't such a burden.

>> And more general, there could also be file names in the PROGRAM-ARGS
>> part of start-file-process. Who decides, which of them is a remote file
>> name to be stripped to the local part, and which offers remote file name
>> syntax to be used literally?
>
> the caller, of course.  But I'm not asking about arguments, I'm asking
> about PROGRAM, and only about it.

See above. I don't believe it would make the life easier for callers of
`start-file-process', if we would allow a remote file name for PROGRAM. 

>> That's why we have decided (long ago), to not allow remote arguments for
>> both start-file-process and process-file.
>
> At the very least, this should be prominently mentioned in the
> respective doc strings and in the ELisp manual.  As written now, this
> is entirely undocumented.  Moreover, the part about "the local part of
> default-directory" in the doc string and in the manual is confusing,
> because we have no description of what that means.  The only attempt
> of describing it, in file-local-name's doc string, viz.:
>
>   It returns a file name which can be used directly as argument of
>   ‘process-file’, ‘start-file-process’, or ‘shell-command’.
>
> is IMO unsatisfactory, because it describes how results could be used,
> not what they are.

The docstring speaks about.

--8<---------------cut here---------------start------------->8---
PROGRAM and PROGRAM-ARGS might be file names.  They are not
objects of file name handler invocation.
--8<---------------cut here---------------end--------------->8---

The Elisp manual speaks about. (info "(elisp) Asynchronous Processes")

--8<---------------cut here---------------start------------->8---
This function does not try to invoke file name handlers for PROGRAM
or for the rest of ARGS.
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.


[-- Attachment #2: Type: text/plain, Size: 1445 bytes --]

diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index 94401c5daa..97170eb04b 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -279,11 +279,9 @@ eshell-gather-process-output
 	    (let ((process-connection-type
 		   (unless (eshell-needs-pipe-p command)
 		     process-connection-type))
-		  (command (file-local-name command)))
+		  (command (file-local-name (expand-file-name command))))
 	      (apply 'start-file-process
-		     (file-name-nondirectory command) nil
-		     ;; `start-process' can't deal with relative filenames.
-		     (append (list (expand-file-name command)) args))))
+		     (file-name-nondirectory command) nil command args)))
       (eshell-record-process-object proc)
       (set-process-buffer proc (current-buffer))
       (if (eshell-interactive-output-p)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5fa9f9a44d..5302659b32 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4580,10 +4580,11 @@ tramp-eshell-directory-change
 	       (or
 		;; When `tramp-own-remote-path' is in `tramp-remote-path',
 		;; the remote path is only set in the session cache.
+                ;; Use `path-separator' as it does eshell.
 		(tramp-get-connection-property
 		 (tramp-get-connection-process v) "remote-path" nil)
 		(tramp-get-connection-property v "remote-path" nil))
-	       ":"))
+	       path-separator))
 	  (getenv "PATH"))))
 
 (eval-after-load "esh-util"

  reply	other threads:[~2018-12-29 11:12 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 [this message]
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
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=87d0pkr3gn.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=33791@debbugs.gnu.org \
    --cc=eliz@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.