From: David Ponce <david.ponce@wanadoo.fr>
Cc: emacs-devel@gnu.org
Subject: Re: recentf improvement
Date: Sun, 21 Sep 2003 00:47:51 +0200 [thread overview]
Message-ID: <3F6CD917.5070502@wanadoo.fr> (raw)
In-Reply-To: <E1A0pGF-0005x0-Vs@fencepost.gnu.org>
Hi,
> This looks good to me. David, what do you think?
I would prefer to rename `recentf-install-to-file-name-history' to
`recentf-init-file-name-history'. I found that name clearer.
Also, IMO, it is better to handle initialization of the
file-name-history just after the recent list is loaded, that is in
function `recentf-load-list'.
Finally, I don't see the point of calling `abbreviate-file-name' on
every recent file before copying them to file-name-history?
So I suggest you this simplified patch.
David
2003-09-21 David Ponce <david@dponce.com>
* recentf.el (recentf-init-file-name-history): New option.
(recentf-load-list): Initialize file-name-history if necessary.
Index: lisp/recentf.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/recentf.el,v
retrieving revision 1.27
diff -c -r1.27 recentf.el
*** lisp/recentf.el 15 Sep 2003 16:24:35 -0000 1.27
--- lisp/recentf.el 20 Sep 2003 22:30:10 -0000
***************
*** 240,245 ****
--- 240,251 ----
;; Unavailable until recentf has been loaded.
(recentf-auto-cleanup))))
+ (defcustom recentf-init-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,1153 ****
(defun recentf-load-list ()
"Load a previously saved recent list.
! Read data from the file specified by `recentf-save-file'."
(interactive)
(let ((file (expand-file-name recentf-save-file)))
(when (file-readable-p file)
! (load-file file))))
(defun recentf-cleanup ()
"Remove all excluded or non-readable files from the recent list."
--- 1149,1164 ----
(defun recentf-load-list ()
"Load a previously saved recent list.
! Read data from the file specified by `recentf-save-file'.
! When `recentf-init-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)
! (and recentf-init-file-name-history
! (not file-name-history)
! (setq file-name-history recentf-list)))))
(defun recentf-cleanup ()
"Remove all excluded or non-readable files from the recent list."
next prev parent reply other threads:[~2003-09-20 22:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-20 21:27 recentf improvement Richard Stallman
2003-09-20 22:47 ` David Ponce [this message]
2003-09-20 23:07 ` Miles Bader
2003-09-21 7:00 ` David Ponce
2003-09-21 6:40 ` Masatake YAMATO
2003-09-21 6:50 ` David Ponce
2003-09-21 7:03 ` Masatake YAMATO
2003-09-21 7:35 ` David Ponce
2003-09-21 22:34 ` Richard Stallman
2003-09-21 22:33 ` Richard Stallman
-- strict thread matches above, loose matches on Subject: below --
2003-09-22 6:58 David PONCE
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F6CD917.5070502@wanadoo.fr \
--to=david.ponce@wanadoo.fr \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).