Merge pull request #925 from edwintorok/fix-write-mode-fonts

Fix write mode fonts and format.el
This commit is contained in:
Henrik Lissner 2018-10-03 19:15:24 -04:00 committed by GitHub
commit f0ace87a4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 21 deletions

View file

@ -351,9 +351,9 @@ frame's window-system, the theme will be reloaded.")
((display-graphic-p)
(setq doom-font (face-attribute 'default :font))))
(when doom-serif-font
(set-face-attribute 'fixed-pitch-serif t :font doom-serif-font))
(set-face-attribute 'fixed-pitch-serif nil :font doom-serif-font))
(when doom-variable-pitch-font
(set-face-attribute 'variable-pitch t :font doom-variable-pitch-font))
(set-face-attribute 'variable-pitch nil :font doom-variable-pitch-font))
;; Fallback to `doom-unicode-font' for Unicode characters
(when (fontp doom-unicode-font)
(set-fontset-font t nil doom-unicode-font nil 'append)))

View file

@ -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))

View file

@ -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

View file

@ -101,7 +101,7 @@ Stolen shamelessly from go-mode"
(defun +format*probe (orig-fn)
"Use `+format-with' instead, if it is set."
(if +format-with
(cons +format-with t)
(list +format-with t)
(funcall orig-fn)))
;;;###autoload