Return-Path: ccs.covici.com!VMS-Daemon@ccs.clark.net Return-Path: Received: from loas.clark.net by icpsr.umich.edu (8.8.8/2.2) with ESMTP id SAA00905; Sun, 15 Mar 1998 18:12:28 -0500 (EST) Received: from ccs.clark.net (ccs.clark.net [168.143.3.15]) by loas.clark.net (8.8.8/8.8.8) with SMTP id SAA20271; Sun, 15 Mar 1998 18:07:28 -0500 (EST) Received: from ccs by ccs.covici.com (UUPC/extended 1.12j) with UUCP for list2; Sun, 15 Mar 1998 12:15:07 -0500 Received: by ccs.covici.com (V-MailServer/386 Professional 2.99r BETA (3.0.1.4)) id VMerb; Sun, 15 Mar 1998 12:14:58 -0500 Date: Sat, 14 Mar 1998 12:54:00 +0100 From: ib@wupperonline.de Subject: REQ: smart paragraph reformatting macro Sender: VMS-Daemon@ccs.covici.com To: Aurora Editor Mailinglist Message-Id: <350ac472@wupperonline.de> Reply-To: Aurora Editor Mailing List X-Mailer: SlipDoor rshea@netcom.com writes: rs> An Aurora macro that would do this type of smart reformatting would be rs> useful to lots of folks. Has anyone written such a macro? Here it comes (though it's a function). It was one of the first things I did with AML, so maybe it can be done better: // quoted text formatting for a block or the current paragraph function qformat undobegin if getmarkbuf <> getcurrbuf then tempmark = TRUE oldmark = usemark 'T' markpara _FormatOpt end if mark? then t = getmarktop q = gettext 1 (getmarkcols) t // first marked line p = pos "> " q if p then q = q [1..(p + 1)] // quote part b = getmarkbot markcolumn 1 (p + 1) t b deleteblock // delete quote part pushcursor row t markline i = t while i < b do down i = i + 1 end markline popcursor strlen = length q formatblock 1 _RMargin - strlen i = p + 1 repeat // add quote part shiftblock 1 '' (q[i]) i = i - 1 until i == 0 // advance cursor if pos 'c' _FormatOpt then row getmarkbot + 1 end end if tempmark then destroymark usemark oldmark end else p = 0 end undoend if not p then display say "Nothing to reformat" end end Ingo