From 7332a6f79869b25453d160219d7604a65a8d7905 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 9 May 2021 00:20:52 -0400 Subject: [PATCH] Refactor doom--recentf-file-truename-fn --- core/core-editor.el | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 636b89705..bd0fcb89e 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -286,14 +286,10 @@ or file path may exist now." recentf-max-saved-items 200) ; default is 20 (defun doom--recentf-file-truename-fn (file) - (if (file-remote-p file) - (if-let* ((tfile (and (bound-and-true-p tramp-mode) - (tramp-tramp-file-p file) - (tramp-dissect-file-name file))) - ((string= (tramp-file-name-method tfile) "sudo"))) - (abbreviate-file-name (file-truename (tramp-file-name-localname tfile))) - file) - (abbreviate-file-name (file-truename file)))) + (if (or (not (file-remote-p file)) + (equal "sudo" (file-remote-p file 'method))) + (abbreviate-file-name (file-truename (tramp-file-name-localname tfile))) + file)) ;; Resolve symlinks, strip out the /sudo:X@ prefix in local tramp paths, and ;; abbreviate $HOME -> ~ in filepaths (more portable, more readable, & saves