Function: recentf-open-most-recent-file
recentf-open-most-recent-file is an interactive and byte-compiled
function defined in recentf.el.gz.
Signature
(recentf-open-most-recent-file &optional N)
Documentation
Open the Nth most recent file.
Optional argument N must be a valid digit number. It defaults to 1.
1 opens the most recent file, 2 the second most recent one, etc..
0 opens the tenth most recent file.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/recentf.el.gz
(defun recentf-open-most-recent-file (&optional n)
"Open the Nth most recent file.
Optional argument N must be a valid digit number. It defaults to 1.
1 opens the most recent file, 2 the second most recent one, etc..
0 opens the tenth most recent file."
(interactive "p")
(cond
((zerop n) (setq n 10))
((and (> n 0) (< n 10)))
((error "Recent file number out of range [0-9], %d" n)))
(let ((file (nth (1- n) (or recentf--files-with-key recentf-list))))
(unless file (error "Not that many recent files"))
;; Close the open files dialog.
(when recentf--files-with-key
(kill-buffer (current-buffer)))
(funcall recentf-menu-action file)))