From: Ian Kelling Date: Thu, 26 Jun 2014 03:58:46 +0000 (-0400) Subject: Merge remote-tracking branch 'oscarfv/faster-slower' X-Git-Url: https://iankelling.org/git/?p=spray;a=commitdiff_plain;h=1a3c073590df736dd38a2f25e6c67d5e9694102d;hp=-c Merge remote-tracking branch 'oscarfv/faster-slower' --- 1a3c073590df736dd38a2f25e6c67d5e9694102d diff --combined spray.el index bbc15be,48819cb..77df087 --- a/spray.el +++ b/spray.el @@@ -54,6 -54,8 +54,8 @@@ (define-key km (kbd "l") 'spray-forward-word) (define-key km (kbd "") 'spray-backward-word) (define-key km (kbd "") 'spray-forward-word) + (define-key km (kbd "f") 'spray-faster) + (define-key km (kbd "s") 'spray-slower) km) "keymap for spray-mode buffers") @@@ -62,15 -64,13 +64,15 @@@ (make-face 'spray-base-face) (set-face-attribute 'spray-base-face nil :background (face-background 'default) - :foreground (face-foreground 'default)) + :foreground (face-foreground 'default) + :slant 'normal) (make-face 'spray-orp-face) (set-face-attribute 'spray-orp-face nil :foreground "red" :overline (face-foreground 'default) - :underline (face-foreground 'default)) + :underline (face-foreground 'default) + :slant 'normal) ;; * internal vars @@@ -200,6 -200,32 +202,32 @@@ an integer or a float value. (skip-chars-backward "\s\t\n") (spray--word-at-point)) + (defun spray-faster () + "Increases speed. + + Increases the wpm (words per minute) parameter. See the variable + `spray-wmp'." + (interactive) + (spray-inc-wpm 20)) + + (defun spray-slower () + "Decreases speed. + + Decreases the wpm (words per minute) parameter. See the variable + `spray-wmp'." + (interactive) + (spray-inc-wpm -20)) + + (defun spray-inc-wpm (delta) + (let ((was-running spray--running)) + (spray-start/stop -1) + (when (< 10 (+ spray-wpm delta)) + (setq spray-wpm (+ spray-wpm delta))) + (spray-backward-word) + (message "spray wpm: %d" spray-wpm) + (when was-running + (spray-start/stop 1)))) + ;; * provide (provide 'spray)