Emacs' Recent Files

Nov 15, 2002 6:31 PM
Tags: emacs
Random Emacs tip of the day:

If you're using XEmacs or another version, you may have to download the file recentf.el from somewhere like this list of files.

But if you're using GNU Emacs 21.2 (the latest version, which includes this as part of the standard distro), you can just put the following lines into your .emacs file
;; recentf stuff
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files)
Then, when you launch emacs, hit CTRL-X CTRL-R. It will show a list of the recently-opened files in a buffer. Move the cursor to a line and press ENTER. That will open the file in question, and move it to the top of your recent-file list.

(Note: Emacs records file names. Therefore, if you move or rename a file outside of Emacs, it won't automatically update the list. You'll have to open the renamed file with the normal CTRL-X CTRL-F method.)

Jayakrishnan Varnam has a page including screenshots of how this package works.

This blog is no longer active, and comments have been disabled.