Jean-Marc Lasgouttes wrote: > Angus> Angus Leeming wrote: >>> AC_DEFINE(SPELL_ENGINE, [$lyx_spell_engine], [Define as "ASPELL", >>> "PSPELL" or "ISPELL" to specify the spell-checker.]) > > Angus> I found it. AC_DEFINE_UNQUOTED. > > Angus> The patch attached does what I/we want but I'm not sure if it's > Angus> optimal. Perhaps you'd care to have a look? > > After way too much time (this stuff takes long to get right), hare is > my version of your patch. It has to be good since diffstat says > 14 files changed, 218 insertions(+), 80 deletions(-) > whereas yours says > 15 files changed, 255 insertions(+), 50 deletions(-) > > ;) > > Of course I did not test aspell/pspell support, since I do not have > them here. > > What still has to be done for spell stuff: create a new > config/spell.m4 file and shove the [aip]spell checking code in there, > along with a master LYX_CHECK_SPELLCHECKER macro. This is easy, but > obscures the patch. Then [ap]spell.m4 can be removed, they are > ridiculously small anyway.
Many thanks, Jean-Marc. I thought that I was making life difficult for myself. It appears that I was :) One thing I noticed after I had posted my patch last night is that there's a change of semantic here (ControlSpellchecker.C). At the moment, the lyxrc variables are used to fall through to Ispell at run time. With the new configure stuff, they'll fall through to SpellBase. So, that leads to two questions. 1. Should the check for USE_ISPELL be dependent on USE_[AP]SPELL? 2. If it should (be dependent), then we should remove the lyxrc variables, no? -#ifdef USE_ASPELL +#if defined(USE_ASPELL) if (lyxrc.use_spell_lib) return new ASpell(bp, lang); -#endif -#ifdef USE_PSPELL +#elif defined(USE_PSPELL) if (lyxrc.use_spell_lib) return new PSpell(bp, lang); -#endif - +#elif defined(USE_ISPELL) lang = (lyxrc.isp_use_alt_lang) ? lyxrc.isp_alt_lang : bp.language->lang(); return new ISpell(bp, lang); +#else + return new SpellBase; +#endif More thoughts. * The ability to launch the spell checker dialog (setStatus?) should be dependent on one of USE_[API]SPELL being defined. Maybe we could make compilation of ControlSpellcheker.C and associated frontend views dependent on this as well, although that is probably overkill. * The [aspell,ispell,hspell] combox in the preferences dialog should be activated only if USE_ISPELL is defined. Angus