textmodes/flyspell.el: Delay for otherchars as for normal word components.
authorAgustín Martín <agustin.martin@hispalinux.es>
Wed, 16 May 2012 08:35:11 +0000 (10:35 +0200)
committerAgustín Martín <agustin.martin@hispalinux.es>
Wed, 16 May 2012 08:35:11 +0000 (10:35 +0200)
(flyspell-check-pre-word-p,
 flyspell-check-word-p,
 flyspell-debug-signal-word-checked):

Use for otherchars the same delay used for other word components, so word
is not inmediately checked unless we are in a char that is neither a normal
word component nor an otherchar.

lisp/ChangeLog
lisp/textmodes/flyspell.el

index cec6cdc..60b238e 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-16  Agustín Martín Domingo  <agustin.martin@hispalinux.es>
+
+       * flyspell.el (flyspell-check-pre-word-p, flyspell-check-word-p)
+       (flyspell-debug-signal-word-checked): Delay for otherchars as for
+       normal word components.
+
 2012-05-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el (completion--sifn-requote): Fix last change.
index 33fa551..156a7e5 100644 (file)
@@ -739,7 +739,10 @@ before the current command."
         (eq flyspell-pre-pre-buffer flyspell-pre-buffer))
     nil)
    ((or (and (= flyspell-pre-point (- (point) 1))
-            (eq (char-syntax (char-after flyspell-pre-point)) ?w))
+            (or (eq (char-syntax (char-after flyspell-pre-point)) ?w)
+                (string-match-p (ispell-get-otherchars)
+                                (buffer-substring-no-properties
+                                 flyspell-pre-point (1+ flyspell-pre-point)))))
        (= flyspell-pre-point (point))
        (= flyspell-pre-point (+ (point) 1)))
     nil)
@@ -753,7 +756,10 @@ before the current command."
             ;; If other post-command-hooks change the buffer,
             ;; flyspell-pre-point can lie past eob (bug#468).
             (null (char-after flyspell-pre-point))
-            (eq (char-syntax (char-after flyspell-pre-point)) ?w)))
+            (or (eq (char-syntax (char-after flyspell-pre-point)) ?w)
+                (string-match-p (ispell-get-otherchars)
+                                (buffer-substring-no-properties
+                                 flyspell-pre-point (1+ flyspell-pre-point))))))
     nil)
    ((not (eq (current-buffer) flyspell-pre-buffer))
     t)
@@ -815,6 +821,7 @@ Mostly we check word delimiters."
         (save-excursion
           (backward-char 1)
           (and (looking-at (flyspell-get-not-casechars))
+               (not (looking-at (ispell-get-otherchars)))
                (or flyspell-consider-dash-as-word-delimiter-flag
                    (not (looking-at "-"))))))
     ;; yes because we have reached or typed a word delimiter.
@@ -880,6 +887,7 @@ Mostly we check word delimiters."
                                     (save-excursion
                                       (backward-char 1)
                                       (and (and (looking-at (flyspell-get-not-casechars)) 1)
+                                           (not (looking-at (ispell-get-otherchars)))
                                            (and (or flyspell-consider-dash-as-word-delimiter-flag
                                                     (not (looking-at "\\-"))) 2))))))
                          c))))
@@ -895,6 +903,7 @@ Mostly we check word delimiters."
                                       (save-excursion
                                         (backward-char 1)
                                         (and (looking-at (flyspell-get-not-casechars))
+                                             (not (looking-at (ispell-get-otherchars)))
                                              (or flyspell-consider-dash-as-word-delimiter-flag
                                                  (not (looking-at "\\-"))))))))
                            c))