[comp.sys.misc] wanted: a reformat EXEC for XEDIT files

mario@wjvax.UUCP (Mario Dona) (10/09/90)

Editing on an IBM mainframe is such a pain, but sometimes that's all you
got. One of the most obvious things missing is a way to easily reformat
paragraphs written with the XEDIT editor. Has anyone figured out how to
reformat (re-align) the lines in a paragraph
so that they don't look this ugly?

Come to think of it... does anyone have a nice
set of EXECs to make life easier when working with XEDIT.  My deepest
apprecication if you could share them with me.


  Mario Dona
  ...!{ !decwrl!qubix, ames!oliveb!tymix, pyramid}!wjvax!mario         
  The above opinions are mine alone and not, in any way, those of WJ.

QQ11@LIVERPOOL.AC.UK (10/13/90)

In article <1662@wjvax.UUCP>, mario@wjvax.UUCP (Mario Dona) says:
>
>Editing on an IBM mainframe is such a pain, but sometimes that's all you
>got. One of the most obvious things missing is a way to easily reformat
>paragraphs written with the XEDIT editor. Has anyone figured out how to
>reformat (re-align) the lines in a paragraph
>so that they don't look this ugly?
>
>Come to think of it... does anyone have a nice
>set of EXECs to make life easier when working with XEDIT.  My deepest
>apprecication if you could share them with me.

Hmmm, a nice set of execs, you need Eric Thomas' JUSTIFY package.

I'll mail it to you unless there's a clamour from others :-)
in which case I'll post it to comp.sources.misc.

Alan Thew
University of Liverpool Computer Laboratory
Bitnet/Earn: QQ11@LIVERPOOL.AC.UK or QQ11%UK.AC.LIVERPOOL @ UKACRL
UUCP       : ....!mcsun!ukc!liv!qq11        Voice: +44 51 794 3735
Internet   : QQ11@LIVERPOOL.AC.UK or QQ11%LIVERPOOL.AC.UK @ NSFNET-RELAY.AC.UK

ken@sugra.UUCP (Kenneth Ng) (10/28/90)

In article <1662@wjvax.UUCP>, mario@wjvax.UUCP (Mario Dona) writes:
: Editing on an IBM mainframe is such a pain, but sometimes that's all you
: got. One of the most obvious things missing is a way to easily reformat
: paragraphs written with the XEDIT editor. Has anyone figured out how to
: reformat (re-align) the lines in a paragraph
: so that they don't look this ugly?

Check out the following, first the starting text:

 /* top marker */
Received: from MERCURY.CCCC.NJIT.EDU by ORION.CCCC.NJIT.EDU (Mailer R2.04) with
BSMTP id 9179; Mon, 15 Oct 90 23:19:54 EDT
Received: from MERCURY.CCCC.NJIT.EDU by MERCURY.CCCC.NJIT.EDU (Mailer R2.04)
with BSMTP id 7944; Mon, 15 Oct 90 23:21:18 EDT
Date: Mon, 15 Oct 90 23:21:18 EDT
From: Network Mailer <MAILER@MERCURY.CCCC.NJIT.EDU>
To: KEN@ORION
Subject: mail delivery error
 /* end marker */

Batch SMTP transaction log follows:

220 MERCURY.CCCC.NJIT.EDU Columbia MAILER R2.04 BSMTP service ready.
050 HELO UWAVM.U.WASHINGTON.EDU
250 MERCURY.CCCC.NJIT.EDU Hello UWAVM.U.WASHINGTON.EDU
050 TICK 4995
250 4995 ... that's the ticket.
050 MAIL FROM:<biff@hardy.u.washington.edu>
250 <biff@hardy.u.washington.edu>... sender OK.
050 RCPT TO:<bdbdb@mercury.BITNET>
250 <bdbdb@mercury.BITNET>... recipient OK.
050 DATA
354 Start mail input.  End with <crlf>.<crlf>
554-Mail not delivered to some or all recipients:
554 No such local user: BDBDB
050 QUIT
221 MERCURY.CCCC.NJIT.EDU Columbia MAILER BSMTP service done.

