From c0eb1f524d13599b655194aaf217e99643de9d58 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 20 Jun 2019 14:12:16 +0200 Subject: [PATCH] Fix exclusion of doom local files in recentf Due to a load order issue, the doom-local-dir regexp wouldn't be mapped through our custom recentf-filename-handlers. `file-in-directory-p` is more robust. --- core/core-editor.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 2a6017bfd..29b9f9da1 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -111,18 +111,19 @@ detected.") recentf-auto-cleanup 'never recentf-max-menu-items 0 recentf-max-saved-items 200 - recentf-filename-handlers '(doom--recent-file-truename abbreviate-file-name) recentf-exclude (list "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\)$" "^/tmp/" "^/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$" "^/var/folders/.+$" ;; ignore private DOOM temp files - (regexp-quote (recentf-apply-filename-handlers doom-local-dir)))) + (lambda (path) + (ignore-errors (file-in-directory-p path doom-local-dir))))) (defun doom--recent-file-truename (file) (if (or (file-remote-p file nil t) (not (file-remote-p file))) (file-truename file) file)) + (setq recentf-filename-handlers '(doom--recent-file-truename abbreviate-file-name)) (defun doom|recentf-touch-buffer () "Bump file in recent file list when it is switched or written to."