+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:
parent
7795da4800
commit
58dd73030c
2 changed files with 21 additions and 18 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue