[Top][All Lists]

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

Re: flypell and check-comments.

From: martin rudalics
Subject: Re: flypell and check-comments.
Date: Sun, 11 Mar 2007 20:52:43 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

>>since on the one hand you don't check for `ispell-check-comments' being
>>eq to 'exclusive
> I don't think it matters. At least, if it has to be fixed, it's not
> here, but maybe in `flyspell-generic-progmode-verify'. Well, I don't
> really know.

As far as I understand this, `ispell-check-comments' t means check
comments too, 'exclusive means check comments only, somehow inverting
the sense of nil.  When using faces, nil means don't check when the face
is font-lock-comment-face, 'exclusive means check iff the face is
font-lock-comment-face, t means faces don't matter.  When using
parse-state it's equally simple: nil means don't check for (nth 4
parse-state), exclusive means check iff (nth 4 parse-state), and t means
parse-state doesn't matter.  Trivial.

>>while on the other hand you don't check whether you're in a string
>>(hence you don't fully emulate the default of
>>`flyspell-prog-text-faces' either).
> I don't understand, why should I check that I'm in a string?

Because the default value of `flyspell-prog-text-faces' has
`font-lock-string-face', `font-lock-comment-face' and
`font-lock-doc-face'.  To emulate this you would have to spell-check iff
either (nth 3 parse-state) or (nth 4 parse-state) hold.  If a user
wanted to spell-check doc-strings only this wouldn't work though.

>>Also `syntax-ppss' may get expensive for `flyspell-large-region'.  It's
>>generally better to use it for the first position only, save position
>>and parse-state, and then do `parse-partial-sexp' from the last saved
>>position and parse-state.
> I probably agree :) However, I don't really see how this can be
> implemented. If ispell has to be mimicked, maybe the test should be
> made using comment-start -- comment-end, but not sure.

It would have to be done in `flyspell-external-point-words' before
`flyspell-word' is called.  Never mind.  If there are few spelling
errors `syntax-ppss' might be even faster.

>>Hence, IMHO ignoring `ispell-check-comments' here is a viable
>>alternative as well.
> Well, this is not just for the fun to make a patch, I really want to
> use `ispell-check-comments' (to nil).

In that case you should probably implement the 'exclusive option as
well.  Otherwise you should insert a note about this.

reply via email to

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