aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2007-07-15 19:55:14 +0000
committerMichael Albinus2007-07-15 19:55:14 +0000
commit60f164bdb72ae49a260cb035892f679cfb351051 (patch)
treeb31eb2c71065f0f98e3c970cae6e16e8a1d152aa /lisp
parent004b681c6445b598459e12e23cc730d41ac30508 (diff)
downloademacs-60f164bdb72ae49a260cb035892f679cfb351051.tar.gz
emacs-60f164bdb72ae49a260cb035892f679cfb351051.zip
* recentf.el (recentf-keep-default-predicate): New defun.
(recentf-keep): Use it as initial value.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/recentf.el22
2 files changed, 21 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f888ffba489..29e342f94ea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12007-07-15 Michael Albinus <albinus@localhost>
2
3 * recentf.el (recentf-keep-default-predicate): New defun.
4 (recentf-keep): Use it as initial value.
5
12007-07-15 Karl Fogel <kfogel@red-bean.com> 62007-07-15 Karl Fogel <kfogel@red-bean.com>
2 7
3 * bookmark.el: Revert 2007-07-13T18:16:17Z!kfogel@red-bean.com, 8 * bookmark.el: Revert 2007-07-13T18:16:17Z!kfogel@red-bean.com,
@@ -35,7 +40,7 @@
35 * replace.el (match): Use yellow1 instead of yellow. 40 * replace.el (match): Use yellow1 instead of yellow.
36 41
37 * progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of 42 * progmodes/gdb-ui.el (breakpoint-enabled): Use red1 instead of
38 red. 43 red.
39 44
40 * pcvs-info.el (cvs-unknown): Likewise. 45 * pcvs-info.el (cvs-unknown): Likewise.
41 46
diff --git a/lisp/recentf.el b/lisp/recentf.el
index c55f15c69e9..aea7528b2ce 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -89,7 +89,7 @@ file. See also the function `set-file-modes'."
89 :group 'recentf 89 :group 'recentf
90 :type '(choice (const :tag "Don't change" nil) 90 :type '(choice (const :tag "Don't change" nil)
91 integer)) 91 integer))
92 92
93(defcustom recentf-exclude nil 93(defcustom recentf-exclude nil
94 "*List of regexps and predicates for filenames excluded from the recent list. 94 "*List of regexps and predicates for filenames excluded from the recent list.
95When a filename matches any of the regexps or satisfies any of the 95When a filename matches any of the regexps or satisfies any of the
@@ -99,19 +99,27 @@ must return non-nil to exclude it."
99 :group 'recentf 99 :group 'recentf
100 :type '(repeat (choice regexp function))) 100 :type '(repeat (choice regexp function)))
101 101
102(defun recentf-keep-default-predicate (file)
103 "Return non-nil if FILE should be kept in the recent list.
104It handles the case of remote files as well."
105 (cond
106 ((file-remote-p file t) (file-readable-p file))
107 ((file-remote-p file))
108 ((file-readable-p file))))
109
102(defcustom recentf-keep 110(defcustom recentf-keep
103 '(file-readable-p) 111 '(recentf-keep-default-predicate)
104 "*List of regexps and predicates for filenames kept in the recent list. 112 "*List of regexps and predicates for filenames kept in the recent list.
105Regexps and predicates are tried in the specified order. 113Regexps and predicates are tried in the specified order.
106When nil all filenames are kept in the recent list. 114When nil all filenames are kept in the recent list.
107When a filename matches any of the regexps or satisfies any of the 115When a filename matches any of the regexps or satisfies any of the
108predicates it is kept in the recent list. 116predicates it is kept in the recent list.
109The default is to keep readable files. 117The default is to keep readable files. Remote files are checked
118for readability only in case a connection is established to that
119remote system, otherwise they are kept in the recent list without
120checking their readability.
110A predicate is a function that is passed a filename to check and that 121A predicate is a function that is passed a filename to check and that
111must return non-nil to keep it. For example, you can add the 122must return non-nil to keep it."
112`file-remote-p' predicate in front of this list to keep remote file
113names in the recent list without checking their readability through a
114remote access."
115 :group 'recentf 123 :group 'recentf
116 :type '(repeat (choice regexp function))) 124 :type '(repeat (choice regexp function)))
117 125