add comments and a known bug on repeated words
[spray] / spray.el
index afefae2541f06ae66cc38f2af4e5da1e9967c3f9..4d55fbce9dec1cd791c52e5ce3d32cca0bd8e780 100644 (file)
--- a/spray.el
+++ b/spray.el
 ;;
 ;; For more informations, see Readme.org.
 
+;; Known bugs.
+;; repeated words are indistinguishable, for example
+;; "going, going, gone" reads like going, gone, with a slight delay.
+
 ;;; Change Log:
 ;; 0.0.0 test release
 ;; 0.0.1 add spray-set-margins
                                              buffer-face-mode
                                              buffer-face-mode-face)
                spray--saved-smartparens-enabled (and (boundp 'smartparens-mode)
-                                                     smartparens-mode))
+                                                     smartparens-mode)
+               spray--saved-highlight-symbol-enabled (and (boundp 'highlight-symbol-mode)
+                                                     highlight-symbol-mode))
          ;; smartparens wrapping of all letter binds can cause problems.
          ;; for example, it can cause auto-complete to activate
          (and spray--saved-smartparens-enabled (smartparens-mode -1))
+         (and spray--saved-highlight-symbol-enabled (highlight-symbol-mode -1))
          (setq cursor-type nil)
          (let ((buffer-face-mode-face `(:height ,spray-height)))
            (buffer-face-mode 1))
          (spray-start))
         (t
          (and spray--saved-smartparens-enabled (smartparens-mode 1))
+         (and spray--saved-highlight-symbol-enabled (highlight-symbol-mode 1))
          (setq cursor-type spray--saved-cursor-type)
          (if spray--saved-restriction
              (narrow-to-region (car spray--saved-restriction)
                        ((6 7 8 9) 3)
                        ((10 11 12 13) 4)
                        (t 5)))))
+    ;; this fairly obfuscated, using magic numbers to store state
+    ;; it would be nice to sometime patch this so it is more readable.
+    ;; for greater than 9 length, we display for twice as long
+    ;; for some punctuation, we display a blank
     (setq spray--delay (+ (if (> len 9) 1 0)
                           (if (looking-at "\n[\s\t\n]") 3 0)
                           (cl-case (char-before)