X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=spray.el;h=10b44416706aade28d08720c460e9b1ec47a3e58;hb=791a518272c6bec8671b66cdcd08ee07b6c447e3;hp=7d42d01a39dcd0011e50af869c095503f5b8a1a8;hpb=e2beca4dfeff3f26ea1c8960c3c39a7b9ba9b1c7;p=spray diff --git a/spray.el b/spray.el index 7d42d01..10b4441 100644 --- a/spray.el +++ b/spray.el @@ -1,7 +1,12 @@ ;; custom -(defvar spray-freq (/ 60.0 400) "60.0 / WPM") +(defvar spray-wpm 400 "words/min") (defvar spray-text-scale 5) -(defvar spray-orp-face 'error) + +(make-face 'spray-orp-face) +(set-face-attribute 'spray-orp-face nil + :foreground "red" + :underline (face-foreground 'default) + :overline (face-foreground 'default)) ;; internal variables for spraying (defvar spray--padding-overlay nil) @@ -22,11 +27,11 @@ (cond (spray-mode (setq spray--orp-overlay (make-overlay 0 0) spray--padding-overlay (make-overlay 0 0) - spray--timer (run-with-timer 0 spray-freq 'spray-next) + spray--timer (run-with-timer 0 (/ 60.0 spray-wpm) 'spray-next) spray--saved-cursor-type cursor-type) (setq cursor-type nil) (text-scale-set spray-text-scale) - (overlay-put spray--orp-overlay 'face spray-orp-face) + (overlay-put spray--orp-overlay 'face 'spray-orp-face) (add-hook 'pre-command-hook 'turn-off-spray-mode) ;; disable incompatible minor-modes (when (boundp 'global-hl-line-mode)