--------------------------------------------------------------------------
Ok, now the output, the first paragraph was done without justtification,
the second was done with justification:
--------------------------------------------------------------------------

 /* top marker */
Received: from MERCURY.CCCC.NJIT.EDU by ORION.CCCC.NJIT.EDU (Mailer
R2.04) with BSMTP id 9179; Mon, 15 Oct 90 23:19:54 EDT Received: from
MERCURY.CCCC.NJIT.EDU by MERCURY.CCCC.NJIT.EDU (Mailer R2.04) with
BSMTP id 7944; Mon, 15 Oct 90 23:21:18 EDT Date: Mon, 15 Oct 90
23:21:18 EDT From: Network Mailer <MAILER@MERCURY.CCCC.NJIT.EDU> To:
KEN@ORION Subject: mail delivery error
 /* end marker */

Batch SMTP transaction log follows:

220  MERCURY.CCCC.NJIT.EDU Columbia  MAILER R2.04  BSMTP service  ready.
050   HELO   UWAVM.U.WASHINGTON.EDU  250   MERCURY.CCCC.NJIT.EDU   Hello
UWAVM.U.WASHINGTON.EDU 050  TICK 4995  250 4995  ... that's  the ticket.
050         MAIL          FROM:<biff@hardy.u.washington.edu>         250
<biff@hardy.u.washington.edu>...      sender      OK.      050      RCPT
TO:<bdbdb@mercury.BITNET>  250  <bdbdb@mercury.BITNET>... recipient  OK.
050  DATA 354  Start mail  input.  End with  <crlf>.<crlf> 554-Mail  not
delivered to some  or all recipients: 554 No such  local user: BDBDB 050
QUIT  221  MERCURY.CCCC.NJIT.EDU  Columbia MAILER  BSMTP  service  done.

--------------------------------------------------------------------------
Ok, this is the routine itself, please note that it is not well tested,
its just something I threw together.  There are probably better ways
of doing it, but what do you expect to be done in an hour?  Try learning
more about what the REXX/XEDIT interface can do, it is *VERY* powerful,
I'd say it almost approaches the capabilities of emacs.


/* take from the current line till a line that has a blank in the
beginning and try to format it nicely. */

signal on novalue

/* get and store the starting line number */
'EXTRACT/LINE'
start_line = line.1

paragraph2format = ''

/* get the stuff to format into a paragraph into a long line */
do forever
   'EXTRACT/CURLINE'
   if curline.3 ^= '' & pos(' ', curline.3) ^= 1 then
      paragraph2format = paragraph2format strip(curline.3)
   else leave
   'DOWN 1'
   if rc ^= 0 then leave
   end


/* goto previous line and delete to the beginning line number */
'UP 1'
'DEL :'start_line - 1

/* while we are not done, grab 72 characters, strip off the trucated
   part of the last word, and input it into editor */

do until new_line = ''
   parse value reverse(substr(paragraph2format,1,72)) with ' ' new_line
   new_line = reverse(new_line)

   paragraph2format = strip(substr(paragraph2format, length(new_line)+1))

   /* for justified outout uncomment the following line */
      new_line = justify(new_line, 72)


   if new_line ^= '' then 'INPUT' strip(new_line)
   end

jhc@irwin.uucp (James H. Coombs) (10/28/90)

In article <16@sugra.UUCP> ken@sugra.UUCP (Kenneth Ng) writes:
>In article <1662@wjvax.UUCP>, mario@wjvax.UUCP (Mario Dona) writes:
>> Editing on an IBM mainframe is such a pain, but sometimes that's all you
>> got. One of the most obvious things missing is a way to easily reformat
>Ok, this is the routine itself, please note that it is not well tested,

I have a full blown justifier/formatter for XEDIT.  It has been
publically available at Brown for 5 years or more, so it is mature and
robust.  It is a little long to post to a group like this, but I am
willing to share it.  Perhaps someone can tell me what source group to
post it to.  Or I will (eventually) respond to direct requests.  --Jim