freebsd-ports/textproc/spellutils/files/aspell.sl
Edwin Groothuis cb98152597 New port textproc/spellutils: newsbody & pospell spell-checking utilities.
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>
2003-01-20 05:42:15 +00:00

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;
}
}
}