# HG changeset patch # User Eli Zaretskii # Date 1064738492 0 # Node ID 2a2c48cb8b598e994082b7ea77436ed10c650f0d # Parent e6dc36d887b25c0b25d8c67bee4e0c12c0659372 (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. diff -r e6dc36d887b2 -r 2a2c48cb8b59 lisp/recentf.el --- a/lisp/recentf.el Sun Sep 28 08:31:45 2003 +0000 +++ b/lisp/recentf.el Sun Sep 28 08:41:32 2003 +0000 @@ -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 @@ ;; 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 @@ (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."