emacs: fix nil file-name-handler-alist after reloading init
[~bandali/configs] / .emacs.d / init.el
index 31b5158..b09f080 100644 (file)
       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)
   (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)
@@ -547,6 +548,7 @@ For disabling the behaviour for certain buffers and/or modes."
   (("C-c a o a" . org-agenda)
    :map org-mode-map
    ("M-L" . org-insert-last-stored-link)
+   ("M-O" . org-toggle-link-display)
    ("s-T" . org-todo))
   :hook ((org-mode . org-indent-mode)
          (org-mode . auto-fill-mode)
@@ -1539,6 +1541,10 @@ For disabling the behaviour for certain buffers and/or modes."
   :init
   (setq alert-default-style 'notifier))
 
+(use-package ivy-xref
+  :init
+  (setq xref-show-xrefs-function #'ivy-xref-show-xrefs))
+
 \f
 ;;; Email (with Gnus)