From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Revisit: recentf-cleanup, file-readable-p & remote files Date: Fri, 11 Mar 2005 14:32:37 -0800 (PST) Message-ID: <20050311223237.55871.qmail@web60302.mail.yahoo.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1110581084 19342 80.91.229.2 (11 Mar 2005 22:44:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 11 Mar 2005 22:44:44 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 11 23:44:44 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D9srz-0006uK-L4 for ged-emacs-devel@m.gmane.org; Fri, 11 Mar 2005 23:44:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D9t79-0000Rl-N7 for ged-emacs-devel@m.gmane.org; Fri, 11 Mar 2005 18:00:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D9t2Z-0005rl-5S for emacs-devel@gnu.org; Fri, 11 Mar 2005 17:55:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D9t02-000561-7H for emacs-devel@gnu.org; Fri, 11 Mar 2005 17:53:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D9t01-00051Y-AQ for emacs-devel@gnu.org; Fri, 11 Mar 2005 17:52:53 -0500 Original-Received: from [216.109.118.113] (helo=web60302.mail.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1D9sgP-0005Yb-Ie for emacs-devel@gnu.org; Fri, 11 Mar 2005 17:32:37 -0500 Original-Received: (qmail 55873 invoked by uid 60001); 11 Mar 2005 22:32:37 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=iZOhSdauzBGYlUfMxW0aB8SmBGCEnwQxSckWkZfQILmzBe86lhqWPVsNRkWBbCF4J4pvXWgaA9kkiBO9G7QtJSDW2A4GeXDzdqpGl6+lDDDjxE2FjOfk+G1B5VqPtDhFh7I1L6nQyGDbvjGrQUattsYwxIgZfm1qAEo3rz/RzV4= ; Original-Received: from [158.171.31.17] by web60302.mail.yahoo.com via HTTP; Fri, 11 Mar 2005 14:32:37 PST Original-To: Emacs Devel 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 X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34493 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34493 Not to drag up old discussions, but I was reviewing some old patches that I still use. Back in Sep 2003, a request was made to exclude remote files from the automatic cleanup process that recentf.el runs when it is enabled. The discussion ended forking off into a discussion of performance of Tramp and detecting network connectivity. I am now in a situation where about half of the files I edit are local and the remainder are on a remote Unix server. I appreciate the automatic cleanup of files on the recentf list and would like to leave that feature in place. Unfortunately the time to connect to the badly overloaded server and checking files there has gotten painful. Having the remote filenames on the recentf list is valuable (thus I don't want to place remote files on the recentf-exclude list). What I would like to be able to do is just not check these remote files as part of the auto cleanup process. Below is a simple patch which adds a customizable flag indicating whether remote files should be cleaned up. This flag is then checked before checking the status of a remote file. The default is to check remote files, thus behavior is unchanged. I've been using this patch for a year without problems. 2005-03-11 Michael R. Mauger * recentf.el (recentf-cleanup-remote): New variable. Should remote files be cleaned up? (recentf-cleanup): Use variable to conditionally check availablity of remote files. Index: emacs/lisp/recentf.el =================================================================== RCS file: /c/cvsroot/emacs/emacs/lisp/recentf.el,v retrieving revision 1.30 diff -u -r1.30 recentf.el --- emacs/lisp/recentf.el 20 Apr 2004 20:54:53 -0000 1.30 +++ emacs/lisp/recentf.el 9 Jun 2004 20:38:01 -0000 @@ -255,6 +255,11 @@ If it returns nil, the filename is left unchanged." :group 'recentf :type 'function) + +(defcustom recentf-cleanup-remote t + "*non-nil means to auto cleanup remote files." + :group 'recentf + :type 'boolean) ^L ;;; Utilities ;; @@ -1168,7 +1173,10 @@ (message "Cleaning up the recentf list...") (let (newlist) (dolist (f recentf-list) - (if (and (recentf-include-p f) (recentf-file-readable-p f)) + (if (and (recentf-include-p f) + (or (and (file-remote-p f) + (not recentf-cleanup-remote)) + (recentf-file-readable-p f))) (push f newlist) (message "File %s removed from the recentf list" f))) (setq recentf-list (nreverse newlist))