changeset 81893:5608c829dbac

* recentf.el (recentf-keep-default-predicate): New defun. (recentf-keep): Use it as initial value.
author Michael Albinus <michael.albinus@gmx.de>
date Sun, 15 Jul 2007 19:55:14 +0000
parents cf78c05b3254
children fb5c5d1a8fe2
files lisp/ChangeLog lisp/recentf.el
diffstat 2 files changed, 21 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Jul 15 19:15:13 2007 +0000
+++ b/lisp/ChangeLog	Sun Jul 15 19:55:14 2007 +0000
@@ -1,3 +1,8 @@
+2007-07-15  Michael Albinus  <albinus@localhost>
+
+	* recentf.el (recentf-keep-default-predicate): New defun.
+	(recentf-keep): Use it as initial value.
+
 2007-07-15  Karl Fogel  <kfogel@red-bean.com>
 
 	* bookmark.el: Revert revision 1.90 (commitid mWoPbju3pgNotDps),
@@ -35,7 +40,7 @@
 	* replace.el (match): Use yellow1 instead of yellow.
 
 	* progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of
-	red. 
+	red.
 
 	* pcvs-info.el (cvs-unknown): Likewise.
 
--- a/lisp/recentf.el	Sun Jul 15 19:15:13 2007 +0000
+++ b/lisp/recentf.el	Sun Jul 15 19:55:14 2007 +0000
@@ -89,7 +89,7 @@
   :group 'recentf
   :type '(choice (const :tag "Don't change" nil)
           integer))
-  
+
 (defcustom recentf-exclude nil
   "*List of regexps and predicates for filenames excluded from the recent list.
 When a filename matches any of the regexps or satisfies any of the
@@ -99,19 +99,27 @@
   :group 'recentf
   :type '(repeat (choice regexp function)))
 
+(defun recentf-keep-default-predicate (file)
+  "Return non-nil if FILE should be kept in the recent list.
+It handles the case of remote files as well."
+  (cond
+   ((file-remote-p file t) (file-readable-p file))
+   ((file-remote-p file))
+   ((file-readable-p file))))
+
 (defcustom recentf-keep
-  '(file-readable-p)
+  '(recentf-keep-default-predicate)
   "*List of regexps and predicates for filenames kept in the recent list.
 Regexps and predicates are tried in the specified order.
 When nil all filenames are kept in the recent list.
 When a filename matches any of the regexps or satisfies any of the
 predicates it is kept in the recent list.
-The default is to keep readable files.
+The default is to keep readable files.  Remote files are checked
+for readability only in case a connection is established to that
+remote system, otherwise they are kept in the recent list without
+checking their readability.
 A predicate is a function that is passed a filename to check and that
-must return non-nil to keep it.  For example, you can add the
-`file-remote-p' predicate in front of this list to keep remote file
-names in the recent list without checking their readability through a
-remote access."
+must return non-nil to keep it."
   :group 'recentf
   :type '(repeat (choice regexp function)))