Joost Verburg wrote:
> Angus Leeming wrote:
>> We don't use aspell.exe. We link aspell.lib statically into
>> lyx.exe. It's perfectly possible to install (and use) the
>> dictionaries without installing aspell.exe.
> Then I don't really understand why Windows users should
> install their dictionaries in C:\Aspell\lib\aspell-0.60.
> It is very unlikely that any other Windows application
> would share Aspell dictionaries with LyX in that specific
> place.
Says who? The whole of KDE will soon be running on Windows by the look of
things... That's an awful lot of software that uses Aspell for spell checking.
> If this hard-coded path is changed so LyX will look
> inside Resources\lyx\dictionaries instead, all problems
> are solved and we can create a nice installer that detects
> where LyX is installed and puts the dictionaries in the right place.
> What do you think about it?
I think that the Aspell dictionaries aren't our business. We shouldn't
package them with LyX. Uwe can throw them into his installer if he likes
(it's his installer after all :)) but LyX itself shouldn't have to look for
these dictionaries in a hard-wired location. The current situation is ugly
but your suggestion is no better. IMO of course.
Aspell provides an API to manipulate the place that the Aspell library
looks for these dictionaries. Just invoke this API and we're home and dry.
What you're proposing is to invoke this API anyway; where we differ is
where the thing should be pointed to.
Anyway, since I see that you've taken the bait and are interested in fixing
this hard-coded nastiness, you might have a read of the aspell docs, here:
http://aspell.sourceforge.net/man-html/Through-the-C-API.html
...
Other things you might want to set is the preferred spell checker to use,
the search path for dictionaries, and the like — see [The Options], for a
list of all available options.
...
[The Options] link will take you here:
http://aspell.sourceforge.net/man-html/The-Options.html
...
dict-dir
(dir) Location of the main word list.
...
So, my take on this is that we should have a LyXRC variable
aspell_dict_dir
that defaults to "" (empty).
Our code would, therefore, look like:
if (!lyxrc.aspell_dict_dir.empty())
aspell_config_replace(spell_config, "dict-dir",
lyxrc.aspell_dict_dir.c_str());
Thus, the aspell library looks in the default location for the dictionaries
(as now) if we don't specify explicitly where to look. However, our users
would now have the ability to tweak this location via a
lyxrc.defaults/preferences option
\apell_dict_dir "J:\Aspell\lib\aspell-0.60"
If you and Uwe want to go on thereafter to package the aspell dictionaries
with his do-it-all installer, then that's fine. Just get the installer to
set this lyxrc.defaults variable to your chosen location.
Hope that this is enough to get you started...
Angus