mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
+write-mode: initialization functions were not run
setting +write-mode-hook had no effect because +write-mode-hook was not defined yet, it is only defined by the minor mode definition inside autoload.el (which didn't get autoloaded yet). Due to this when activating `+write-mode` the `mixed-pitch-mode` did not get activated. Fix this by moving these all to autoload. Signed-off-by: Edwin Török <edwin@etorok.net>
This commit is contained in:
@ -20,3 +20,24 @@
|
||||
"Initializes `org-mode' specific settings for `+write-mode'."
|
||||
(when (eq major-mode 'org-mode)
|
||||
(+org-pretty-mode (if +write-mode +1 -1))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +write|init-line-numbers ()
|
||||
(display-line-numbers-mode (if +write-mode +1 -1)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +write|init-mixed-pitch ()
|
||||
(mixed-pitch-mode (if +write-mode +1 -1)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +write|init-visual-fill-column ()
|
||||
(visual-fill-column-mode (if +write-mode +1 -1)))
|
||||
|
||||
;;;###autoload
|
||||
(add-hook! '+write-mode-hook
|
||||
#'(flyspell-mode
|
||||
visual-line-mode
|
||||
+write|init-mixed-pitch
|
||||
+write|init-visual-fill-column
|
||||
+write|init-line-numbers
|
||||
+write|init-org-mode))
|
||||
|
@ -6,24 +6,6 @@
|
||||
(defvar +write-line-spacing nil
|
||||
"What to set `line-spacing' in `+write-mode'.")
|
||||
|
||||
(defun +write|init-line-numbers ()
|
||||
(display-line-numbers-mode (if +write-mode +1 -1)))
|
||||
|
||||
(defun +write|init-mixed-pitch ()
|
||||
(mixed-pitch-mode (if +write-mode +1 -1)))
|
||||
|
||||
(defun +write|init-visual-fill-column ()
|
||||
(visual-fill-column-mode (if +write-mode +1 -1)))
|
||||
|
||||
(add-hook! '+write-mode-hook
|
||||
#'(flyspell-mode
|
||||
visual-line-mode
|
||||
+write|init-mixed-pitch
|
||||
+write|init-visual-fill-column
|
||||
+write|init-line-numbers
|
||||
+write|init-org-mode))
|
||||
|
||||
|
||||
;;
|
||||
;; Packages
|
||||
|
||||
|
Reference in New Issue
Block a user