From f532019b1f02ee4dad8b3e6a3d414499fc4bf4af Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 16 Apr 2020 18:16:49 -0400 Subject: [PATCH] Restore file-name-handler-alist non-destructively And in reverse order, so new rules correctly shadow old ones. --- core/core.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/core.el b/core/core.el index 789574a75..9a9b5d0db 100644 --- a/core/core.el +++ b/core/core.el @@ -31,6 +31,10 @@ ;; Restore `file-name-handler-alist', because it is needed for handling ;; encrypted or compressed files, among other things. (defun doom-reset-file-handler-alist-h () + ;; Re-add rather than `setq', because file-name-handler-alist may have + ;; changed since startup, and we want to preserve those. + (dolist (handler file-name-handler-alist) + (add-to-list 'doom--initial-file-name-handler-alist handler)) (setq file-name-handler-alist doom--initial-file-name-handler-alist)) (add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h))