diff options
author | Amin Bandali <bandali@gnu.org> | 2019-05-14 20:35:06 -0400 |
---|---|---|
committer | Amin Bandali <bandali@gnu.org> | 2019-05-14 20:35:06 -0400 |
commit | 9f7db1e88b102c1bfd696096fcc6452ffc124573 (patch) | |
tree | 924232a9d85c36f443f6ba100c45364d914525ed | |
parent | 34c6cf4cacc185bf961bd191f6fbddffe6144261 (diff) | |
download | configs-9f7db1e88b102c1bfd696096fcc6452ffc124573.tar.gz configs-9f7db1e88b102c1bfd696096fcc6452ffc124573.tar.xz configs-9f7db1e88b102c1bfd696096fcc6452ffc124573.zip |
emacs: fix nil file-name-handler-alist after reloading init
This problem would cause emacs to not treat files like *.gpg
or *.el.gz especially before displaying them, as it normally does.
So now, I update a/file-name-handler-alist with the latest contents of
file-name-handler-alist before loading the init file, and afterwards I
restore things back to normal (done in a/post-init).
-rw-r--r-- | .emacs.d/init.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index b7a433d..b09f080 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -56,12 +56,11 @@ esup-child-profile-require-level 0) ;; set them back to their defaults once we're done initializing -(add-hook - 'after-init-hook - (lambda () - (setq gc-cons-threshold a/gc-cons-threshold - gc-cons-percentage a/gc-cons-percentage - file-name-handler-alist a/file-name-handler-alist))) +(defun a/post-init () + (setq gc-cons-threshold a/gc-cons-threshold + gc-cons-percentage a/gc-cons-percentage + file-name-handler-alist a/file-name-handler-alist)) +(add-hook 'after-init-hook #'a/post-init) ;; increase number of lines kept in *Messages* log (setq message-log-max 20000) @@ -148,7 +147,9 @@ (interactive) (straight-transaction (straight-mark-transaction-as-init) - (load user-init-file))) + (setq a/file-name-handler-alist file-name-handler-alist) + (load user-init-file) + (a/post-init))) ;; use-package (straight-use-package 'use-package) |