[PATCH] Hspell plugin for KSpell2

Mashrab Kuvatov kmashrab at sat.physik.uni-bremen.de
Sat Apr 30 23:31:56 BST 2005


On Friday 29 April 2005 20:29, Nadav Har'El wrote:
> Thanks for writing the patches.
>
> On Fri, Apr 29, 2005, Mashrab Kuvatov wrote about "[PATCH] Hspell plugin for 
KSpell2":
> >...
> > Second, to be able to link against libhspell, one has to modify hspell.h
> > i.e. add extern "C" stuff (thanks Oliver for tip!). One can get a
> > modified copy from [1]. Hspell devs, please add it in next release, if
> > you want C++ junkies use your lib. :-)
>
> Why? What's wrong with C++ junkies knowing that this is a C library, and
> therefore they need to do
>
> extern "C" {
> #include <hspell.h>
> }
>
> I believe that C++ users are already used to doing that for other libraries
> written in C. There's certainly no reason to change the .h file!
>
> Anyway, nO ".h" file of a C library will have this "extern C" stuff in it,
> as this is NOT a legal C construct...

Well, grep "extern \"C\"" /usr/include/* shows dozen, zlib and libpng to name
a few.

> The most we can do is to add some 
> sort of ugly (because it's not portable) conditional code like
>
> 	#ifdef __cplusplus
> 	extern "C" {
> 	#endif
> 	...
>
> to the header file,

That's what I meant and did. One could see it, if one looked at the hspell.h I
referenced.

> but again I don't really see the point. 

It is recommended (see Program-Library-HOWTO, C++ vs. C) and convenient for
the users of the lib way of writing libs. You are not obliged to provide such
a service, however. I just nicely asked to do so.

> > Hopefully, people who speak Hebrew will comment whether it makes sense.
>
> I think Dan already commented on this.

Meni found a bug and it is fixed.

> > I'm not going to commit it. As a lib, hspell is missing a key feature -
> > add to dictionary. I think, without this feature it is just irresponsible
> > to give KSpell2 with it to user. It will save a lot of energy one has to
> > spend to explain a user that actually the add-to-dict button is not
> > broken in KDE, but it is a lib which cannot handle it. Hopefully, hspell
> > devs will add it in next releases.
>
> This is a delicate issue. We understand this need, but also the opposite
> view also has merit; Our current implementation assumes that the user's
> personal dictionary should be handled by the calling program, NOT by
> Hspell.

<snip>

> But, we may reconsider this decision, especially if we understand more
> about the needs of spell-checking library users. Doesn't KDE keep its
> own list of correct words? Or does it assume that every spell-checking
> library keep its own list?

Zack can comment on it better than anyone else, he is the one behind the
KSpell2.

> > IHMO, there should be a kind of rule, a barrier I'd say, saying if your
> > lib does not have this and that, do not even think of being a plugin in
> > KSpell2. This will motivate spellcheck lib devs. :-)
>
> Naturally, Hspell (the command line program, not the library) *does* have
> personal dictionary handling. If someone cared enough, this trivial code
> could easily be copied to the Hspell plugin in Kspell2 - it's not mandatory
> that it resides in libhspell itself... But, like I said, if we understand
> more about the philosophy of KSpell2 and why it thinks each plugin should
> keep its own list, maybe we'll reconsider.

Here too.

Just to make the things clear. I made that plugin just to show what KSpell2
can do, nothing more.

Cheers,
Mashrab.

-- 
Mashrab Kuvatov
Ph.D student
University of Bremen, IUP
Home-page: www.sat.uni-bremen.de/members/mashrab
PGP key: www.uni-bremen.de/~kmashrab/kmashrab.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050501/398cc3ef/attachment.sig>


More information about the kde-core-devel mailing list