Skip to content

Commit

Permalink
fix(+writing-mode): enable globally for a set of modes
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 7, 2023
1 parent 5ea190d commit 38d5339
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/extras/me-writing-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
:group 'minemacs-ui
:type '(repeat symbol))

(defcustom +writing-major-modes
'(rst-mode text-mode markdown-mode org-mode)
"Enable `+writing-global-mode' for these modes."
:group 'minemacs-ui
:type '(repeat symbol))

(defvar-local +writing--line-nums-active-p nil)
(defvar-local +writing--org-format-latex-scale nil)

Expand Down Expand Up @@ -99,7 +105,8 @@

(defun +turn-on-writing-mode ()
(interactive)
(+writing-mode 1))
(when (seq-some #'derived-mode-p +writing-major-modes)
(+writing-mode 1)))

(define-globalized-minor-mode +writing-global-mode +writing-mode +turn-on-writing-mode)

Expand Down

0 comments on commit 38d5339

Please sign in to comment.