[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

flyspell.el and non-word characters in CASECHARS

From: Eli Zaretskii
Subject: flyspell.el and non-word characters in CASECHARS
Date: Mon, 16 Apr 2012 22:55:37 +0300

In flyspell.el:flyspell-check-pre-word-p we have this snippet:

   ((or (and (= flyspell-pre-point (- (point) 1))
             (eq (char-syntax (char-after flyspell-pre-point)) ?w))
        (= flyspell-pre-point (point))
        (= flyspell-pre-point (+ (point) 1)))
   ((and (symbolp this-command)
         (not executing-kbd-macro)
         (or (get this-command 'flyspell-delayed)
             (and (get this-command 'flyspell-deplacement)
                  (eq flyspell-previous-command this-command)))
         (or (= (current-column) 0)
             (= (current-column) flyspell-pre-column)
             ;; 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)))

I think it's wrong to test for word syntax here; we should test for a
match against CASECHARS, or maybe even CASECHARS and OTHERCHARS.
These are what defines a "word" in this context, because flyspell must
be consistent with what the speller does.

I bumped into this spell-checking Hebrew text with Hunspell: the he_IL
dictionary considers " and ' be WORDCHARS (they are indeed used as
part of words of foreign origin and in acronyms), but typing these
characters under flyspell-mode immediately marks the preceding word as
a typo, although self-insert-command is in
flyspell-default-delayed-commands, and so should have triggered a
3-sec delay in spell-checking, letting me to continue typing.  If I
use a match against CASECHARS instead of the word syntax, the problem
goes away.

Am I missing something?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]