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

* Re: file-remote-p and its arguments
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2008-01-31  9:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> From what I can tell, the `connected' argument is *never* used.

`recentf-keep-default-predicate'. The reasoning is in
<http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00416.html>

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

It's less than an "optimization", it is just a kludge to let grep
work also on remote hosts. The decision might be to either complete
the implementation, or to throw away this feature.

>         Stefan

Best regards, Michael.





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

* Re: file-remote-p and its arguments
  2008-01-31  9:43 ` Michael Albinus
@ 2008-01-31 14:49   ` Stefan Monnier
  2008-01-31 15:49     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2008-01-31 14:49 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

>> From what I can tell, the `connected' argument is *never* used.
> `recentf-keep-default-predicate'.

Indeed, thanks, I missed it.

> The reasoning is in
> <http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00416.html>

I see.  It does make sense :-(

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

> It's less than an "optimization", it is just a kludge to let grep
> work also on remote hosts. The decision might be to either complete
> the implementation, or to throw away this feature.

This one I do not understand: using (file-remote-p file) for this
purpose would work just as well as (file-remote-p file 'host),
wouldn't it?


        Stefan




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

* Re: file-remote-p and its arguments
  2008-01-31 14:49   ` Stefan Monnier
@ 2008-01-31 15:49     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2008-01-31 15:49 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> It's less than an "optimization", it is just a kludge to let grep
>> work also on remote hosts. The decision might be to either complete
>> the implementation, or to throw away this feature.
>
> This one I do not understand: using (file-remote-p file) for this
> purpose would work just as well as (file-remote-p file 'host),
> wouldn't it?

Yes (IIRC, code not checked).

>         Stefan

Best regards, Michael.





^ 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).