From c753e4cb2a2a5998626d48d85071c047cbab6c54 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 23 Jun 2022 11:00:19 +0200 Subject: [PATCH] Use shortened filenames in recentf-mode * lisp/recentf.el (recentf-filename-handlers): Set to 'abbreviate-file-name' to get shortened names by default. (Bug#56123) --- etc/NEWS | 6 ++++++ lisp/recentf.el | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index f21f482c29a..6c04ae164cb 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1855,6 +1855,12 @@ Enabling this minor mode turns on hiding header material, like If non-nil, files untracked by a VCS are considered to be part of the project by a VC project based on that VCS. +--- +*** 'recentf-mode' now uses shortened filenames by default. +This means that e.g. "/home/foo/bar" is now displayed as "~/bar". +Customize the user option 'recentf-filename-handlers' to nil to get +back the old behavior. + --- ** The autoarg.el library is now marked obsolete. This library provides the 'autoarg-mode' and 'autoarg-kp-mode' minor diff --git a/lisp/recentf.el b/lisp/recentf.el index 8b05f48283e..6729ede1673 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -285,7 +285,7 @@ If `file-name-history' is not empty, do nothing." (make-obsolete-variable 'recentf-load-hook "use `with-eval-after-load' instead." "28.1") -(defcustom recentf-filename-handlers nil +(defcustom recentf-filename-handlers '(abbreviate-file-name) "Functions to post process recent file names. They are successively passed a file name to transform it." :group 'recentf @@ -295,7 +295,8 @@ They are successively passed a file name to transform it." (choice (const file-truename) (const abbreviate-file-name) - (function :tag "Other function"))))) + (function :tag "Other function")))) + :version "29.1") (defcustom recentf-show-file-shortcuts-flag t "Non-nil means to show \"[N]\" for the Nth item up to 10. -- 2.39.2