fix(org): don't change tab-width in org-mode
Recently, org-mode made a non-standard tab-width an error state. Unfortunately, it's way too easy for users to accidentally change it (e.g. with editorconfig, indiscriminate setter hooks, or other packages), and since there is zero reason to ever want a non-standard tab-width in org-mode, I not only exclude it from dtrt-indent as a global default (i.e. not only as part of :lang org), but I add a late org-mode-hook hook to reset tab-width, just in case.
This commit is contained in:
parent
183ab38926
commit
2757a97a30
2 changed files with 11 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue