fix(editorconfig): prevent changes to tab-width in org-mode
- Add another measure for preventing changes to tab-width in org-mode. The hook introduced in2757a97
runs too early and could be overwritten by editorconfig. - Fix the hook in2757a97
to run much later, ensuring (as a last resort) no other packages can overwrite tab-width either. Amend:2757a97a30
Ref: #7670
This commit is contained in:
parent
198fe82b6d
commit
43870bf831
2 changed files with 19 additions and 4 deletions
|
@ -1438,7 +1438,12 @@ between the two."
|
|||
;; 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))
|
||||
(add-hook! 'org-mode-hook
|
||||
(add-hook! 'after-change-major-mode-hook :local
|
||||
;; The second check is necessary, in case of `org-edit-src-code' which
|
||||
;; clones a buffer and changes its major-mode.
|
||||
(when (derived-mode-p 'org-mode)
|
||||
(setq 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