unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Mauger <mmaug@yahoo.com>
Subject: Revisit: recentf-cleanup, file-readable-p & remote files
Date: Fri, 11 Mar 2005 14:32:37 -0800 (PST)	[thread overview]
Message-ID: <20050311223237.55871.qmail@web60302.mail.yahoo.com> (raw)

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  <mmaug@yahoo.com>

	* 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))

             reply	other threads:[~2005-03-11 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-11 22:32 Michael Mauger [this message]
2005-03-13 11:53 ` Revisit: recentf-cleanup, file-readable-p & remote files David Ponce
2005-03-14 17:36   ` Michael Mauger
  -- strict thread matches above, loose matches on Subject: below --
2005-03-21 11:21 David PONCE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050311223237.55871.qmail@web60302.mail.yahoo.com \
    --to=mmaug@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).