feat(word-wrap): accept minor modes in +word-wrap-visual-modes

And instead of disabling +word-wrap in org-mode wholesale, only disable
it in the presence of `org-indent-mode` (or `markdown-indent-mode`) --
modes that use `line-prefix`/`wrap-prefix` text properties that could
conflict with `adaptive-wrap-prefix-mode` (which the word-wrap module
uses).
This commit is contained in:
Henrik Lissner 2026-04-24 03:37:08 -04:00
parent c060cee5f4
commit 07e7b4b41e
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
2 changed files with 7 additions and 4 deletions

View file

@ -48,7 +48,11 @@ wrapped at `fill-column' by configuring `+word-wrap-fill-style'."
(progn
(setq-local
+word-wrap--major-mode-is-visual
(memq major-mode +word-wrap-visual-modes)
(cl-loop for mode in +word-wrap-visual-modes
if (or (eq major-mode mode)
(and (boundp mode)
(symbol-value mode)))
return t)
+word-wrap--major-mode-is-text
(memq major-mode +word-wrap-text-modes)
+word-wrap--enable-adaptive-wrap-mode

View file

@ -36,9 +36,8 @@ will not be affected."
:type '(repeat symbol)
:group '+word-wrap)
(defcustom +word-wrap-visual-modes '(org-mode)
"Major-modes where `+word-wrap-mode' should not use
`adaptive-wrap-prefix-mode'.")
(defcustom +word-wrap-visual-modes '(org-indent-mode markdown-indent-mode)
"Major or minor modes where `adaptive-wrap-prefix-mode' show not be used."
:type '(repeat symbol)
:group '+word-wrap)