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: Re: testing for a remote file to include file on a Windows mapped drive Date: Tue, 29 Apr 2008 03:50:28 -0400 Message-ID: References: <87bq781bf7.fsf@gmx.de> <000a01c8a314$5fff7630$0200a8c0@us.oracle.com> <000d01c8a324$97820590$0200a8c0@us.oracle.com> <000f01c8a334$b2a40660$0200a8c0@us.oracle.com> <000101c8a37f$eeb543d0$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1209455471 8877 80.91.229.12 (29 Apr 2008 07:51:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2008 07:51:11 +0000 (UTC) Cc: Eli Zaretskii , jasonr@gnu.org, drew.adams@oracle.com, emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 29 09:51:46 2008 connect(): Connection refused 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 1Jqkcm-0000st-5M for ged-emacs-devel@m.gmane.org; Tue, 29 Apr 2008 09:51:40 +0200 Original-Received: from localhost ([127.0.0.1]:45338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jqkc5-0002nL-Km for ged-emacs-devel@m.gmane.org; Tue, 29 Apr 2008 03:50:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jqkc0-0002nG-3R for emacs-devel@gnu.org; Tue, 29 Apr 2008 03:50:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jqkbx-0002n0-TG for emacs-devel@gnu.org; Tue, 29 Apr 2008 03:50:51 -0400 Original-Received: from [199.232.76.173] (port=43973 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jqkbx-0002mx-NH for emacs-devel@gnu.org; Tue, 29 Apr 2008 03:50:49 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jqkbn-0007WD-0U; Tue, 29 Apr 2008 03:50:40 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jqkbj-0005W7-07; Tue, 29 Apr 2008 03:50:36 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgEDAENwFkjO+JghdGdsb2JhbACBU496ASeaKg X-IronPort-AV: E=Sophos;i="4.25,721,1199682000"; d="scan'208";a="19570822" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 29 Apr 2008 03:50:29 -0400 Original-Received: from pastel.home ([206.248.152.33]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id JLB07029; Tue, 29 Apr 2008 03:50:29 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id B4F9281E8; Tue, 29 Apr 2008 03:50:28 -0400 (EDT) In-Reply-To: (Michael Albinus's message of "Tue, 22 Apr 2008 17:17:49 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by mx20.gnu.org: Error: This connection is not (no longer?) in the cache. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:96120 Archived-At: > I have available a checkout from April 7th. Scanning lisp/*, there are > 40 places file-remote-p is called. Let's not regard the 17 calls of > tramp*.el, they could be replaced simply by another, Tramp internal, > function. > From the other 23 calls, I would count 5 calls related to the question > "Is the access slow"; the other calls are due to the file name handler > thingies, which require another implementation of the respective > functionality. Looking at it again, I see that it is a bit less uniform than I remembered, indeed. > And, if you say that the calls of file-remote-p shall be replaced by > something else, which is closer to the file name handler > functionality: which function do you have in mind? Back in February, > you've spoken about file-local-name/unhandled-file-name. These > functions don't exist (yet). > Stefan, honestly: I don't understand why file-remote-p needs such a > redefinition. I assume there is a plan behind, which we don't know. > It would really be helpful if we could understand your intention of > this change. I have no idea which change you're talking about. I just have noticed several different concerns that tend to be conflated: - reliability and performance. - ability to access the file via syscalls. - whether relative file names can be used from one file name to another. - whether a file's contents is directly accessible via syscalls. The first is usually/always answered by calling `file-remote-p'. The second is sometimes answered by calling file-remote-p, although it does not give the right answer for /:/foo, and it clashes with the previous use of file-remote-p if you want to say that "file://" is not remote. A closer match for this is unhandled-file-name-directory, except that it historically didn't give useful information (it typically returned /tmp rather than nil for handled file names) and it only works for directories. The third is currently answered by file-remote-p. It's only used in file-relative-name, AFAIK, so it doesn't matter much where the info comes from, as long as file-relative-name is updated accordingly. In any case abusing file-remote-p for that seems like a bad idea. The last one is relevant for compressed files, encrypted files, and files extracted from tar/zip/ar/rar/... archives. This is usually answered by a bunch of ad-hoc tests listing all the situations of which the author was aware. E.g. it'll need update for auto-encryption-mode. We should introduce a new function for that. Something like unhandled-file-contents. OTOH unhandled-file-contents can only return non-nil if unhandled-file-name is non-nil, so maybe we should combine the two, and use an argument `contents' to indicate whether we only care about accessing the file (container) via syscalls or accessing also its contents. > One explanation, also in February, was that you want to have > (file-remote-p "file:///toto/titi") => nil > But with the same reasoning, you could say > (file-remote-p "/sudo:$USER@localhost:/toto/titi") => nil > And that doesn't work, IMHO. I don't have a strong opinion on "/sudo:$USER@localhost:/toto/titi": I think it would be OK to return nil, but non-nil is OK as well: access via sudo is probably slower and may even require user-input. I'm not sure why you say it wouldn't work to return nil for it. Stefan