Fix #1444: recentf hangs Emacs on quit & cleanup

Caused by using file-truename on (disconnected) remote files, which
invoked TRAMP authentication.

Replaces #1451
This commit is contained in:
Henrik Lissner 2019-06-07 23:01:58 +02:00
parent 79941a4fd7
commit d329f216e3
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -105,14 +105,19 @@ detected.")
recentf-auto-cleanup 'never
recentf-max-menu-items 0
recentf-max-saved-items 200
recentf-filename-handlers '(file-truename abbreviate-file-name)
recentf-exclude
(list #'file-remote-p "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\)$"
"^/tmp/" "^/ssh:" "\\.?ido\\.last$" "\\.revive$" "/TAGS$"
"^/var/folders/.+$"
(list "\\.\\(?:gz\\|gif\\|svg\\|png\\|jpe?g\\)$" "^/tmp/" "^/ssh:"
"\\.?ido\\.last$" "\\.revive$" "/TAGS$" "^/var/folders/.+$"
;; ignore private DOOM temp files
(recentf-apply-filename-handlers 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."
(when buffer-file-name