mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
refactor: remove doom--recentf-file-truename-fn
For the sake of reducing complexity, I stop Doom from stripping symlinks or the "/sudo:" prefix from tramp paths in recentf's file list. It's extra work that's not strictly necessary or unanimously desired. Also removes the tidbit about `recentf-show-abbreviated`; the variable was removed just prior to 29's release so it is no longer an option.
This commit is contained in:
@ -307,26 +307,11 @@ tell you about it. Very annoying. This prevents that."
|
||||
(setq recentf-auto-cleanup nil ; Don't. We'll auto-cleanup on shutdown
|
||||
recentf-max-saved-items 200) ; default is 20
|
||||
|
||||
(defun doom--recentf-file-truename-fn (file)
|
||||
(if (or (not (file-remote-p file))
|
||||
(equal "sudo" (file-remote-p file 'method)))
|
||||
(abbreviate-file-name (file-truename (tramp-file-name-localname file)))
|
||||
file))
|
||||
|
||||
;; REVIEW: Use this in lieu of `doom--recentf-file-truename-fn' when we drop
|
||||
;; 28 support. See emacs-mirror/emacs@32906819addd.
|
||||
;; (setq recentf-show-abbreviated t)
|
||||
|
||||
;; Anything in runtime folders
|
||||
(add-to-list 'recentf-exclude
|
||||
(concat "^" (regexp-quote (or (getenv "XDG_RUNTIME_DIR")
|
||||
"/run"))))
|
||||
|
||||
;; Resolve symlinks, strip out the /sudo:X@ prefix in local tramp paths, and
|
||||
;; abbreviate $HOME -> ~ in filepaths (more portable, more readable, & saves
|
||||
;; space)
|
||||
(add-to-list 'recentf-filename-handlers #'doom--recentf-file-truename-fn)
|
||||
|
||||
;; Text properties inflate the size of recentf's files, and there is
|
||||
;; no purpose in persisting them (Must be first in the list!)
|
||||
(add-to-list 'recentf-filename-handlers #'substring-no-properties)
|
||||
|
Reference in New Issue
Block a user