diff options
author | Case Duckworth | 2021-03-31 12:45:42 -0500 |
---|---|---|
committer | Case Duckworth | 2021-03-31 12:45:42 -0500 |
commit | d503a2d1b63d21a63a067af254de0d24257f2641 (patch) | |
tree | bfc059555136fef1e877d85784e93f9a8bef063d /lisp | |
parent | Fix font setting (diff) | |
download | emacs-d503a2d1b63d21a63a067af254de0d24257f2641.tar.gz emacs-d503a2d1b63d21a63a067af254de0d24257f2641.zip |
Add `olivetti' and tweak `acdw/reading-mode'
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/acdw.el | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index 35d5ac1..e1d4b48 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -99,17 +99,41 @@ directory." | |||
99 | :lighter " Read" | 99 | :lighter " Read" |
100 | (if acdw/reading-mode | 100 | (if acdw/reading-mode |
101 | (progn ;; turn on | 101 | (progn ;; turn on |
102 | (display-fill-column-indicator-mode -1) | 102 | ;; settings |
103 | (dolist (mode '(visual-fill-column-mode | 103 | (setq-local mode-line-format |
104 | iscroll-mode)) | 104 | '(:eval |
105 | (let* ((fmt " Reading %b (%m) ") | ||
106 | (len (length (format-mode-line fmt)))) | ||
107 | (concat | ||
108 | (propertize " " | ||
109 | 'display `((space :align-to (- right | ||
110 | ,len))) | ||
111 | 'face '(:inherit italic)) | ||
112 | fmt)))) | ||
113 | ;; modes to disable | ||
114 | (dolist (mode '(display-fill-column-indicator-mode | ||
115 | simple-modeline-mode)) | ||
116 | (when (fboundp mode) | ||
117 | (funcall mode -1))) | ||
118 | ;; modes to enable | ||
119 | (dolist (mode '(iscroll-mode | ||
120 | olivetti-mode)) | ||
105 | (when (fboundp mode) | 121 | (when (fboundp mode) |
106 | (funcall mode +1)))) | 122 | (funcall mode +1)))) |
107 | ;; turn off | 123 | ;; turn off |
108 | (display-fill-column-indicator-mode +1) | 124 | ;; settings |
109 | (dolist (mode '(visual-fill-column-mode | 125 | (kill-local-variable 'mode-line-format) |
126 | ;; modes to re-enable | ||
127 | (dolist (mode '(display-fill-column-indicator-mode | ||
128 | simple-modeline-mode)) | ||
129 | (when (fboundp mode) | ||
130 | (funcall mode +1))) | ||
131 | ;; modes to re-disable | ||
132 | (dolist (mode '(olivetti-mode | ||
110 | iscroll-mode)) | 133 | iscroll-mode)) |
111 | (when (fboundp mode) | 134 | (when (fboundp mode) |
112 | (funcall mode -1))))) | 135 | (funcall mode -1))) |
136 | (force-mode-line-update))) | ||
113 | 137 | ||
114 | ;;; Keymap & Mode | 138 | ;;; Keymap & Mode |
115 | 139 | ||