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.
This commit is contained in:
Henrik Lissner 2019-06-20 14:12:16 +02:00
parent 8434ae619d
commit c0eb1f524d
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -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."