Skip to content

feat: native windows provider - #436

Merged
rrthomas merged 1 commit into
rrthomas:mainfrom
Kneemund:feature/win8-provider
Jul 4, 2026
Merged

feat: native windows provider#436
rrthomas merged 1 commit into
rrthomas:mainfrom
Kneemund:feature/win8-provider

Conversation

@Kneemund

@Kneemund Kneemund commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

This PR adds a provider for the native spellchecking added in Windows 8. Deleting words from the session (optionally) requires at least Windows 10. Closes #52.

I spent quite some time fighting the build system. The squashed changes seem idiomatic to me. I'd appreciate some feedback on that ;)

The CI on Windows is currently failing due to a bug in the CLI. This is fixed by the PR #439.

Licensing

I'm by no means an expert at licenses, but here is the way that I see things. This should definitely be double-checked by someone other than me.

The new provider uses the bcp47 module from gnulib to convert between BCP47 language tags (which Windows uses) and XPG/POSIX language tags (which all other providers use). This module is licensed under LGPLv3+. The source code of the provider is licensed under MIT. That makes the whole provider derived work and thus also LGPLv3+.

I think that enchant itself stays LGPLv2+, since the provider is loaded dynamically and not at all a core component.

In the process, I had to loosen the LGPL restriction of gnulib_tool (see 4f9ac6b) so that it can include any LGPL licensed modules, not just LGPLv2 licensed ones. That means that we have to be more careful about the modules we use in the future. I don't know if we can somehow limit this to just the new provider. We would probably need an entirely separate build step.

TODOs

  • Use a better name and description for the provider. win8 sounds like it only works on Windows 8. Suggestions would be very welcome.

@rrthomas

Copy link
Copy Markdown
Owner

This is amazing to have, many thanks! I must apologise that you've caught me at a moment where I'm unable to be likely to look at it in a matter of days, and possibly not weeks, so do ping me if you don't hear for a while, but rest assured it is something I really want to land.

Thanks in particular for taking care with the build system and checking the situation with the tests and CI.

@Kneemund
Kneemund force-pushed the feature/win8-provider branch from 26f76e6 to 4c1b409 Compare January 26, 2026 16:23
@rrthomas

Copy link
Copy Markdown
Owner

I've had a quick look at this. I agree the name should be changed, because it should reflect the interface, not the version of Windows. It's unfortunate that the type is ISpellChecker, which sounds too much like the venerable "ispell". It's similarly unfortunate that the header file is just called spellcheck.h.

How about winspell, by analogy with "applespell", which has similar internal problems of genericity?

Please can you squash all of the commits that deal with the provider itself into one?

