[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
file-remote-p and its arguments
From: |
Stefan Monnier |
Subject: |
file-remote-p and its arguments |
Date: |
Wed, 30 Jan 2008 16:26:26 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
Currently file-remote-p accepts two optional arguments:
IDENTIFICATION specifies which part of the identification shall
be returned as string. IDENTIFICATION can be the symbol
`method', `user' or `host'; any other value is handled like nil
and means to return the complete identification string.
If CONNECTED is non-nil, the function returns an identification only
if FILE is located on a remote system, and a connection is established
to that remote system.
>From what I can tell, the `connected' argument is *never* used.
And I have found only one use of the `identification' argument, if
grep.el where it seems not to be necessary: grep.el passes `host' for
that argument in order to build a map from hosts to default grep
commands and arguments, on the assumption that all users on a host will
have the same grep commands in their PATH. I think this "optimization"
in grep.el (where they determine the grep defaults once per host instead
of once per remote access method (typically a triplet of
protocol/user/host)) is of no importance and is even not 100% reliable.
So I suggest:
1 - remove the `connected' argument of file-remote-p.
2 - change grep.el not to pass `host' as `identification' argument to
file-remote-p.
3 - remove the `identification' argument to file-remote-p.
Stefan
PS: If we want to make file-remote-p return non-nil for /afs/<foo> and
other such remote file systems, we'll need to update `file-relative-name'.
- file-remote-p and its arguments,
Stefan Monnier <=