;;; recentf-conf.el --- My configurations concerning recentf -*- lexical-binding: t; -*- (require 'recentf) (set 'recentf-save-file (expand-file-name "recentf" load-file-directory)) (recentf-mode 1) (defun file-exists-or-remote-p (filename) "Return t if file FILENAME exists or is a remote file. If this file is remote, as determined by `file-remote-p', then this returns t. Otherwise, this returns the result of `file-exists-p'." (cond ((file-remote-p filename) t) ((file-exists-p filename)))) ;;;###autoload (defun choose-recent-file () "Choose a recently visited file to visit. This uses `completing-read' to choose a file from `recentf-list'." (interactive) (let ((choice (completing-read "Choose a recently visited file: " recentf-list #'file-exists-or-remote-p t))) (find-file choice)))