unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* file-remote-p and its arguments
@ 2008-01-30 21:26 Stefan Monnier
  2008-01-31  9:43 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2008-01-30 21:26 UTC (permalink / raw)
  To: emacs-devel


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'.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-01-31 15:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-30 21:26 file-remote-p and its arguments Stefan Monnier
2008-01-31  9:43 ` Michael Albinus
2008-01-31 14:49   ` Stefan Monnier
2008-01-31 15:49     ` Michael Albinus

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).