Please can you also remove the commits that have nothing to do with the provider? They can be the subject of other PRs. (Although for example, I don't think adding APPLESPELL_LIBS makes sense, as there is no such variable, so that commit can be discarded.)

@Kneemund
Kneemund force-pushed the feature/win8-provider branch from 4f9ac6b to 0db166b Compare February 16, 2026 20:15
@rrthomas

Copy link
Copy Markdown
Owner

Thanks for the update, and again apologies for my slowness with this.

@Kneemund

Copy link
Copy Markdown
Contributor Author

No problem, thank you for the feedback. I will squash these changes soon, I'll also create some PRs with the other changes.

@Kneemund
Kneemund force-pushed the feature/win8-provider branch from 84d36ea to c5e677a Compare February 16, 2026 21:06
@Kneemund

Copy link
Copy Markdown
Contributor Author

Alright, I think this PR is ready for review once again. I've removed all the unrelated changes.

Are you sure that all of these commits should be squashed? Wouldn't it make more sense to squash them when merging the PR (using the GitHub UI)?

@Kneemund
Kneemund force-pushed the feature/win8-provider branch from c5e677a to 177c76c Compare February 16, 2026 21:37
@rrthomas

Copy link
Copy Markdown
Owner

Are you sure that all of these commits should be squashed? Wouldn't it make more sense to squash them when merging the PR (using the GitHub UI)?

Maybe not all commits, but any commits that fix code in earlier commits, if you've not done that already. So specifically I would not expect to see any "fix" commits that fix code introduced in this PR.

@Kneemund
Kneemund force-pushed the feature/win8-provider branch from 177c76c to 9448588 Compare February 16, 2026 22:13
@Kneemund

Copy link
Copy Markdown
Contributor Author

Alright, I think the commits are somewhat reasonable now.

@Kneemund

Kneemund commented Apr 1, 2026

Copy link
Copy Markdown
Contributor Author

@rrthomas Do you have time (and motivation) to take another look? It's fine if you don't, I just saw this PR on my GitHub home page and was reminded.

@rrthomas

rrthomas commented Apr 2, 2026

Copy link
Copy Markdown
Owner

@rrthomas Do you have time (and motivation) to take another look? It's fine if you don't, I just saw this PR on my GitHub home page and was reminded.

No time at present, but I'm still motivated, and it's on my list! Sorry for the delay.

@rrthomas
rrthomas force-pushed the main branch 8 times, most recently from fff4d51 to 90e4f33 Compare July 3, 2026 21:31
@rrthomas
rrthomas force-pushed the feature/win8-provider branch from 9448588 to 688a398 Compare July 3, 2026 21:40
@rrthomas

rrthomas commented Jul 3, 2026

Copy link
Copy Markdown
Owner

I've finally found some time to work on non-trivial Enchant issues, and after a while working on easier things, came to this!

Thanks very much again for working on this, @Kneemund.

I would be very grateful if you confirm it seems to be working OK for you in its current form (I have rebased on main and squashed the commits of this PR).

There's one small but annoying thing I don't like: I don't want to change bootstrap.conf to --lgpl[=3] just for the sake of one provider. Since each provider is a separate library, I don't believe that building the WinSpell provider forces libenchant to be under the LGPLv3.

But more importantly, I want to keep the check that other modules are not being mistakenly linked against LGPLv3-only gnulib modules.

I can't think of an easier way to fix this than to have a special gnulib installation just for the WinSpell provider. Can you? Don't worry, I don't expect you to implement that; I've already got another project with multiple libgnu's, so I can copy that.

@rrthomas
rrthomas force-pushed the feature/win8-provider branch 2 times, most recently from 677f26f to c22f993 Compare July 3, 2026 22:13
@rrthomas

rrthomas commented Jul 3, 2026

Copy link
Copy Markdown
Owner

The author of the bcp47 module, Bruno Haible, bless him, has relicensed it under LGPLv2.1+, so that problem is gone.

@rrthomas
rrthomas force-pushed the main branch 3 times, most recently from 749980b to ce27804 Compare July 3, 2026 23:56
@rrthomas
rrthomas force-pushed the feature/win8-provider branch 4 times, most recently from c9263cc to b9c33bd Compare July 4, 2026 16:19
@rrthomas
rrthomas force-pushed the main branch 4 times, most recently from 8ec3dae to 972ba3b Compare July 4, 2026 17:18
@Kneemund

Kneemund commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and working on this! I just compiled and tested the latest version on my Windows installation and it works fine.

enchant-lsmod-2.exe -list-dicts
> enchant-lsmod-2.exe -list-dicts
de_AT (winspell)
de_CH (winspell)
de_DE (winspell)
de_LI (winspell)
de_LU (winspell)
en_CA (winspell)
en_LR (winspell)
en_PH (winspell)
en_US (winspell)
enchant-2.exe -l -L --dictionary=en_US README.md
> enchant-2.exe -l -L --dictionary=en_US README.md
1 libenchant
4 rrthomas
4 github
5 github
5 rrthomas
7 libenchant
22 Hunspell
22 Myspell
23 Nuspell
24 Aspell
25 Hspell
26 Voikko
28 WinSpell
29 Zemberek
31 Vala
35 doxygen
41 tarball

@rrthomas

rrthomas commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Thanks for confirming. I'll make a release.

@rrthomas
rrthomas force-pushed the feature/win8-provider branch from b9c33bd to 6dafab0 Compare July 4, 2026 22:17
@rrthomas
rrthomas merged commit 2b26d6e into rrthomas:main Jul 4, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows 8+ native spell checker support

2 participants