From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: file-remote-p and its arguments Date: Wed, 30 Jan 2008 16:26:26 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1201728409 11312 80.91.229.12 (30 Jan 2008 21:26:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2008 21:26:49 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 30 22:27:08 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JKKSZ-0004XC-SI for ged-emacs-devel@m.gmane.org; Wed, 30 Jan 2008 22:27:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKKS8-0003QH-2E for ged-emacs-devel@m.gmane.org; Wed, 30 Jan 2008 16:26:40 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKKS2-0003O2-U1 for emacs-devel@gnu.org; Wed, 30 Jan 2008 16:26:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKKRx-0003Ky-7Y for emacs-devel@gnu.org; Wed, 30 Jan 2008 16:26:29 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKKRw-0003Kk-MC for emacs-devel@gnu.org; Wed, 30 Jan 2008 16:26:28 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JKKRw-0000N1-7N for emacs-devel@gnu.org; Wed, 30 Jan 2008 16:26:28 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHh6oEfO+J95dGdsb2JhbACQJgEwoAqBAg X-IronPort-AV: E=Sophos;i="4.25,280,1199682000"; d="scan'208";a="13421284" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 30 Jan 2008 16:26:26 -0500 Original-Received: from pastel.home ([206.248.159.121]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id KWE64826; Wed, 30 Jan 2008 16:26:26 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 438337FBC; Wed, 30 Jan 2008 16:26:26 -0500 (EST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:87803 Archived-At: 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/ and other such remote file systems, we'll need to update `file-relative-name'.