diff options
author | Eli Zaretskii <eliz@gnu.org> | 2003-09-28 08:42:49 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2003-09-28 08:42:49 +0000 |
commit | 51c8b53fd264d33bba8ef401054bcd978264b512 (patch) | |
tree | 4e56c94c23aa317397e3fe5569b67df10ae0c693 /lisp/recentf.el | |
parent | a069f50952b1d8f8f6ade9524ac95b82cc0b8456 (diff) | |
download | emacs-51c8b53fd264d33bba8ef401054bcd978264b512.tar.gz |
(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.
Diffstat (limited to 'lisp/recentf.el')
-rw-r--r-- | lisp/recentf.el | 18 |
1 files changed, 15 insertions, 3 deletions
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 @@ ;; Maintainer: FSF ;; Keywords: files -(defconst recentf-version "$Revision: 1.26 $") +(defconst recentf-version "$Revision: 1.27 $") ;; This file is part of GNU Emacs. @@ -240,6 +240,12 @@ cleanup the list." ;; Unavailable until recentf has been loaded. (recentf-auto-cleanup)))) +(defcustom recentf-initialize-file-name-history t + "*non-nil means to initialize `file-name-history' with the recent list. +If `file-name-history' is not empty, do nothing." + :group 'recentf + :type 'boolean) + (defcustom recentf-load-hook nil "*Normal hook run at end of loading the `recentf' package." :group 'recentf @@ -1143,11 +1149,17 @@ Write data into the file specified by `recentf-save-file'." (defun recentf-load-list () "Load a previously saved recent list. -Read data from the file specified by `recentf-save-file'." +Read data from the file specified by `recentf-save-file'. +When `recentf-initialize-file-name-history' is non-nil, initialize an +empty `file-name-history' with the recent list." (interactive) (let ((file (expand-file-name recentf-save-file))) (when (file-readable-p file) - (load-file file)))) + (load-file file) + (and recentf-initialize-file-name-history + (not file-name-history) + (setq file-name-history (mapcar 'abbreviate-file-name + recentf-list)))))) (defun recentf-cleanup () "Remove all excluded or non-readable files from the recent list." |