Wednesday, July 08, 2009

Followup on Kate's on-the-fly spellchecking

As there was a lot of feedback in the last blog, I'll answer some of the questions here.

> Where can I get this patch?
The relevant subversion revisions are r992778, r992779, r992780, r992784.

> Will it be available in 4.3, or only in 4.4?
As KDE 4.3 will be released end of the month, this feature will be available in KDE 4.4 and not earlier.

> Please, please tell me that it's powered by Sonnet, one of the most awaited KDE4 pillar by me...
Yes, it uses Sonnet :)
The old spellcheck dialog however still uses the old spellchecking code without Sonnet. Any volunteers to port this? Also, the on-the-fly spellchecking needs to be more configurable in Kate's config dialog, e.g. selecting the correct language.

> Thanks so much, this was the feature I was mostly longing for in kate.
Yes, it is one of the oldest reports with 1245 votes!

> What languages are supported support?
On-the-fly spellchecking works if the specific itemDatas are marked with spellChecking="true" or "1" in the xml highlighting definition files. UPDATE: On-the-fly spellchecking is enabled for all itemDatas by default in the xml highlighting defintion files. To disable it, you have to add spellChecking="false" or "0" to an itemData, e.g. at the end of the cpp.xml file:

<itemDatas>
<itemData name="Normal Text" spellChecking="0" />
...
<itemData name="String" />
<itemData name="String Char" spellChecking="0" />
<itemData name="Comment" />
<itemData name="Symbol" spellChecking="0" />
...
</itemData>

So we have to go through all .xml files and change the relevant parts in the itemDatas section. And that's where we need your help, as we don't know all the languages :) ...and if you want to test this feature, you first have to enable it in Tools > On-the-fly spellchecking.
PS: Is there a better name? Maybe Inline spellchecking? Any linguistic experts around? :)

12 comments:

Shyru said...

Great!
Btw, no need to call it "On-the-fly spellechecking". - Just call it "Spellchecking". Its what it is called in other applications, and it does not imply that you cannot manually run a spellcheck via the toolbar/whatever, if it is not checked, so the name should be sufficient clear.

Anonymous said...

Is it feasible (i.e. without too much effort) to backport this feature to KDE 4.3 at a later stage (e.g. 4.3.1)?

Fabien said...

Great !

You might want to take a look at the text editor of Eclipse wich provides the same feature with some configurations options :
"ignore words with digits" (boolean)
"ignore mixed case words" (boolean)
"ignore internet adresses" (boolean)
"ignore single letters" (boolean)
"ignore upper case words" (boolean)
All of them are checked by default.
This can be useful for source files, as this would prevent the spellchecker to underline 75% of the variable names.

The Eclipse Java ide can also spellcheck variable and class names when they are CamelCased. For example :
thisIsGood will not be underlined, but thisIsBaaaaaad will.

Anonymous said...

I should have added this before:

Great work! I will use this feature a lot! Thanks!

Ben Cooksley said...

You can probably just remove the spell check configuration as that is handled in System Settings.

I don't know if that KCM has a maintainer however.

Karthikeyan said...

M$ Word calls this feature as "Spell Check as you type" or "Inline Spellchecking" is neat

johnny_boy said...

Now that it exists, how do you enable the patch?

dhaumann said...

It's only available in KDE >= 4.4.
There it's in the menu Tools > Automatic Spell Checking.

johnny_boy said...

I'm a little weary of updating to KDE 4.4 RC just to get auto spellchecking in Kate. I suppose there's no straightforward way of doing getting it without completely updating KDE or kdebase or kdelibs? I'm running Kubuntu 9.10.

dhaumann said...

Just wait a month to February and KDE 4.4 will officially be released. I don't recommend to install the first release candidate for day-to-day use. And updating Kate only does not really work.

(Of course you can compile everything yourself and then only start Kate from this build)

Unknown said...

Hi,
I came across your blog in search for this feature in Kile. I am using KDE 4.4.4, Kile 2.0.85 (Fedora 13) but I can't get Kile to ignore LaTeX commands.
Any ideas?
Cheers!

dhaumann said...

Wil: Sounds like you use an old latex.xml file for highlighting. Please serach for latex.xml and tell me what version it is.