From cmorgan@aracnet.com Wed Jan 22 08:00:05 1997 Received: from trapdoor.aracnet.com (root@trapdoor.aracnet.com [204.188.47.1]) by mail.clark.net (8.7.3/8.6.5) with ESMTP id IAA21714 for ; Wed, 22 Jan 1997 08:00:04 -0500 (EST) Received: from shelob.aracnet.com (shelob.aracnet.com [204.188.47.2]) by trapdoor.aracnet.com (8.7.4/8.6.9) with ESMTP id EAA27851; Wed, 22 Jan 1997 04:59:09 -0800 Recieved: by shelob.aracnet.com (8.7.4) id FAA31101; Wed, 22 Jan 1997 05:02:49 -0800 Message-Id: <199701221302.FAA31101@shelob.aracnet.com> From: cmorgan@aracnet.com (Clark O. Morgan) Date: Wed, 22 Jan 1997 05:02:48 -0800 X-Mailer: Mail User's Shell (7.2.5 10/14/92) To: pgf@foxharp.boston.ma.us (Paul G. Fox), dickey@clark.net Subject: example vile macro to ispell Usenet Posting or e-mail msg Status: RO This might be a useful example for vile users learning the vile macro syntax.... ================= Cut here ============================ ; Vile macro to ispell an e-mail msg or USENET posting that contains ; msg headers (headers are separated from body by at least one blank line). ; This macro feeds the Subject: header and msg body to ispell, then glues ; the returned result back into the original message. NB: this macro does ; not handle a Subject: hdr that's continued over more than one line and ; it assumes that the blank line separating hdrs & body is exactly "^$" . 23 store-macro beginning-of-file search-forward "^" ; $match has known value load-register p "" ~force search-forward "^Subject:" ~if &seq "Subject:" $match use-register p delete-til lines ; delete til eol ~endif beginning-of-file ~force search-forward "^$" ~if &seq "" $match use-register P delete-til goto-line ; delete til EOF ~else ; Assume no msg body, add blank line as msg end-of-file 1 force-blank-lines use-register P delete-til goto-line ; delete til EOF ~endif write-file set-variable %origfile $cfilname set-variable %tmpleaf &cat ".vile.ispell." $pid set-variable %tmpfile &cat "$HOME/" %tmpleaf edit-file %tmpfile use-register p put-after ; put subj hdr & msg body in tmp file write-file 1 shell-command &cat "chmod go-rwx " %tmpfile ; protect file contents 1 shell-command &cat "ispell " $cfilname edit-file %origfile end-of-file insert-file %tmpfile delete-buffer %tmpleaf 1 shell-command &cat &cat "rm " %tmpfile "*" ; cleanup tmpfile ~endm bind-key execute-macro-23 #-i ; invoke with the keystroke #i This might be a useful example for vile users learning the vile macro syntax.... ================= Cut here ============================ ; Vile macro to ispell an e-mail msg or USENET posting that contains ; msg headers (headers are separated from body by at least one blank line). ; This macro feeds the Subject: header and msg body to ispell, then glues ; the returned result back into the original message. NB: this macro does ; not handle a Subject: hdr that's continued over more than one line and ; it assumes that the blank line separating hdrs & body is exactly "^$" . 23 store-macro beginning-of-file search-forward "^" ; $match has known value load-register p "" ~force search-forward "^Subject:" ~if &seq "Subject:" $match use-register p delete-til lines ; delete til eol ~endif beginning-of-file ~force search-forward "^$" ~if &seq "" $match use-register P delete-til goto-line ; delete til EOF ~else ; Assume no msg body, add blank line as msg end-of-file 1 force-blank-lines use-register P delete-til goto-line ; delete til EOF ~endif write-file set-variable %origfile $cfilname set-variable %tmpleaf &cat ".vile.ispell." $pid set-variable %tmpfile &cat "$HOME/" %tmpleaf edit-file %tmpfile use-register p put-after ; put subj hdr & msg body in tmp file write-file 1 shell-command &cat "chmod go-rwx " %tmpfile ; protect file contents 1 shell-command &cat "ispell " $cfilname edit-file %origfile end-of-file insert-file %tmpfile delete-buffer %tmpleaf 1 shell-command &cat &cat "rm " %tmpfile "*" ; cleanup tmpfile ~endm bind-key execute-macro-23 #-i ; invoke with the keystroke #i