diff options
| author | Eli Zaretskii | 2003-09-28 08:42:49 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2003-09-28 08:42:49 +0000 |
| commit | 51c8b53fd264d33bba8ef401054bcd978264b512 (patch) | |
| tree | 4e56c94c23aa317397e3fe5569b67df10ae0c693 | |
| parent | a069f50952b1d8f8f6ade9524ac95b82cc0b8456 (diff) | |
| download | emacs-51c8b53fd264d33bba8ef401054bcd978264b512.tar.gz emacs-51c8b53fd264d33bba8ef401054bcd978264b512.zip | |
(recentf-initialize-file-name-history): New defcustom.
(recentf-load-list): When `recentf-initialize-file-name-history'
is non-nil, initialize an empty `file-name-history' with the
recent list.
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/recentf.el | 18 |
2 files changed, 23 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 469988dcbd5..89291362998 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2003-09-28 David Ponce <david@dponce.com> | ||
| 2 | |||
| 3 | * recentf.el (recentf-initialize-file-name-history): New | ||
| 4 | defcustom. | ||
| 5 | (recentf-load-list): When `recentf-initialize-file-name-history' | ||
| 6 | is non-nil, initialize an empty `file-name-history' with the | ||
| 7 | recent list. | ||
| 8 | |||
| 1 | 2003-09-28 Evgeni Dobrev <evgeni_dobrev@developer.bg> (tiny patch) | 9 | 2003-09-28 Evgeni Dobrev <evgeni_dobrev@developer.bg> (tiny patch) |
| 2 | 10 | ||
| 3 | * man.el (Man-default-man-entry): Remove the leading `*' from the | 11 | * man.el (Man-default-man-entry): Remove the leading `*' from the |
diff --git a/lisp/recentf.el b/lisp/recentf.el index a35e33d5742..f2700fcf210 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | ;; Maintainer: FSF | 8 | ;; Maintainer: FSF |
| 9 | ;; Keywords: files | 9 | ;; Keywords: files |
| 10 | 10 | ||
| 11 | (defconst recentf-version "$Revision: 1.26 $") | 11 | (defconst recentf-version "$Revision: 1.27 $") |
| 12 | 12 | ||
| 13 | ;; This file is part of GNU Emacs. | 13 | ;; This file is part of GNU Emacs. |
| 14 | 14 | ||
| @@ -240,6 +240,12 @@ cleanup the list." | |||
| 240 | ;; Unavailable until recentf has been loaded. | 240 | ;; Unavailable until recentf has been loaded. |
| 241 | (recentf-auto-cleanup)))) | 241 | (recentf-auto-cleanup)))) |
| 242 | 242 | ||
| 243 | (defcustom recentf-initialize-file-name-history t | ||
| 244 | "*non-nil means to initialize `file-name-history' with the recent list. | ||
| 245 | If `file-name-history' is not empty, do nothing." | ||
| 246 | :group 'recentf | ||
| 247 | :type 'boolean) | ||
| 248 | |||
| 243 | (defcustom recentf-load-hook nil | 249 | (defcustom recentf-load-hook nil |
| 244 | "*Normal hook run at end of loading the `recentf' package." | 250 | "*Normal hook run at end of loading the `recentf' package." |
| 245 | :group 'recentf | 251 | :group 'recentf |
| @@ -1143,11 +1149,17 @@ Write data into the file specified by `recentf-save-file'." | |||
| 1143 | 1149 | ||
| 1144 | (defun recentf-load-list () | 1150 | (defun recentf-load-list () |
| 1145 | "Load a previously saved recent list. | 1151 | "Load a previously saved recent list. |
| 1146 | Read data from the file specified by `recentf-save-file'." | 1152 | Read data from the file specified by `recentf-save-file'. |
| 1153 | When `recentf-initialize-file-name-history' is non-nil, initialize an | ||
| 1154 | empty `file-name-history' with the recent list." | ||
| 1147 | (interactive) | 1155 | (interactive) |
| 1148 | (let ((file (expand-file-name recentf-save-file))) | 1156 | (let ((file (expand-file-name recentf-save-file))) |
| 1149 | (when (file-readable-p file) | 1157 | (when (file-readable-p file) |
| 1150 | (load-file file)))) | 1158 | (load-file file) |
| 1159 | (and recentf-initialize-file-name-history | ||
| 1160 | (not file-name-history) | ||
| 1161 | (setq file-name-history (mapcar 'abbreviate-file-name | ||
| 1162 | recentf-list)))))) | ||
| 1151 | 1163 | ||
| 1152 | (defun recentf-cleanup () | 1164 | (defun recentf-cleanup () |
| 1153 | "Remove all excluded or non-readable files from the recent list." | 1165 | "Remove all excluded or non-readable files from the recent list." |