mirror of
https://git.freebsd.org/ports.git
synced 2025-04-29 10:06:40 -04:00
Spellutils is a suite of programs which are used to isolate some parts or texts from various types of files and hand them over to another program which may change the texts; it is typically a spell checker. Afterwards the possibly changed text parts are copied back in place in the original file. PR: ports/41211 Submitted by: Thierry Thomas <thierry@pompo.net>
32 lines
639 B
Text
32 lines
639 B
Text
% This macro demonstrates the use of the post_filter_hook
|
|
% In your .slrnrc, add the line `interpret "/usr/local/share/examples/spellutils/aspell.sl"'
|
|
|
|
%static
|
|
define aspell_file (file)
|
|
{
|
|
variable cmd = "/usr/local/bin/newsbody -qs -k Subject -n '%s' -p /usr/local/bin/aspell -- -c -x %%f";
|
|
() = system (sprintf (cmd, file));
|
|
}
|
|
|
|
|
|
define post_filter_hook (file)
|
|
{
|
|
variable rsp;
|
|
variable cmd;
|
|
|
|
forever
|
|
{
|
|
rsp = get_response ("NnAa",
|
|
"Select Filter? \001None, \001Aspell");
|
|
|
|
switch (rsp)
|
|
{
|
|
case 'a' or case 'A':
|
|
aspell_file (file);
|
|
}
|
|
{
|
|
case 'n' or case 'N':
|
|
return;
|
|
}
|
|
}
|
|
}
|