emacs-devel
[Top][All Lists]
Advanced

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

Re: flyspell.el and non-word characters in CASECHARS


From: Agustin Martin
Subject: Re: flyspell.el and non-word characters in CASECHARS
Date: Tue, 17 Apr 2012 19:26:36 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Apr 16, 2012 at 10:55:37PM +0300, Eli Zaretskii wrote:
> 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)))
>     nil)
>    ((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)))
>     nil)
> 
> 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?

The only reason I can think is that at that time there is no way to know if
that wordchar is going to be in the middle of a word or not. If it appears
at a word boundary, is not what ispell.el seems to consider a wordchar.
Did your test work only with CASECHARS instead of CASECHARS+OTHERCHARS?

For the records, I see the same problem in other languages for valid words
including "otherchars". Since I was recently playing with Catalan I tried
with "intel┬Ěligent", just after typing the middledot "intel" is marked as
typo and only when I finish correctly typing word the mark disappear.

-- 
Agustin



reply via email to

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