Subject: Re: bug#4511: 23.1; flyspell-mode slow editing near end of big html file

From: Kevin Ryde <[email-masked]>
Date: Sat, 17 Oct 2009 08:57:06 +1100

Stefan Monnier <[email-masked]> writes:
>
> The given regexp is actually plenty, in this respect.  It's just that
> looking-back is a dog and doesn't make good use of the regexp.

Oh, well, I suppose a genuine reverse matcher could do the right thing,
probably if "<" was added to the exclusions like "<[^<>\n]*" -- not that
that helps since there isn't a reverse matcher :-).

But on the principle "why can't someone else do it", what about letting
`sgml-lexical-context' determine the context.  Tested only briefly:

(defun sgml-mode-flyspell-verify ()
  "Function used for `flyspell-generic-check-word-predicate' in SGML mode."
  (not (memq (car (sgml-lexical-context))
             '(tag pi))))

Seems fast enough for me, and I think it means CDATA text is checked,
which I think would be desirable, but I'm not well up on that stuff.