Re: commit: persistent ignored words


Subject: Re: commit: persistent ignored words
From: Paul Rohr (paul@abisource.com)
Date: Tue Mar 27 2001 - 16:56:07 CST


At 11:48 PM 3/24/01 -0800, WJCarpenter wrote:
>Fixes up various things in the maintenance of ispell's ignored words
>list and also implements persisting the "Ignore All" list to the
>document file. The "ignore all" word list now acts like a persistent,
>per-document custom dictionary.

Woo-hoo! Thanks for checking this in. For one of the documents I've been
dogfooding recently, I've been really missing the feature. It's definitely
time to rebuild.

>The signature of enumIgnores() was changed because the signature it
>had would have been ineffective. (enumIgnores() was not previously
>called, but is called now for a UT_DEBUGMSG() in the AD_Document
>destructor.)

Sorry about that. I left that method in there to allow someone to implement
this feature, but was in enough of a hurry that I didn't give it much
thought.

>Fixed a sort of interesting problem about duplicate entries. When you
>"ignore all" on some word, spell-check queues all the blocks in a
>document for re-spell-checking. That's done in the background. For a
>long document, it's easy to do "ignore all" on another instance of the
>same word before the squiggle is removed.

Drat! As the comments make clear, I *knew* I should've implemented that
feature so it removed the current squiggle before queueing the rest of the
document.

Again, thanks for the fix.

>That leads to an attempt at
>adding a duplicate entry to the hash table, and that leads to an
>assert. The assert looks harmless to me, but since hash tables are
>used all over the place, I didn't remove it. Instead, I made ignored
>word maintenance check for an entry before trying to add it.

Actually, I think Sam ran across a related bug recently where a word got
added twice to the custom dictionary, causing problems the next time it got
loaded. The fix should be identical.

>Added two preference variables, SpellCheckIgnoredWordsSave and
>SpellCheckIgnoredWordsLoad (sorry, no GUI for any platform). As a
>side effect of the implementation to use those preferences,
>PD_Document and AP_Convert objects now have an XAP_App pointer (and a
>getApp()). The means that lots of new places (including the
>import/export code) can now access the user preferences. Go hog wild.

What are the semantics of these? Can they be used to implement the "flush"
button I've mentioned previously (which empties the ignore list to allow
those words to be rechecked)?

>Ignored words are saved in a bit of XML that looks like this:
>
> <ignoredwords>
> <iw>sumthing</iw>
> <iw>utherthing</iw>
> </ignoredwords>
>
>The <ignoredwords> tag is at the same level as <section> and <style>.

Sweet.

Paul



This archive was generated by hypermail 2b25 : Tue Mar 27 2001 - 16:50:05 CST