From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David PONCE Newsgroups: gmane.emacs.devel Subject: Re: recentf-cleanup, file-readable-p & remote files Date: Thu, 18 Sep 2003 10:48:04 +0200 (CEST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <10995583.1063874884674.JavaMail.www@wwinf0401> Reply-To: david.ponce@wanadoo.fr NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1063875106 11632 80.91.224.253 (18 Sep 2003 08:51:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Sep 2003 08:51:46 +0000 (UTC) Cc: emacs-devel Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Sep 18 10:51:44 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19zuVs-0001Go-00 for ; Thu, 18 Sep 2003 10:51:44 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 19zuZn-0005Nl-00 for ; Thu, 18 Sep 2003 10:55:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19zuSs-0005fa-1x for emacs-devel@quimby.gnus.org; Thu, 18 Sep 2003 04:48:38 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 19zuSN-0005fA-TU for emacs-devel@gnu.org; Thu, 18 Sep 2003 04:48:07 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 19zuSM-0005eo-BX for emacs-devel@gnu.org; Thu, 18 Sep 2003 04:48:06 -0400 Original-Received: from [193.252.22.27] (helo=mwinf0403.wanadoo.fr) by monty-python.gnu.org with esmtp (Exim 4.22) id 19zuSM-0005eX-1B for emacs-devel@gnu.org; Thu, 18 Sep 2003 04:48:06 -0400 Original-Received: from wwinf0401 (wwinf0401 [172.22.135.28]) by mwinf0403.wanadoo.fr (SMTP Server) with ESMTP id A80855000356; Thu, 18 Sep 2003 10:48:04 +0200 (CEST) Original-To: harder@ifa.au.dk X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:16455 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:16455 Hi, > Ah, I think you misunderstood part of what I was trying to say -- > which is that `file-readable-p' can be very slow when you *are* > connected (when I'm not connected it returns in a fraction of second, > so that's not a problem) > > The reason is that that ange-ftp implements it rather inefficiently. > Instead of just listing the file in question it lists *all* files in > the directory. That's a lot of data if the directory contains > thousands of files. In the example from my previous post doing > `file-readable-p' is ~500 times slower than actually fetching the > file! OK, thank you for the explanation, I understand better now! Could you try file-exists-p please? Does it work better? A possibility could be to consider that remote files are always readable and change `recentf-file-readable-p' like this: (defsubst recentf-file-readable-p (filename) "Return t if file FILENAME exists and you can read it. Assume that remote files are always readable." (or (file-remote-p filename) (file-readable-p filename))) Remote files then could be manually removed from the recent list (M-x recentf-edit-list), or will be removed naturally by the LRU mechanism if they are not accessed for a long time (see the option `recentf-max-saved-items'). Perhaps, in your case, another acceptable workaround could be to disable the `recentf-auto-cleanup' feature (customize this option to `never'), and let the LRU mechanism eliminate files not accessed for a long time. Thoughts? David