'set novalue on' /* force KEXX and its way of SIGNAL ON NOVALUE */ /* Usage: [MACRO] MBOXREF */ /* Purpose: MBOXREF replaces 'In-Reply-To:' references by */ /* 'References:' for mails in the edited mbox file */ /* not already containing a 'References:' header. */ /* Requires: Kedit 5.0 (Frank Ellermann, 2003) */ ALL = 0 ; REF = 0 ; REP = 0 do N = 1 to size.1() 'locate :' N ; LINE = translate( curline.3()) if abbrev( LINE, 'FROM -' ) then do REF = 0 ; REP = 0 end else if REF then nop else if abbrev( LINE, 'REFERENCES: ' ) then REF = 1 else if abbrev( LINE, 'IN-REPLY-TO: ' ) then REP = N else if LINE == '' & REP = 0 then REF = 1 else if LINE == '' then do REF = 1 ; ALL = ALL + 1 'locate :' REP ; LINE = word( curline.3(), 1 ) || ' ' 'nomsg change' delimit( LINE, 'References: ' ) if rc <> 0 then do REF = rc ; ALL = ALL - 1 'emsg' lastmsg.1() 'in line' REP '(' || ALL 'changes)' exit REF end end end say ALL 'references patched' ; exit 1 - sign( ALL )