diff options
| author | Michael Albinus | 2007-07-15 19:55:14 +0000 |
|---|---|---|
| committer | Michael Albinus | 2007-07-15 19:55:14 +0000 |
| commit | 60f164bdb72ae49a260cb035892f679cfb351051 (patch) | |
| tree | b31eb2c71065f0f98e3c970cae6e16e8a1d152aa /lisp | |
| parent | 004b681c6445b598459e12e23cc730d41ac30508 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/recentf.el | 22 |
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 @@ | |||
| 1 | 2007-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 | |||
| 1 | 2007-07-15 Karl Fogel <kfogel@red-bean.com> | 6 | 2007-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. |
| 95 | When a filename matches any of the regexps or satisfies any of the | 95 | When 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. | ||
| 104 | It 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. |
| 105 | Regexps and predicates are tried in the specified order. | 113 | Regexps and predicates are tried in the specified order. |
| 106 | When nil all filenames are kept in the recent list. | 114 | When nil all filenames are kept in the recent list. |
| 107 | When a filename matches any of the regexps or satisfies any of the | 115 | When a filename matches any of the regexps or satisfies any of the |
| 108 | predicates it is kept in the recent list. | 116 | predicates it is kept in the recent list. |
| 109 | The default is to keep readable files. | 117 | The default is to keep readable files. Remote files are checked |
| 118 | for readability only in case a connection is established to that | ||
| 119 | remote system, otherwise they are kept in the recent list without | ||
| 120 | checking their readability. | ||
| 110 | A predicate is a function that is passed a filename to check and that | 121 | A predicate is a function that is passed a filename to check and that |
| 111 | must return non-nil to keep it. For example, you can add the | 122 | must return non-nil to keep it." |
| 112 | `file-remote-p' predicate in front of this list to keep remote file | ||
| 113 | names in the recent list without checking their readability through a | ||
| 114 | remote access." | ||
| 115 | :group 'recentf | 123 | :group 'recentf |
| 116 | :type '(repeat (choice regexp function))) | 124 | :type '(repeat (choice regexp function))) |
| 117 | 125 | ||