summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--recentf-conf.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/recentf-conf.el b/recentf-conf.el
index 3097b66..f9e2c84 100644
--- a/recentf-conf.el
+++ b/recentf-conf.el
@@ -6,11 +6,20 @@
(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-p t)))
+ recentf-list
+ #'file-exists-or-remote-p t)))
(find-file choice)))