Thread View: news.software.readers
5 messages
5 total messages
Started by Kikutani Makoto
Wed, 16 Jul 1997 00:00
slrn: want post_body_filter_hook
Author: Kikutani Makoto
Date: Wed, 16 Jul 1997 00:00
Date: Wed, 16 Jul 1997 00:00
13 lines
850 bytes
850 bytes
I tried to write PGP macro using post_filter_hook.
But I felt difficulty because I should trim both header and signature
from the file. If there is a hook for filtering only body part,
it'll be easy.
makoto
--
Kikutani Makoto kikutani@eis.or.jp, kikutani@jdc.ericsson.se
hgf03701@niftyserve.or.jp
Re: slrn: want post_body_filter_hook
Author: Pardoz
Date: Wed, 16 Jul 1997 00:00
Date: Wed, 16 Jul 1997 00:00
19 lines
1313 bytes
1313 bytes
On 16 Jul 1997 07:49:09 GMT, Kikutani Makoto <kikutani@jdc.ericsson.se> wrote: >But I felt difficulty because I should trim both header and signature >from the file. If there is a hook for filtering only body part, >it'll be easy. I'll second the request for a body-filtering hook (it would also make spell-checking much easier, since you wouldn't have ispell or whatever hiccupping on the Path: and References: lines). -- RIOT, n. A popular entertainment given to the military by innocent bystanders. (A. Bierce, _The Devil's Dictionary_) http://www.io.com/~pardoz (Liaden Universe mailing list home page) http://www.io.com/~pardoz/mythos.html (Mythos Adventure Archive)
Re: slrn: want post_body_filter_hook
Author: Pardoz
Date: Thu, 17 Jul 1997 00:00
Date: Thu, 17 Jul 1997 00:00
26 lines
1730 bytes
1730 bytes
On 17 Jul 1997 07:27:56 GMT, Jan Hlavacek <lahvak+n@math.ohio-state.edu> wrote: >On 16 Jul 1997 17:36:36 GMT, Pardoz <pardoz@io.com> wrote: >> I'll second the request for a body-filtering hook (it would also >>make spell-checking much easier, since you wouldn't have ispell or >>whatever hiccupping on the Path: and References: lines). >> >This would not be easy to implement, because of the way slrn composes posts. I know. I can still dream, though...:-). >I solve this problem by feeding the file to ex and calling an ex script which >filters the body through ispell-filter. I do something similar - I feed the file through a REXX script that strips the headers and .sig file, feeds the body through ispell, and then reconstructs the message. -- RIOT, n. A popular entertainment given to the military by innocent bystanders. (A. Bierce, _The Devil's Dictionary_) http://www.io.com/~pardoz (Liaden Universe mailing list home page) http://www.io.com/~pardoz/mythos.html (Mythos Adventure Archive)
Re: slrn: want post_body_filter_hook
Author: Jan Hlavacek
Date: Thu, 17 Jul 1997 00:00
Date: Thu, 17 Jul 1997 00:00
69 lines
2941 bytes
2941 bytes
On 16 Jul 1997 17:36:36 GMT, Pardoz <pardoz@io.com> wrote:
>On 16 Jul 1997 07:49:09 GMT, Kikutani Makoto <kikutani@jdc.ericsson.se>
>wrote:
>
>>But I felt difficulty because I should trim both header and signature
>>from the file. If there is a hook for filtering only body part,
>>it'll be easy.
>
> I'll second the request for a body-filtering hook (it would also
>make spell-checking much easier, since you wouldn't have ispell or
>whatever hiccupping on the Path: and References: lines).
>
This would not be easy to implement, because of the way slrn composes posts.
It first creates the headers, appends eventual quoted text and signature and
saves it to a file. Then it calls an editor to this file. After that, it
would have to strip the headers and signature from the text, filter it
through something, read it back, and append the headers again.
I solve this problem by feeding the file to ex and calling an ex script which
filters the body through ispell-filter. My post_filter_hook looks roughly
like this:
define post_filter_hook (file)
{
variable rsp;
variable cmd;
forever
{
rsp = get_response ("NnIi",
"Select Filter? \001None, \001Ispell");
if ((rsp == 'i') or (rsp == 'I'))
cmd = "/usr/bin/ex -s -c 'source ~/lib/slrn/ispell_script'";
else return;
() = system (Sprintf ("%s '%s'", cmd, file, 2));
}
}
where ispell_script contains
/^$/,?^-- ?!/home/lahvak/lib/vim/bin/ispell-filter
wq
and, finally, ispell-filter (from vim faq) is
#!/bin/sh
cat > /tmp/tmp.$$
ispell $* /tmp/tmp.$$ </dev/tty >/dev/tty
cat /tmp/tmp.$$
rm -f /tmp/tmp.$$
This last thing is necessary because ispell doesn't accept input from stdout,
it needs a file to work with.
You may want to change paths and commands to make it work for you the way you
want. Also, I don't know anything about non-unix systems.
lahvak
--
Jan Hlav\'{a}\v{c}ek <lahvak+n@math.ohio-state.edu> (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/
Re: slrn: want post_body_filter_hook
Author: Byrial Jensen
Date: Sat, 19 Jul 1997 00:00
Date: Sat, 19 Jul 1997 00:00
40 lines
1892 bytes
1892 bytes
Pardoz <pardoz@io.com> wrote: >On 16 Jul 1997 07:49:09 GMT, Kikutani Makoto <kikutani@jdc.ericsson.se> >wrote: > >>But I felt difficulty because I should trim both header and signature >>from the file. If there is a hook for filtering only body part, >>it'll be easy. > > I'll second the request for a body-filtering hook (it would also >make spell-checking much easier, since you wouldn't have ispell or >whatever hiccupping on the Path: and References: lines). I wrote a little utility program named newsbody to filter only the body part of an article. It is like called this: newsbody -qs -n .article -p ispell -- -x %f It will take the file '.article', and remove from it the header, the signature (because of the -s flag), and all quotes (because of the -q flag). It will then write the result to the file '.article.body' and call: ispell -x .article.body When ispell returns it will change the body part of '.article' according to the changes in '.article.body' and eventually delete '.article.body' again. You can the download the C source to newsbody from <URL:http://home3.inet.tele.dk/byrial/slrn/newsbody.c>. I have only tried the program on my Linux box. I don't know, but I guess that it will compile on most systems. If changes are needed, please let me know. Regards, - Byrial
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads