diff --git a/lisp/doom-editor.el b/lisp/doom-editor.el index 2827fde85..e9d460adc 100644 --- a/lisp/doom-editor.el +++ b/lisp/doom-editor.el @@ -2,7 +2,12 @@ ;;; Commentary: ;;; Code: -(defvar doom-detect-indentation-excluded-modes '(pascal-mode so-long-mode) +(defvar doom-detect-indentation-excluded-modes + '(pascal-mode + so-long-mode + ;; Automatic indent detection in org files is meaningless. Not to mention, a + ;; non-standard `tab-width' causes an error in org-mode. + org-mode) "A list of major modes where indentation shouldn't be auto-detected.") (defvar-local doom-inhibit-indent-detection nil diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 087f95cf6..f88057bf3 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -181,9 +181,6 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default ("NO" . +org-todo-cancel) ("KILL" . +org-todo-cancel))) - ;; Automatic indent detection in org files is meaningless - (add-to-list 'doom-detect-indentation-excluded-modes 'org-mode) - (set-ligatures! 'org-mode :name "#+NAME:" :name "#+name:" @@ -1438,6 +1435,11 @@ between the two." :references #'+org-lookup-references-handler :documentation #'+org-lookup-documentation-handler) + ;; HACK: Somehow, users/packages still find a way to modify tab-width in + ;; org-mode. Since org-mode treats a non-standerd tab-width as an error + ;; state, I use this hook to makes it much harder to change by accident. + (add-hook! 'org-mode-hook :depth 110 (setq-local tab-width 8)) + ;; Save target buffer after archiving a node. (setq org-archive-subtree-save-file-p t)