[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A few documentation issues, and a question
From: |
Michael Albinus |
Subject: |
Re: A few documentation issues, and a question |
Date: |
Wed, 04 Oct 2017 11:51:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) |
Clément Pit-Claudel <address@hidden> writes:
> Hi all,
Hi Clément,
> tramp-find-executable says this:
>
> "Searches for PROGNAME in $PATH and all directories mentioned in DIRLIST.
> […]
> Returns the absolute file name of PROGNAME, if found, and nil otherwise. […]"
>
> But when a program in in the PATH, tramp returns the program name
> prefixed with a backslash instead:
>
> (tramp-find-executable "sh")
> ⇒ "\\sh"
The reason behind is to suppress aliases for the commands. There were
problems in the past, when somebody has aliased for example "ls".
Of course, one could send "unalias -a" at the very beginning, but this
might be annoying for users who want to use their aliases in interactive
shells.
> This wouldn't be much of an issue, except for the fact that this
> syntax isn't compatible with tramp-sh-process-file-handler (it quotes
> the program name). Which one is right? The docs, or the behavior (I'd
> vote for fixing the behavior :)
Do you have an example for this?
> (Btw, is that check with `which \%s | wc -w` right? Wouldn't it break
> if the program can be found in a directory that contains a space?)
Yes, this could be a problem. Do you expect to happen this in real life?
> Another doc bug:
>
> tramp-tramp-file-p says:
>
> "Return t if NAME is a string with Tramp file name syntax."
>
> but it returns an int, not t. Maybe it should use string-match-p
> instead of string-match?
string-match-p didn't exist, when this function was written aeons
ago. And it also returns a natnum. I've fixed this. Committed to the
Tramp and Emacs (branch emacs-26) repositories.
> Thanks!
> Clément.
Best regards, Michael.