From de5d9f5d0d1206758bf9035ca03773e59c6ffb38 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 23 Mar 2023 02:54:41 +0100 Subject: [PATCH] Replace add-hook with doom's wrapper --- +org.el | 12 ++++++------ config.el | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/+org.el b/+org.el index 63924ca..fa456e6 100644 --- a/+org.el +++ b/+org.el @@ -8,7 +8,7 @@ ;; Disable completion (set-company-backend! 'org-mode nil) ;; Turn off line numbers -(add-hook 'org-mode-hook (lambda () (display-line-numbers-mode -1))) +(add-hook! 'org-mode-hook (display-line-numbers-mode -1)) ;; Add Notes to agenda (setq org-agenda-files '("~/Notes")) ;; Tailor Org super agenda @@ -57,10 +57,10 @@ (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no")) org-babel-default-lob-header-args '((:exports . "both"))) ;; Enter writeroom-mode in all org files -(add-hook 'org-mode-hook 'global-writeroom-mode) +(add-hook! 'org-mode-hook 'global-writeroom-mode) (setq writeroom-major-modes '(org-mode) +zen-text-scale 1.5) -(add-hook 'org-mode-hook 'visual-line-mode) +(add-hook! 'org-mode-hook 'visual-line-mode) ;; Respect LANGUAGE export variable (add-to-list 'org-latex-packages-alist '("AUTO" "babel" t ("pdflatex"))) ;; Don't evaluate code blocks on export @@ -160,7 +160,7 @@ :hook (org-mode . org-modern-mode) :config (setq org-modern-star ["⁖"])) -(add-hook 'org-agenda-finalize-hook #'org-modern-agenda) +(add-hook! 'org-agenda-finalize-hook #'org-modern-agenda) ;; Configure a better split and some default for org-noter (after! org-noter (setq org-noter-always-create-frame nil @@ -181,9 +181,9 @@ ;; Only show a task once if it has a schedule and deadline (setq org-agenda-skip-deadline-prewarning-if-scheduled t) ;; Show raw latex when the cursor on the expression -(add-hook 'org-mode-hook 'org-fragtog-mode) +(add-hook! 'org-mode-hook 'org-fragtog-mode) ;; Auto tangle on save -(add-hook 'org-mode-hook 'org-auto-tangle-mode) +(add-hook! 'org-mode-hook 'org-auto-tangle-mode) ;; Save bibtex to annotated bibliography with category selection (setq org-goto-interface 'outline-path-completion org-goto-max-level 1) diff --git a/config.el b/config.el index 3d511d4..44d502d 100644 --- a/config.el +++ b/config.el @@ -26,7 +26,7 @@ (setq org-directory "~/Notes") (after! org (load! "+org")) ;; Disable completion and line numbers in Markdown -(add-hook 'markdown-mode-hook (lambda () (display-line-numbers-mode -1))) +(add-hook! 'markdown-mode-hook (display-line-numbers-mode -1)) (after! markdown (set-company-backend! 'markdown-mode nil)) ;; Reload file from disk without confirmation @@ -34,8 +34,8 @@ (interactive) (revert-buffer :ignore-auto :noconfirm)) ;; Align columns in CSV mode -(add-hook 'csv-mode-hook 'csv-align-mode) -(add-hook 'csv-mode-hook 'csv-header-line) +(add-hook! 'csv-mode-hook 'csv-align-mode) +(add-hook! 'csv-mode-hook 'csv-header-line) ;; Close compilation buffer if successful (setq compilation-finish-functions (lambda (buf str) @@ -86,7 +86,7 @@ wallabag-show-sidebar 't wallabag-show-entry-switch 'switch-to-buffer url-automatic-caching t) - (add-hook 'wallabag-after-render-hook 'wallabag-search-update-and-clear-filter)) + (add-hook! 'wallabag-after-render-hook 'wallabag-search-update-and-clear-filter)) (add-hook! 'doom-real-buffer-functions (defun +rss-buffer-p (buf) (string-match-p "^\\*wallabag" (buffer-name buf))))