- Subject: Re: Another distro fix request, ispell/aspell/hunspell/...
- From: "G. Milde" <milde@xxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Feb 2009 11:08:38 +0100
On 16.02.09, Tom Culliton wrote:
> Well I generally edit the command in the ispell.sl (as root if necessary)
> but it's one of those things that always seems to come up at some
> inconvenient moment. While doing this for a recent Fedora 10 install it
> struck me that it should be simple enough (maybe a dozen lines of slang)
> to make it a bit more automatic in the core. Something like (faux-slang -
> meaning I didn't check the exact function names or command line args):
After checking the variable/function names I suggest the following:
%!%+
%\variable{Ispell_Program_Name}
%\synopsis{spell-check command}
%\usage{variable Ispell_Program_Name = ""}
%\description
% The spell check command used by \sfun{ispell}.
% Must be ispell-compatible (one of "ispell", "aspell" or "hunspell").
% The default value "" means auto-detect.
%\seealso{ispell, search_path_for_file}
%!%-
custom_variable("Ispell_Program_Name", "");
% Search for candidates:
!if (Ispell_Program_Name == "") {
foreach $1 (["aspell", "hunspell", "ispell"])
if (search_path_for_file(getenv("PATH"), $1, path_get_delimiter())
!= NULL) {
Ispell_Program_Name = $1;
break;
}
}
Some remarks:
* I used the variable name established in Paul Boekholts ispell mode
http://jedmodes.sf.net/mode/ispell/ .
* In the standard ispell.sl replace all hard coded references to "ispell" with
Ispell_Program_Name.
* the path_get_delimiter() argument is only needed for Jed 0.99.18
compatibility, it is the default in Jed 0.99.19.
* The test for hunspell should only be done if hunspell is truely
ispell-compatible (allows automatic processing of the return values and
output by the ispell mode).
* the custom_variable() command is only needed once: if the user has set a
value (other than ""), the auto-detection is skipped anyway.
* the command line options can be added later e.g. by
Ispell_Program_Name += " -a";
This is what the jedmodes.sf.net version of the ispell mode does.
@Paul: how about using this OS-independent search also in ispell_init.sl?
Günter
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2009 date index]
[2009 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]