]> git.eshelyaron.com Git - emacs.git/commitdiff
Sort 'M-x recentf' completion candidates by recency.
authorEshel Yaron <me@eshelyaron.com>
Sat, 9 Dec 2023 20:47:07 +0000 (21:47 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 9 Dec 2023 20:48:14 +0000 (21:48 +0100)
* lisp/recentf.el (recentf-open): Let bind 'completions-sort' to nil.
* etc/NEWS: Announce it.

etc/NEWS
lisp/recentf.el

index d24d5d6404a541329c68f5a34a298ac867881978..66bf70f604b73c50f87197ebf2d83cb4b1b1fa7e 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1043,6 +1043,12 @@ Similarly to buffer restoration by Desktop, 'recentf-mode' checking
 of the accessibility of remote files can now time out if
 'remote-file-name-access-timeout' is set to a positive number.
 
+---
+*** 'M-x recentf' completion candidates now sorted by recency.
+Emacs now sorts file names in 'M-x recentf' completion by recency,
+with the file you've accessed most recently first.
+
+
 ** Notifications
 
 +++
index 94ae871763b9189748f0da6187d103a6d1947c85..4a523d97f9249df5e6225dc275c73688b73d414d 100644 (file)
@@ -489,10 +489,11 @@ Return non-nil if F1 is less than F2."
   "Prompt for FILE in `recentf-list' and visit it.
 Enable `recentf-mode' if it isn't already."
   (interactive
-   (list
-    (progn (unless recentf-mode (recentf-mode 1))
-           (completing-read (format-prompt "Open recent file" nil)
-                            recentf-list nil t))))
+   (let ((completions-sort nil))
+     (list
+      (progn (unless recentf-mode (recentf-mode 1))
+             (completing-read (format-prompt "Open recent file" nil)
+                              recentf-list nil t)))))
   (when file
     (funcall recentf-menu-action file)))