summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
authorCase Duckworth2021-09-28 10:02:16 -0500
committerCase Duckworth2021-09-28 10:02:16 -0500
commitbdb11fee694e9ff59caec849e299c5da34fc7d8a (patch)
tree2f5cdb1125d1ea76734951cf85ded23db0ec1eea /lisp
parentMove word count in modeline (diff)
parentIgnore a couplea modes with dogears-mode (diff)
downloademacs-bdb11fee694e9ff59caec849e299c5da34fc7d8a.tar.gz
emacs-bdb11fee694e9ff59caec849e299c5da34fc7d8a.zip
Merge branch 'main' of tildegit.org:acdw/emacs
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw-cus-edit.el2
-rw-r--r--lisp/acdw-reading.el42
-rw-r--r--lisp/acdw-setup.el7
3 files changed, 37 insertions, 14 deletions
diff --git a/lisp/acdw-cus-edit.el b/lisp/acdw-cus-edit.el index c40f137..89273f0 100644 --- a/lisp/acdw-cus-edit.el +++ b/lisp/acdw-cus-edit.el
@@ -28,5 +28,5 @@
28 1)) 28 1))
29 "Show faces and variables in `imenu'.") 29 "Show faces and variables in `imenu'.")
30 30
31(provide 'acdw/cus-edit) 31(provide 'acdw-cus-edit)
32;;; acdw-cus-edit.el ends here 32;;; acdw-cus-edit.el ends here
diff --git a/lisp/acdw-reading.el b/lisp/acdw-reading.el index 26ee5e8..e0a7f74 100644 --- a/lisp/acdw-reading.el +++ b/lisp/acdw-reading.el
@@ -11,8 +11,17 @@
11;; - Don't hurt yourself. 11;; - Don't hurt yourself.
12;; - Make good choices. 12;; - Make good choices.
13 13
14;;; Commentary:
15
16;; here is my attempt at a reading mode.
17
14;;; Code: 18;;; Code:
15 19
20(require 'olivetti)
21
22(defvar-local //indicate-empty-lines nil)
23(defvar-local //indicate-buffer-boundaries nil)
24
16;;;###autoload 25;;;###autoload
17(define-minor-mode reading-mode 26(define-minor-mode reading-mode
18 "A mode for reading." 27 "A mode for reading."
@@ -22,30 +31,37 @@
22 (if reading-mode 31 (if reading-mode
23 (progn ;; turn on 32 (progn ;; turn on
24 ;; settings 33 ;; settings
25 (setq-local orig-indicate-empty-lines indicate-empty-lines 34 (setq-local //indicate-empty-lines indicate-empty-lines
26 indicate-empty-lines nil 35 indicate-empty-lines nil
27 orig-indicate-buffer-boundaries indicate-buffer-boundaries 36 //indicate-buffer-boundaries indicate-buffer-boundaries
28 indicate-buffer-boundaries nil) 37 indicate-buffer-boundaries nil)
29 ;; disable modes 38 ;; disable modes
30 (dolist (mode '(display-fill-column-indicator-mode)) 39 (dolist (mode '(display-fill-column-indicator-mode
40 blink-cursor-mode))
31 (when (fboundp mode) 41 (when (fboundp mode)
42 (set (make-local-variable
43 (intern (format "//%s" mode)))
44 (symbol-value mode))
32 (funcall mode -1))) 45 (funcall mode -1)))
33 ;; enable modes 46 ;; enable modes
34 (dolist (mode '(olivetti-mode)) 47 (dolist (mode '(olivetti-mode))
35 (when (fboundp mode) 48 (when (fboundp mode)
49 (set (make-local-variable
50 (intern (format "//%s" mode)))
51 (symbol-value mode))
36 (funcall mode +1)))) 52 (funcall mode +1))))
37 ;; turn off 53 ;; turn off
38 ;; settings 54 ;; restore settings
39 (setq-local indicate-empty-lines orig-indicate-empty-lines 55 (setq-local indicate-empty-lines //indicate-empty-lines
40 indicate-buffer-boundaries orig-indicate-buffer-boundaries) 56 indicate-buffer-boundaries //indicate-buffer-boundaries)
41 ;; enable modes 57 ;; restore modes
42 (dolist (mode '(display-fill-column-indicator-mode)) 58 (dolist (mode '(display-fill-column-indicator-mode
43 (when (fboundp mode) 59 olivetti-mode
44 (funcall mode +1))) 60 blink-cursor-mode))
45 ;; disable modes
46 (dolist (mode '(olivetti-mode))
47 (when (fboundp mode) 61 (when (fboundp mode)
48 (funcall mode -1))))) 62 (funcall mode (if (symbol-value (intern (format "//%s" mode)))
63 +1
64 -1))))))
49 65
50(provide 'acdw-reading) 66(provide 'acdw-reading)
51;;; acdw-reading.el ends here 67;;; acdw-reading.el ends here
diff --git a/lisp/acdw-setup.el b/lisp/acdw-setup.el index cd3807d..e271faa 100644 --- a/lisp/acdw-setup.el +++ b/lisp/acdw-setup.el
@@ -11,8 +11,15 @@
11;; - Don't hurt yourself. 11;; - Don't hurt yourself.
12;; - Make good choices. 12;; - Make good choices.
13 13
14;;; Commentary:
15
16;; setup.el makes defining local macros for `setup' forms quite simple, at
17;; least to my mind. Here are some of the ones I've defined.
18
14;;; Code: 19;;; Code:
15 20
21(require 'setup)
22
16(setup-define :autoload 23(setup-define :autoload
17 (lambda (func) 24 (lambda (func)
18 (if (listp func) 25 (if (listp func)