[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c753e4cb2a 3/4: Use shortened filenames in recentf-mode
From: |
Stefan Kangas |
Subject: |
master c753e4cb2a 3/4: Use shortened filenames in recentf-mode |
Date: |
Thu, 23 Jun 2022 06:49:11 -0400 (EDT) |
branch: master
commit c753e4cb2a2a5998626d48d85071c047cbab6c54
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>
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 f21f482c29..6c04ae164c 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 8b05f48283..6729ede167 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.