home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / vmsnet / sources / 468 < prev    next >
Encoding:
Internet Message Format  |  1993-01-04  |  47.3 KB

  1. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!ucselx!network.ucsd.edu!mvb.saic.com!vmsnet-sources
  2. From: flowers@memstvx1.memst.edu
  3. Newsgroups: vmsnet.sources
  4. Subject: C Swing v3.6.4 patches, part 01/04
  5. Message-ID: <9908347@MVB.SAIC.COM>
  6. Date: Mon, 04 Jan 1993 20:21:04 GMT
  7. Organization: Memphis State University
  8. Lines: 1619
  9. Approved: Mark.Berryman@Mvb.Saic.Com
  10.  
  11. Submitted-by: flowers@memstvx1.memst.edu
  12. Posting-number: Volume 4, Issue 22
  13. Archive-name: cswing/patch3_01
  14. Patch-to: cswing: Volume 3, Issue 35-52,93,211-218
  15.  
  16. $! ------------------ CUT HERE -----------------------
  17. $ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
  18. $!
  19. $! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
  20. $!   On 10-DEC-1992 15:45:08.48   By user FLOWERS 
  21. $!
  22. $! This VMS_SHARE Written by:
  23. $!    Andy Harper, Kings College London UK
  24. $!
  25. $! Acknowledgements to:
  26. $!    James Gray       - Original VMS_SHARE
  27. $!    Michael Bednarek - Original Concept and implementation
  28. $!
  29. $!+ THIS PACKAGE DISTRIBUTED IN 4 PARTS, TO KEEP EACH PART
  30. $!  BELOW 100 BLOCKS
  31. $!
  32. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  33. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  34. $!
  35. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  36. $!       1. AAAREADME_1ST.PAT;364
  37. $!       2. BUFFER_C.PAT;364
  38. $!       3. CMD_C.PAT;364
  39. $!       4. HELP_C.PAT;364
  40. $!       5. KEYM_C.PAT;364
  41. $!       6. LINE_C.PAT;364
  42. $!       7. LINK_V5_COM.PAT;364
  43. $!       8. MAIN_C.PAT;364
  44. $!       9. MOST_DOC_FM.PAT;364
  45. $!      10. MOST_H.PAT;364
  46. $!      11. MOST_OPTIONS_OPT.PAT;364
  47. $!      12. OPTIONS_FILE_OPT.PAT;364
  48. $!      13. PATCH.COM;364
  49. $!      14. SEARCH_C.PAT;364
  50. $!      15. SWING_38_C.PAT;364
  51. $!      16. SWING_C.PAT;364
  52. $!      17. SWING_H.PAT;364
  53. $!      18. WINDOW_C.PAT;364
  54. $!
  55. $set="set"
  56. $set symbol/scope=(nolocal,noglobal)
  57. $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
  58. $e="write sys$error  ""%UNPACK"", "
  59. $w="write sys$output ""%UNPACK"", "
  60. $ if f$trnlnm("SHARE_LOG") then $ w = "!"
  61. $ ve=f$getsyi("version")
  62. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
  63. $ e "-E-OLDVER, Must run at least VMS 4.4"
  64. $ v=f$verify(v)
  65. $ exit 44
  66. $UNPACK: SUBROUTINE ! P1=filename, P2=checksum
  67. $ if f$search(P1) .eqs. "" then $ goto file_absent
  68. $ e "-W-EXISTS, File ''P1' exists. Skipped."
  69. $ delete 'f'*
  70. $ exit
  71. $file_absent:
  72. $ if f$parse(P1) .nes. "" then $ goto dirok
  73. $ dn=f$parse(P1,,,"DIRECTORY")
  74. $ w "-I-CREDIR, Creating directory ''dn'."
  75. $ create/dir 'dn'
  76. $ if $status then $ goto dirok
  77. $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
  78. $ delete 'f'*
  79. $ exit
  80. $dirok:
  81. $ w "-I-PROCESS, Processing file ''P1'."
  82. $ if .not. f$verify() then $ define/user sys$output nl:
  83. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
  84. PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
  85. SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
  86. CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
  87. LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
  88. BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
  89. IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
  90. MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
  91. ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
  92. 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
  93. POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
  94. ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
  95. COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
  96. "output_file"));ENDPROCEDURE;Unpacker;QUIT;
  97. $ delete/nolog 'f'*
  98. $ CHECKSUM 'P1'
  99. $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
  100. $ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  101. $ ENDSUBROUTINE
  102. $START:
  103. $ create 'f'
  104. X*** `5B--.vmsnet`5Daaareadme.1st
  105. X--- `5B--.src`5Daaareadme.1st
  106. X**************
  107. X*** 25,31
  108. X `20
  109. X  The C language version of SWING was written by Simon Brown, and maintained
  110. V  by
  111. X  him  through  V3.2.  It  has  been  modified  by many people, and is curre
  112. Vntly
  113. X! maintained primarily by Mats Akerberg and Harry Flowers  (see  end  of  fi
  114. Vle).
  115. X  Most  of  the  documentation  has  been rewitten by Chris Butler. Although
  116. V the
  117. X  online help is good, you should read the manual. The re-write was necessar
  118. Vy as
  119. X  he  did  not  have  a Fortran compiler, and felt that C was a more appropr
  120. Viate
  121. X--- 25,31 -----
  122. X `20
  123. X  The C language version of SWING was written by Simon Brown, and maintained
  124. V  by
  125. X  him  through  V3.2.  It  has  been  modified  by many people, and is curre
  126. Vntly
  127. X! maintained primarily by  Mats Akerberg,  Harry Flowers,  and  Foteos Macri
  128. Vdes.
  129. X  Most  of  the  documentation  has  been rewitten by Chris Butler. Although
  130. V the
  131. X  online help is good, you should read the manual. The re-write was necessar
  132. Vy as
  133. X  he  did  not  have  a Fortran compiler, and felt that C was a more appropr
  134. Viate
  135. X**************
  136. X*** 160,166
  137. X             Foteos Macrides
  138. X             Worcester Foundation for Experimental Biology
  139. X             Shrewsbury, MA   USA
  140. X!            email: MACRIDES@WFEB2.BITNET                (on BITNET)
  141. X `20
  142. X             Chris Butler
  143. X             NEW ZEALAND
  144. X--- 160,167 -----
  145. X             Foteos Macrides
  146. X             Worcester Foundation for Experimental Biology
  147. X             Shrewsbury, MA   USA
  148. X!            email: MACRIDES@SCI.WFEB.EDU                (on INTERNET)
  149. X!                   MACRIDES@WFEB2.BITNET                (on BITNET)
  150. X `20
  151. X             Chris Butler
  152. X             NEW ZEALAND
  153. $ CALL UNPACK AAAREADME_1ST.PAT;364 1681350502
  154. $ create 'f'
  155. X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dbuffer.c;2
  156. X--- disk$disk1:`5Bflowers.swing.src`5Dbuffer.c;4
  157. X**************
  158. X*** 14,19
  159. X `20
  160. X  unsigned char *C_POS;
  161. X  int C_LINE;
  162. X `20
  163. X  unsigned char *beg_of_line1()
  164. X  `7B
  165. X--- 14,24 -----
  166. X `20
  167. X  unsigned char *C_POS;
  168. X  int C_LINE;
  169. X+ unsigned char *M_POS;
  170. X+ int M_FLAG;
  171. X+ int W_LINE;
  172. X+ int TAB_R;
  173. X+ int ESC_NUM;
  174. X `20
  175. X  unsigned char *beg_of_line1()
  176. X  `7B
  177. X**************
  178. X*** 48,65
  179. X      return pos;
  180. X  `7D
  181. X `20
  182. X- unsigned char *beg_of_line()
  183. X- `7B
  184. X-     unsigned char *b;
  185. X-     int d,n;
  186. X-    `20
  187. X-     if (!MOST_W_OPT) return beg_of_line1();
  188. X-     b = beg_of_line1();
  189. X-     d = C_POS - b;
  190. X-     n = d / SCREEN_WIDTH_M1;
  191. X-     return(b +  (int) (n * SCREEN_WIDTH_M1));
  192. X- `7D
  193. X-`20
  194. X  /* does not move point */
  195. X  unsigned char *end_of_line1()
  196. X  `7B
  197. X--- 53,58 -----
  198. X      return pos;
  199. X  `7D
  200. X `20
  201. X  /* does not move point */
  202. X  unsigned char *end_of_line1()
  203. X  `7B
  204. X**************
  205. X*** 89,95
  206. X      return pos;
  207. X  `7D
  208. X `20
  209. X! unsigned char *end_of_line()
  210. X  `7B
  211. X      unsigned char *b, *e;
  212. X      int n;
  213. X--- 82,88 -----
  214. X      return pos;
  215. X  `7D
  216. X `20
  217. X! unsigned char *beg_of_line()
  218. X  `7B
  219. X      unsigned char *b, *i, *e;
  220. X      int ii = 0,j,k = 1,esc_num = 0;
  221. X**************
  222. X*** 91,98
  223. X `20
  224. X  unsigned char *end_of_line()
  225. X  `7B
  226. X!     unsigned char *b, *e;
  227. X!     int n;
  228. X     `20
  229. X      if (!MOST_W_OPT) return end_of_line1();
  230. X `20
  231. X--- 84,91 -----
  232. X `20
  233. X  unsigned char *beg_of_line()
  234. X  `7B
  235. X!     unsigned char *b, *i, *e;
  236. X!     int ii = 0,j,k = 1,esc_num = 0;
  237. X     `20
  238. X      b = beg_of_line1();
  239. X     `20
  240. X**************
  241. X*** 94,100
  242. X      unsigned char *b, *e;
  243. X      int n;
  244. X     `20
  245. X!     if (!MOST_W_OPT) return end_of_line1();
  246. X `20
  247. X      b = beg_of_line();
  248. X      e = end_of_line1();
  249. X--- 87,98 -----
  250. X      unsigned char *b, *i, *e;
  251. X      int ii = 0,j,k = 1,esc_num = 0;
  252. X     `20
  253. X!     b = beg_of_line1();
  254. X!    `20
  255. X!     /*
  256. X!     **  if not Wrap mode, return beginning of entire line
  257. X!     */
  258. X!     if (!MOST_W_OPT) return(b);
  259. X `20
  260. X      M_FLAG = 0;
  261. X      W_LINE = 0;
  262. X**************
  263. X*** 96,101
  264. X     `20
  265. X      if (!MOST_W_OPT) return end_of_line1();
  266. X `20
  267. X      b = beg_of_line();
  268. X      e = end_of_line1();
  269. X      n = (e - b) / SCREEN_WIDTH;
  270. X--- 94,225 -----
  271. X      */
  272. X      if (!MOST_W_OPT) return(b);
  273. X `20
  274. X+     M_FLAG = 0;
  275. X+     W_LINE = 0;
  276. X+     TAB_R = 0;
  277. X+     ESC_NUM = 0;
  278. X+     e = end_of_line1();
  279. X+     M_POS = e + 1;
  280. X+`20
  281. X+     /*
  282. X+     **  if a `5EM is in the line and not Verbose mode,
  283. X+     **  set up overstriking for wrapped lines
  284. X+     */
  285. X+     if (!MOST_V_OPT)
  286. X+       for (i = b; i <= e; i++)
  287. X+         if (*i == '\015')
  288. X+           `7B
  289. X+               M_POS = i;
  290. X+               M_FLAG = 1;
  291. X+           `7D
  292. X+`20
  293. X+     /*
  294. X+     **  wrap mode
  295. X+     */
  296. X+     for (i = b; i < C_POS; i++)
  297. X+       `7B
  298. X+           if (i == e - 1)
  299. X+             `7B
  300. X+                 return(b);
  301. X+             `7D
  302. X+`20
  303. X+           /*
  304. X+           **  make adjustments for non-printing characters
  305. X+ `09  **  if not Verbose mode
  306. X+           */
  307. X+           else if (!MOST_V_OPT && (*i < ' ' `7C`7C *i > 126))
  308. X+             `7B
  309. X+                 /*
  310. X+                 **  overstrike character via backspace (`5EH)
  311. X+                 */
  312. X+                 if (*i == '\b' && ii != 0) ii--;
  313. X+`20
  314. X+                 /*
  315. X+                 **  overstrike line via `5EM
  316. X+                 */
  317. X+                 else if (*i == '\015') return(b);
  318. X+                `20
  319. X+                 /*
  320. X+                 **  underline, bold, or reverse via <ESC>`5B#m
  321. X+                 */
  322. X+                 else if (*i == '\033' && i + 3 <= e &&
  323. X+                           *(i + 1) == '`5B' &&
  324. X+                          (*(i + 2) == '1' `7C`7C
  325. X+                           *(i + 2) == '4' `7C`7C
  326. X+                           *(i + 2) == '7' `7C`7C
  327. X+                           *(i + 2) == '0') &&
  328. X+                           *(i + 3) == 'm')
  329. X+                   `7B
  330. X+                       if      (*(i + 2) == '1') esc_num = 1;
  331. X+                       else if (*(i + 2) == '4') esc_num = 4;
  332. X+                       else if (*(i + 2) == '7') esc_num = 7;
  333. X+                       else esc_num = 0;
  334. X+                       ii -= 3;
  335. X+                   `7D
  336. X+`20
  337. X+                 /*
  338. X+                 **  tab (`5EI)
  339. X+                 */
  340. X+                 else if (*i == '\t')
  341. X+                   `7B
  342. X+                       j =  8 * (ii/8 + 1) - ii;  /* 8 column tabs */
  343. X+                       while(j--)
  344. X+                         `7B
  345. X+                             ii++;
  346. X+                             if (ii == k*SCREEN_WIDTH_M1 + 1 &&
  347. X+                                 *(i + 1) != '\015')
  348. X+                               `7B
  349. X+                                   b = i;
  350. X+                                   W_LINE++;
  351. X+                                   TAB_R +=
  352. X+ `09`09`09`09    8*(SCREEN_WIDTH_M1/8 + 1) - SCREEN_WIDTH_M1;
  353. X+                                   k++;
  354. X+                                   ESC_NUM = esc_num;
  355. X+                               `7D
  356. X+                         `7D
  357. X+                    `7D
  358. X+`20
  359. X+                 /*
  360. X+                 **  don't count other control characters except
  361. X+                 **  bell (`5EG), vertical tab (`5EK), linefeed (`5EL),
  362. X+                 **  or escape (`5E`5B) not followed by `5B#m
  363. X+                 */
  364. X+                 else if (*i != '\007' && *i != '\013' &&
  365. X+                          *i != '\014' && *i != '\033') ;
  366. X+             `7D
  367. X+`20
  368. X+           /*
  369. X+           **  printable character or always-explicit control character
  370. X+           */
  371. X+           else
  372. X+             `7B
  373. X+                 ii++;
  374. X+                 if (ii == k*SCREEN_WIDTH_M1 + 1 && *(i + 1) != '\015')
  375. X+                   `7B
  376. X+                       b = i;
  377. X+                       W_LINE++;
  378. X+                       TAB_R +=  8*(SCREEN_WIDTH_M1/8 + 1) - SCREEN_WIDTH_M
  379. V1;
  380. X+                       k++;
  381. X+                       ESC_NUM = esc_num;
  382. X+                   `7D
  383. X+             `7D
  384. X+       `7D
  385. X+`20
  386. X+     return(b);
  387. X+ `7D
  388. X+`20
  389. X+ unsigned char *end_of_line()
  390. X+ `7B
  391. X+     unsigned char *b, *e, *i;
  392. X+     int ii = 0,j;
  393. X+    `20
  394. X+     e = end_of_line1();
  395. X+`20
  396. X+     /*
  397. X+     **  if not Wrap mode, return end of entire line
  398. X+     */
  399. X+     if (!MOST_W_OPT) return(e);
  400. X+`20
  401. X      b = beg_of_line();
  402. X `20
  403. X      /*
  404. X**************
  405. X*** 97,105
  406. X      if (!MOST_W_OPT) return end_of_line1();
  407. X `20
  408. X      b = beg_of_line();
  409. X!     e = end_of_line1();
  410. X!     n = (e - b) / SCREEN_WIDTH;
  411. X!     if (n) return(b + SCREEN_WIDTH_M1);
  412. X      return (e);
  413. X  `7D
  414. X `20
  415. X--- 221,307 -----
  416. X      if (!MOST_W_OPT) return(e);
  417. X `20
  418. X      b = beg_of_line();
  419. X!`20
  420. X!     /*
  421. X!     **  wrap mode
  422. X!     */
  423. X!     for (i = b; i <= e; i++)
  424. X!       `7B
  425. X!           /*
  426. X!           **  make adjustments for non-printing characters
  427. X! `09  **  if not Verbose mode
  428. X!           */
  429. X!           if (!MOST_V_OPT && (*i < ' ' `7C`7C *i > 126))
  430. X!             `7B
  431. X!                 /*
  432. X!                 **  overstrike character via backspace (`5EH)
  433. X!                 */
  434. X!                 if (*i == '\b' && ii != 0) ii--;
  435. X!`20
  436. X!                 /*
  437. X!                 **  overstrike line via `5EM
  438. X!                 */
  439. X!                 else if (*i == '\015') return(e);
  440. X!`20
  441. X!                 /*
  442. X!                 **  underline, bold, or reverse via <ESC>`5B#m
  443. X!                 */
  444. X!                 else if (*i == '\033' && i + 3 <= e &&
  445. X!                           *(i + 1) == '`5B' &&
  446. X!                          (*(i + 2) == '1' `7C`7C
  447. X!                           *(i + 2) == '4' `7C`7C
  448. X!                           *(i + 2) == '7' `7C`7C
  449. X!                           *(i + 2) == '0') &&
  450. X!                           *(i + 3) == 'm')
  451. X!                   `7B
  452. X!                       ii -= 3;
  453. X!                   `7D
  454. X!`20
  455. X!                 /*
  456. X!                 **  tab (`5EI)
  457. X!                 */
  458. X!                 else if (*i == '\t')
  459. X!                   `7B
  460. X!                       if (W_LINE)
  461. X!                         `7B
  462. X!                             if (ii == 0)
  463. X!                               j = TAB_R;
  464. X!                             else
  465. X!                               j = 8 * (ii/8 + 1) - ii + TAB_R;
  466. X!                         `7D
  467. X!                       else
  468. X!                         j =  8 * (ii/8 + 1) - ii;  /* 8 column tabs */
  469. X!`20
  470. X!                       while(j--)
  471. X!                         `7B
  472. X!                             ii++;
  473. X!                             if (ii == SCREEN_WIDTH + 1)
  474. X!                               return (i);
  475. X!                         `7D
  476. X!                   `7D
  477. X!`20
  478. X!                 /*
  479. X!                 **  don't count other control characters except
  480. X!                 **  bell (`5EG), vertical tab (`5EK), linefeed (`5EL),
  481. X!                 **  or escape (`5E`5B) not followed by `5B#m
  482. X!                 */
  483. X!                 else if (*i != '\007' && *i != '\013' &&
  484. X!                          *i != '\014' && *i != '\033') ;
  485. X!             `7D
  486. X!`20
  487. X!           /*
  488. X!           **  printable character or always-explicit control character
  489. X!           */
  490. X!           else
  491. X!             `7B
  492. X!                 ii++;
  493. X!                 if (ii == SCREEN_WIDTH + 1)
  494. X!                   `7B
  495. X!                       return (i);
  496. X!                   `7D
  497. X!             `7D
  498. X!       `7D
  499. X!`20
  500. X      return (e);
  501. X  `7D
  502. X `20
  503. X**************
  504. X*** 122,128
  505. X              `7B
  506. X                  C_POS = end_of_line();
  507. X                  /* next step handles newline at the EOB */
  508. X!                 if ((C_POS == EOB) `7C`7C (C_POS == EOB - 1) && (*C_POS ==
  509. V '\n')) return (save - n - 1);
  510. X                  C_LINE++;
  511. X                  C_POS++;
  512. X                  if (SELECTIVE_I_DISPLAY)
  513. X--- 324,331 -----
  514. X              `7B
  515. X                  C_POS = end_of_line();
  516. X                  /* next step handles newline at the EOB */
  517. X!                 if ((C_POS == EOB) `7C`7C (C_POS == EOB - 1) && (*C_POS ==
  518. V '\n'))`20
  519. X!                   return (save - n - 1);
  520. X                  C_LINE++;
  521. X                  C_POS++;
  522. X                  if (SELECTIVE_I_DISPLAY && !MOST_W_OPT)
  523. X**************
  524. X*** 125,131
  525. X                  if ((C_POS == EOB) `7C`7C (C_POS == EOB - 1) && (*C_POS ==
  526. V '\n')) return (save - n - 1);
  527. X                  C_LINE++;
  528. X                  C_POS++;
  529. X!                 if (SELECTIVE_I_DISPLAY)
  530. X                    `7B
  531. X                        p = C_POS;
  532. X                        ok = 1;
  533. X--- 328,334 -----
  534. X                    return (save - n - 1);
  535. X                  C_LINE++;
  536. X                  C_POS++;
  537. X!                 if (SELECTIVE_I_DISPLAY && !MOST_W_OPT)
  538. X                    `7B
  539. X                        p = C_POS;
  540. X                        ok = 1;
  541. X**************
  542. X*** 160,166
  543. X                  if (C_POS == BEG) return (n - save - 1);
  544. X                  C_POS--;
  545. X                  C_LINE--;
  546. X!                 if (SELECTIVE_I_DISPLAY)
  547. X                    `7B
  548. X                        C_POS = beg_of_line();
  549. X                        p = C_POS;
  550. X--- 363,369 -----
  551. X                  if (C_POS == BEG) return (n - save - 1);
  552. X                  C_POS--;
  553. X                  C_LINE--;
  554. X!                 if (SELECTIVE_I_DISPLAY && !MOST_W_OPT)
  555. X                    `7B
  556. X                        C_POS = beg_of_line();
  557. X                        p = C_POS;
  558. X**************
  559. X*** 188,194
  560. X      int save_line = C_LINE, n;
  561. X      unsigned char *save_beg = beg, *save_eob = EOB, *save_pos = C_POS;
  562. X `20
  563. X!     if (MOST_B_OPT) return((int)(end - beg) / 16);
  564. X      BEG = C_POS = beg;
  565. X      EOB = end;
  566. X      n = 1;
  567. X--- 391,402 -----
  568. X      int save_line = C_LINE, n;
  569. X      unsigned char *save_beg = beg, *save_eob = EOB, *save_pos = C_POS;
  570. X `20
  571. X!     if (MOST_B_OPT)
  572. X!       `7B
  573. X!           n = (int)(end - beg)/16;
  574. X!           if ((n * 16) == (end - beg)) return(n);
  575. X!           else return(n + 1);
  576. X!       `7D
  577. X      BEG = C_POS = beg;
  578. X      EOB = end;
  579. X      n = 1;
  580. X**************
  581. X*** 271,276
  582. X      int save_line, dir;
  583. X      register int dif_c, dif_b,dif_t;
  584. X      int ret;
  585. X `20
  586. X      if (MOST_B_OPT)
  587. X        `7B
  588. X--- 479,485 -----
  589. X      int save_line, dir;
  590. X      register int dif_c, dif_b,dif_t;
  591. X      int ret;
  592. X+     extern int S_DIFF;
  593. X `20
  594. X      if (MOST_B_OPT)
  595. X        `7B
  596. X**************
  597. X*** 277,283
  598. X            return (1 + (pos - BEG)/16);
  599. X        `7D
  600. X     `20
  601. X-        `20
  602. X      save_pos = C_POS;
  603. X      save_line = C_LINE;
  604. X     `20
  605. X--- 486,491 -----
  606. X            return (1 + (pos - BEG)/16);
  607. X        `7D
  608. X     `20
  609. X      save_pos = C_POS;
  610. X      save_line = C_LINE;
  611. X     `20
  612. X**************
  613. X*** 319,324
  614. X                  C_POS++;
  615. X                  C_LINE++;
  616. X              `7D
  617. X        `7D
  618. X      else
  619. X        `7B
  620. X--- 527,542 -----
  621. X                  C_POS++;
  622. X                  C_LINE++;
  623. X              `7D
  624. X+`20
  625. X+           /*
  626. X+           **  if this is the unseen portion of a wrapped line,
  627. X+           **  the display puts it on the next line
  628. X+           */
  629. X+           if (MOST_W_OPT &&
  630. X+               (C_POS == pos `7C`7C
  631. X+                (C_POS != end_of_line1() &&
  632. X+                 apparant_distance(pos) + S_DIFF >= SCREEN_WIDTH)))
  633. X+             C_LINE++;
  634. X        `7D
  635. X      else
  636. X        `7B
  637. X**************
  638. X*** 335,341
  639. X      return(ret);
  640. X  `7D
  641. X `20
  642. X! /* given a buffer position, find the line and column */
  643. X  void find_row_column(unsigned char *pos, int *r, int *c)
  644. X  `7B
  645. X      unsigned char *beg, *save_pos;
  646. X--- 553,561 -----
  647. X      return(ret);
  648. X  `7D
  649. X `20
  650. X! /*
  651. X! **  Given a buffer position, find the line and column.
  652. X! */
  653. X  void find_row_column(unsigned char *pos, int *r, int *c)
  654. X  `7B
  655. X      unsigned char *beg, *save_pos;
  656. X**************
  657. X*** 339,345
  658. X  void find_row_column(unsigned char *pos, int *r, int *c)
  659. X  `7B
  660. X      unsigned char *beg, *save_pos;
  661. X!     int save_line;
  662. X `20
  663. X `20
  664. X      if (pos <= BEG)
  665. X--- 559,566 -----
  666. X  void find_row_column(unsigned char *pos, int *r, int *c)
  667. X  `7B
  668. X      unsigned char *beg, *save_pos;
  669. X!     int save_line,p;
  670. X!     extern int S_DIFF;
  671. X `20
  672. X      if (pos <= BEG)
  673. X        `7B
  674. X**************
  675. X*** 341,347
  676. X      unsigned char *beg, *save_pos;
  677. X      int save_line;
  678. X `20
  679. X-`20
  680. X      if (pos <= BEG)
  681. X        `7B
  682. X            *r = 1;
  683. X--- 562,567 -----
  684. X      int save_line,p;
  685. X      extern int S_DIFF;
  686. X `20
  687. X      if (pos <= BEG)
  688. X        `7B
  689. X            *r = 1;
  690. X**************
  691. X*** 353,358
  692. X      save_pos = C_POS;
  693. X      *r = what_line(pos);
  694. X     `20
  695. X      if (MOST_B_OPT)
  696. X        `7B
  697. X            *c = (int) (pos - BEG) - *r * 16 + 1;
  698. X--- 573,581 -----
  699. X      save_pos = C_POS;
  700. X      *r = what_line(pos);
  701. X     `20
  702. X+     /*`20
  703. X+     **  Now we have found the line it is on so get the column.
  704. X+     */
  705. X      if (MOST_B_OPT)
  706. X        `7B
  707. X            *c = (unsigned char *)((int)(pos) - (((int)pos/16) * 16) + 41);
  708. X**************
  709. X*** 355,361
  710. X     `20
  711. X      if (MOST_B_OPT)
  712. X        `7B
  713. X!           *c = (int) (pos - BEG) - *r * 16 + 1;
  714. X            return;
  715. X        `7D
  716. X      C_LINE = *r;
  717. X--- 578,584 -----
  718. X      */
  719. X      if (MOST_B_OPT)
  720. X        `7B
  721. X!           *c = (unsigned char *)((int)(pos) - (((int)pos/16) * 16) + 41);
  722. X            return;
  723. X        `7D
  724. X `20
  725. X**************
  726. X*** 358,363
  727. X            *c = (int) (pos - BEG) - *r * 16 + 1;
  728. X            return;
  729. X        `7D
  730. X      C_LINE = *r;
  731. X      C_POS = pos;
  732. X     `20
  733. X--- 581,587 -----
  734. X            *c = (unsigned char *)((int)(pos) - (((int)pos/16) * 16) + 41);
  735. X            return;
  736. X        `7D
  737. X+`20
  738. X      C_LINE = *r;
  739. X      C_POS = pos;
  740. X      *c = apparant_distance(pos) + S_DIFF;
  741. X**************
  742. X*** 360,370
  743. X        `7D
  744. X      C_LINE = *r;
  745. X      C_POS = pos;
  746. X!    `20
  747. X!     /* Now we have found the line it is on so.... */
  748. X!     beg = beg_of_line();
  749. X!     *c = 1;
  750. X!     while (beg++ < pos) *c = *c + 1;
  751. X      C_LINE = save_line;
  752. X      C_POS = save_pos;
  753. X  `7D      `20
  754. X--- 584,594 -----
  755. X `20
  756. X      C_LINE = *r;
  757. X      C_POS = pos;
  758. X!     *c = apparant_distance(pos) + S_DIFF;
  759. X!     if (MOST_W_OPT)
  760. X!       if (end_of_line() != end_of_line1())
  761. X!         if (*c >= SCREEN_WIDTH) *c -= (SCREEN_WIDTH - 1);
  762. X!`20
  763. X      C_LINE = save_line;
  764. X      C_POS = save_pos;
  765. X  `7D      `20
  766. X**************
  767. X*** 392,397
  768. X      Buffer *buf;
  769. X `20
  770. X      buf = (Buffer *) malloc(sizeof(Buffer));
  771. X      strcpy(buf->file,file);
  772. X      return(buf);
  773. X  `7D
  774. X--- 616,622 -----
  775. X      Buffer *buf;
  776. X `20
  777. X      buf = (Buffer *) malloc(sizeof(Buffer));
  778. X+     buf->mark = 0;
  779. X      strcpy(buf->file,file);
  780. X      return(buf);
  781. X  `7D
  782. X**************
  783. X*** 395,397
  784. X      strcpy(buf->file,file);
  785. X      return(buf);
  786. X  `7D
  787. X--- 620,624 -----
  788. X      strcpy(buf->file,file);
  789. X      return(buf);
  790. X  `7D
  791. X+`20
  792. X+`20
  793. $ CALL UNPACK BUFFER_C.PAT;364 1165202775
  794. $ create 'f'
  795. X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dcmd.c;2
  796. X--- disk$disk1:`5Bflowers.swing.src`5Dcmd.c;3
  797. X**************
  798. X*** 14,20
  799. X  int do_extended_key()
  800. X  `7B
  801. X      char ch, och, junk`5B80`5D;
  802. X!     int quit = 0, n;
  803. X      unsigned char *save;
  804. X     `20
  805. X      select_minibuffer();
  806. X--- 14,20 -----
  807. X  int do_extended_key()
  808. X  `7B
  809. X      char ch, och, junk`5B80`5D;
  810. X!     int quit = 0, n, m_bell = 0;
  811. X      unsigned char *save;
  812. X     `20
  813. X      select_minibuffer();
  814. X**************
  815. X*** 132,138
  816. X                        NUM_LINES = count_lines(BEG,EOB);
  817. X                    `7D
  818. X                  if (SELECTIVE_I_DISPLAY)
  819. X!                   sprintf(junk,
  820. X                            "Selective Indentation Display set at column %u.
  821. V",n);
  822. X                  else
  823. X                    sprintf(junk,
  824. X--- 132,139 -----
  825. X                        NUM_LINES = count_lines(BEG,EOB);
  826. X                    `7D
  827. X                  if (SELECTIVE_I_DISPLAY)
  828. X!                   `7B
  829. X!                         sprintf(junk,
  830. X                            "Selective Indentation Display set at column %u.
  831. V",n);
  832. X                          if (MOST_W_OPT)
  833. X                            `7B
  834. X**************
  835. X*** 134,139
  836. X                  if (SELECTIVE_I_DISPLAY)
  837. X                    sprintf(junk,
  838. X                            "Selective Indentation Display set at column %u.
  839. V",n);
  840. X                  else
  841. X                    sprintf(junk,
  842. X      "Selective Indentation Display off.  Precede the :O with a number to s
  843. Vet.");
  844. X--- 135,146 -----
  845. X                    `7B
  846. X                          sprintf(junk,
  847. X                            "Selective Indentation Display set at column %u.
  848. V",n);
  849. X+                         if (MOST_W_OPT)
  850. X+                           `7B
  851. X+                               strcat(junk,"  Disable Wrap to implement.");
  852. X+                               m_bell = 1;
  853. X+                           `7D
  854. X+                   `7D
  855. X                  else
  856. X                    `7B
  857. X                        strcpy(junk,"Selective Indentation Display off.");
  858. X**************
  859. X*** 135,143
  860. X                    sprintf(junk,
  861. X                            "Selective Indentation Display set at column %u.
  862. V",n);
  863. X                  else
  864. X!                   sprintf(junk,
  865. X!     "Selective Indentation Display off.  Precede the :O with a number to s
  866. Vet.");
  867. X!                 most_message(junk,0);
  868. X                  break;
  869. X `20
  870. X              /*
  871. X--- 142,152 -----
  872. X                            `7D
  873. X                    `7D
  874. X                  else
  875. X!                   `7B
  876. X!                       strcpy(junk,"Selective Indentation Display off.");
  877. X!                       strcat(junk,"  Precede the :O with a number to set."
  878. V);
  879. X!                   `7D
  880. X!                 most_message(junk,m_bell);
  881. X                  break;
  882. X `20
  883. X              /*
  884. X**************
  885. X*** 166,173
  886. X                    `7B
  887. X                        strcpy(junk,"Display Tabs as `5EI on.");
  888. X                        if (!MOST_V_OPT)
  889. X!                         strcat(junk,"  Toggle Verbose mode to implement.")
  890. V;
  891. X!                       most_message(junk,0);
  892. X                    `7D
  893. X                  break;
  894. X `20
  895. X--- 175,185 -----
  896. X                    `7B
  897. X                        strcpy(junk,"Display Tabs as `5EI on.");
  898. X                        if (!MOST_V_OPT)
  899. X!                         `7B
  900. X!                             strcat(junk,"  Toggle Verbose mode to implemen
  901. Vt.");
  902. X!                             m_bell = 1;
  903. X!                         `7D
  904. X!                       most_message(junk,m_bell);
  905. X                    `7D
  906. X                  break;
  907. X `20
  908. X**************
  909. X*** 192,198
  910. X                  MOST_W_OPT = !MOST_W_OPT;
  911. X                  NUM_LINES = count_lines(BEG,EOB);
  912. X                  if (MOST_W_OPT)
  913. X!                   most_message("Wrapping on.",0);
  914. X                  else
  915. X                    most_message("Wrapping off.",0);
  916. X                  break;
  917. X--- 204,219 -----
  918. X                  MOST_W_OPT = !MOST_W_OPT;
  919. X                  NUM_LINES = count_lines(BEG,EOB);
  920. X                  if (MOST_W_OPT)
  921. X!                   `7B
  922. X!                       strcpy(junk,"Wrapping on.");
  923. X!                       if (SELECTIVE_I_DISPLAY)
  924. X!                         `7B
  925. X!                             strcat(junk,
  926. X!                                   "  Selective Identation Display suppress
  927. Ved.");
  928. X!                             m_bell = 1;
  929. X!                         `7D
  930. X!                       most_message(junk,m_bell);
  931. X!                   `7D
  932. X                  else
  933. X                    `7B
  934. X                        strcpy(junk,"Wrapping off.");
  935. X**************
  936. X*** 194,200
  937. X                  if (MOST_W_OPT)
  938. X                    most_message("Wrapping on.",0);
  939. X                  else
  940. X!                   most_message("Wrapping off.",0);
  941. X                  break;
  942. X `20
  943. X              default:
  944. X--- 215,230 -----
  945. X                        most_message(junk,m_bell);
  946. X                    `7D
  947. X                  else
  948. X!                   `7B
  949. X!                       strcpy(junk,"Wrapping off.");
  950. X!                       if (SELECTIVE_I_DISPLAY)
  951. X!                         `7B
  952. X!                             strcat(junk,
  953. X!                                  "  Selective Identation Display implement
  954. Ved.");
  955. X!                             m_bell = 1;
  956. X!                         `7D
  957. X!                       most_message(junk,m_bell);
  958. X!                   `7D
  959. X                  break;
  960. X `20
  961. X              default:
  962. $ CALL UNPACK CMD_C.PAT;364 1698939476
  963. $ create 'f'
  964. X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dhelp.c;2
  965. X--- disk$disk1:`5Bflowers.swing.src`5Dhelp.c;4
  966. X**************
  967. X*** 100,106
  968. X            if (file_visible(buf_name)) return;
  969. X            if (!split_window())
  970. X              `7B
  971. X!                 most_message("Two many windows.",1);
  972. X                  return;
  973. X              `7D
  974. X            update_status(1);  /* create status line of prev. window */
  975. X--- 100,106 -----
  976. X            if (file_visible(buf_name)) return;
  977. X            if (!split_window())
  978. X              `7B
  979. X!                 most_message("Too many windows.",1);
  980. X                  return;
  981. X              `7D
  982. X            update_status(1);  /* create status line of prev. window */
  983. $ CALL UNPACK HELP_C.PAT;364 487664408
  984. $ create 'f'
  985. X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dkeym.c;2
  986. X--- disk$disk1:`5Bflowers.swing.src`5Dkeym.c;4
  987. X**************
  988. X*** 1046,1053
  989. X  `7B
  990. X      int mark = BUF->mark;
  991. X      BUF->mark = C_LINE;
  992. X!     update_window(mark);
  993. X!     most_message("Mark Set.",0);
  994. X  `7D
  995. X `20
  996. X  void one_window_cmd()
  997. X--- 1046,1058 -----
  998. X  `7B
  999. X      int mark = BUF->mark;
  1000. X      BUF->mark = C_LINE;
  1001. X!     if (!mark `7C`7C mark == BUF->mark)
  1002. X!       most_message("Mark Set.",0);
  1003. X!     else
  1004. X!       `7B
  1005. X!           update_window(mark);
  1006. X!           most_message("Mark Set.  Toggled to previous mark.",0);
  1007. X!       `7D
  1008. X  `7D
  1009. X `20
  1010. X  void one_window_cmd()
  1011. X**************
  1012. X*** 1078,1083
  1013. X      int col, line, n = 1;
  1014. X      unsigned char *pos;
  1015. X     `20
  1016. X      if (DIGIT_ARG != NULL) n = *DIGIT_ARG;
  1017. X      line = search(CURS_POS + SEARCH_DIR, n, &col);
  1018. X      if (line < 1) return;
  1019. X--- 1083,1094 -----
  1020. X      int col, line, n = 1;
  1021. X      unsigned char *pos;
  1022. X     `20
  1023. X+     if (SELECTIVE_I_DISPLAY)
  1024. X+       `7B
  1025. X+           most_message
  1026. X+                ("Search disabled when Selective Indentation Display is set
  1027. V",1);
  1028. X+           return;
  1029. X+       `7D
  1030. X      if (DIGIT_ARG != NULL) n = *DIGIT_ARG;
  1031. X      line = search(CURS_POS + SEARCH_DIR, n, &col);
  1032. X      if (line < 1) return;
  1033. X**************
  1034. X*** 1091,1096
  1035. X `20
  1036. X  void search_cmd()
  1037. X  `7B
  1038. X      SEARCH_DIR = 1;
  1039. X      if (read_from_minibuffer("Search /",SEARCH_STR) == -1)
  1040. X        `7B
  1041. X--- 1102,1113 -----
  1042. X `20
  1043. X  void search_cmd()
  1044. X  `7B
  1045. X+     if (SELECTIVE_I_DISPLAY)
  1046. X+       `7B
  1047. X+           most_message
  1048. X+                ("Search disabled when Selective Indentation Display is set
  1049. V",1);
  1050. X+           return;
  1051. X+       `7D
  1052. X      SEARCH_DIR = 1;
  1053. X      if (read_from_minibuffer("Search /",SEARCH_STR) == -1)
  1054. X        `7B
  1055. X**************
  1056. X*** 1106,1111
  1057. X `20
  1058. X  void search_back_cmd()
  1059. X  `7B
  1060. X      SEARCH_DIR = -1;
  1061. X      if (read_from_minibuffer("Search \\",SEARCH_STR) == -1)
  1062. X        `7B
  1063. X--- 1123,1134 -----
  1064. X `20
  1065. X  void search_back_cmd()
  1066. X  `7B
  1067. X+     if (SELECTIVE_I_DISPLAY)
  1068. X+       `7B
  1069. X+           most_message
  1070. X+                ("Search disabled when Selective Indentation Display is set
  1071. V",1);
  1072. X+           return;
  1073. X+       `7D
  1074. X      SEARCH_DIR = -1;
  1075. X      if (read_from_minibuffer("Search \\",SEARCH_STR) == -1)
  1076. X        `7B
  1077. X**************
  1078. X*** 1174,1179
  1079. X      if (SCREEN_WIDTH == 80)
  1080. X        `7B
  1081. X            set_width(132);
  1082. X        `7D         `20
  1083. X      else if (SCREEN_WIDTH == 132)
  1084. X        `7B
  1085. X--- 1197,1203 -----
  1086. X      if (SCREEN_WIDTH == 80)
  1087. X        `7B
  1088. X            set_width(132);
  1089. X+           most_message("Display Width toggled to 132.",0);
  1090. X        `7D         `20
  1091. X      else if (SCREEN_WIDTH == 132)
  1092. X        `7B
  1093. X**************
  1094. X*** 1178,1182
  1095. X      else if (SCREEN_WIDTH == 132)
  1096. X        `7B
  1097. X            set_width(80);
  1098. X!       `7D         `20
  1099. X  `7D
  1100. X--- 1202,1209 -----
  1101. X      else if (SCREEN_WIDTH == 132)
  1102. X        `7B
  1103. X            set_width(80);
  1104. X!           most_message("Display Width toggled to 80.",0);
  1105. X!       `7D
  1106. X!     else
  1107. X!       most_message("Width can only be toggled for 80 or 132 column windows
  1108. V",1);
  1109. X  `7D
  1110. $ CALL UNPACK KEYM_C.PAT;364 524160985
  1111. $ create 'f'
  1112. X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dline.c;2
  1113. X--- disk$disk1:`5Bflowers.swing.src`5Dline.c;6
  1114. X**************
  1115. X*** 5,10
  1116. X  #include "line.h"
  1117. X   `20
  1118. X  extern int COLUMN;
  1119. X `20
  1120. X  #define MAX_LINE_LEN 500
  1121. X `20
  1122. X--- 5,15 -----
  1123. X  #include "line.h"
  1124. X   `20
  1125. X  extern int COLUMN;
  1126. X+ extern unsigned char *M_POS;
  1127. X+ extern int M_FLAG;
  1128. X+ extern int W_LINE;
  1129. X+ extern int TAB_R;
  1130. X+ extern int ESC_NUM;
  1131. X `20
  1132. X  #define MAX_LINE_LEN 500
  1133. X `20
  1134. X**************
  1135. X*** 85,92
  1136. X  int analyse_line(unsigned char *beg,
  1137. X                   unsigned char *end, char *out, char *attributes)
  1138. X  `7B
  1139. X!     int test, ii, fold, ii_max, j, ok;
  1140. X!     unsigned char ch,attr;
  1141. X `20
  1142. X      test = 0;
  1143. X      ii = 0;
  1144. X--- 90,97 -----
  1145. X  int analyse_line(unsigned char *beg,
  1146. X                   unsigned char *end, char *out, char *attributes)
  1147. X  `7B
  1148. X!     int test, ii, fold, ii_max, j, ok, esc_flag = 0;
  1149. X!     unsigned char *b,*e,*b1,*e1,ch,attr,at_esc = ' ';
  1150. X `20
  1151. X      test = 0;
  1152. X      ii = 0;
  1153. X**************
  1154. X*** 92,97
  1155. X      ii = 0;
  1156. X      ii_max = 0;
  1157. X      fold = 0;
  1158. X      /*
  1159. X      **  while character attributes need to be assigned
  1160. X      */
  1161. X--- 97,121 -----
  1162. X      ii = 0;
  1163. X      ii_max = 0;
  1164. X      fold = 0;
  1165. X+     if (MOST_W_OPT)
  1166. X+       `7B
  1167. X+           if (W_LINE)
  1168. X+             `7B
  1169. X+                 esc_flag = 1;
  1170. X+                 if      (ESC_NUM == 1) at_esc = 'b';
  1171. X+                 else if (ESC_NUM == 4) at_esc = 'u';
  1172. X+                 else if (ESC_NUM == 7) at_esc = 'r';
  1173. X+                 else esc_flag = 0;
  1174. X+             `7D
  1175. X+           if (M_FLAG)
  1176. X+             `7B
  1177. X+                 b = beg;
  1178. X+                 e = end;
  1179. X+ `09`09b1 = beg_of_line1();
  1180. X+                 e1 = end_of_line1();
  1181. X+             `7D
  1182. X+       `7D
  1183. X+`20
  1184. X      /*
  1185. X      **  while character attributes need to be assigned
  1186. X      */
  1187. X**************
  1188. X*** 103,109
  1189. X            attr = ' '; /* turn off underlining or bolding attribute */
  1190. X `20
  1191. X            /*
  1192. X!           **  set up bolding of line if `5EM
  1193. X            */
  1194. X            if (!MOST_V_OPT && ch == '\015')
  1195. X              `7B
  1196. X--- 127,133 -----
  1197. X            attr = ' '; /* turn off underlining or bolding attribute */
  1198. X `20
  1199. X            /*
  1200. X!           **  set up bolding of line via `5EM
  1201. X            */
  1202. X            if (!MOST_V_OPT && ch == '\015')
  1203. X              `7B
  1204. X**************
  1205. X*** 112,117
  1206. X                        fold = 1;
  1207. X                        if (ii > ii_max) ii_max = ii - 1; /* `5EM contribute
  1208. Vs nil */
  1209. X                        ii = 0;
  1210. X                    `7D
  1211. X              `7D
  1212. X `20
  1213. X--- 136,149 -----
  1214. X                        fold = 1;
  1215. X                        if (ii > ii_max) ii_max = ii - 1; /* `5EM contribute
  1216. Vs nil */
  1217. X                        ii = 0;
  1218. X+                       if (MOST_W_OPT && W_LINE)
  1219. X+                         `7B
  1220. X+                             beg = M_POS - b1 + b + 1;
  1221. X+                             if (beg > e1)
  1222. X+                               `7B
  1223. X+                                   beg = e1 + 1;
  1224. X+                               `7D
  1225. X+                         `7D
  1226. X                    `7D
  1227. X              `7D
  1228. X `20
  1229. X**************
  1230. X*** 125,131
  1231. X              `7D
  1232. X           `20
  1233. X            /*
  1234. X!           **  assign bolding or underlining attributes
  1235. X            */
  1236. X            else if (test `7C`7C fold)
  1237. X              `7B
  1238. X--- 157,164 -----
  1239. X              `7D
  1240. X           `20
  1241. X            /*
  1242. X!           **  set up or turn off bolding, underlining or reversing
  1243. X!           **  invoked via an <ESC>`5B#m found within the line
  1244. X            */
  1245. X            else if (!MOST_V_OPT && ch == '\033' && *beg == '`5B' &&
  1246. X                     (*(beg + 1) == '0' `7C`7C *(beg + 1) == '1' `7C`7C
  1247. X**************
  1248. X*** 127,132
  1249. X            /*
  1250. X            **  assign bolding or underlining attributes
  1251. X            */
  1252. X            else if (test `7C`7C fold)
  1253. X              `7B
  1254. X                  test = 0;
  1255. X--- 160,208 -----
  1256. X            **  set up or turn off bolding, underlining or reversing
  1257. X            **  invoked via an <ESC>`5B#m found within the line
  1258. X            */
  1259. X+           else if (!MOST_V_OPT && ch == '\033' && *beg == '`5B' &&
  1260. X+                    (*(beg + 1) == '0' `7C`7C *(beg + 1) == '1' `7C`7C
  1261. X+                     *(beg + 1) == '4' `7C`7C *(beg + 1) == '7') &&
  1262. X+                     *(beg + 2) == 'm')
  1263. X+             `7B
  1264. X+                 beg++;
  1265. X+                 esc_flag = 1;
  1266. X+                 if      (*beg == '1') at_esc = 'b';
  1267. X+                 else if (*beg == '4') at_esc = 'u';
  1268. X+                 else if (*beg == '7') at_esc = 'r';
  1269. X+                 else
  1270. X+                   `7B
  1271. X+                       at_esc = ' ';
  1272. X+                       esc_flag = 0;
  1273. X+                   `7D
  1274. X+                 beg += 2;
  1275. X+             `7D
  1276. X+`20
  1277. X+           /*
  1278. X+           **  expand tabs to 8 spaces if '\t' (`5EI)
  1279. X+           */
  1280. X+           else if (ch == '\t' && (!MOST_T_OPT `7C`7C !MOST_V_OPT))
  1281. X+             `7B
  1282. X+                 if (MOST_W_OPT && W_LINE)
  1283. X+                   `7B
  1284. X+                       if (ii == 0)
  1285. X+                         j = TAB_R;
  1286. X+                       else
  1287. X+                         j = 8 * (ii/8 + 1) - ii + TAB_R;
  1288. X+                   `7D
  1289. X+                 else
  1290. X+                   j = 8 * (ii/8 + 1) - ii;  /* 8 column tabs */
  1291. X+                 while(j--)
  1292. X+                   `7B
  1293. X+                       out`5Bii`5D = ' ';
  1294. X+                       attributes`5Bii++`5D = ' ';
  1295. X+                   `7D
  1296. X+             `7D
  1297. X+            `20
  1298. X+           /*
  1299. X+           **  assign bolding or underlining attributes
  1300. X+           **  invoked via `5EM or '\b' (`5EH)
  1301. X+           */
  1302. X            else if (test `7C`7C fold)
  1303. X              `7B
  1304. X                  test = 0;
  1305. X**************
  1306. X*** 146,152
  1307. X              `7D
  1308. X `20
  1309. X            /*
  1310. X!           **  expand tabs to 8 spaces if '\t' (`5EI)
  1311. X            */
  1312. X            else if (ch == '\t' && (!MOST_T_OPT `7C`7C !MOST_V_OPT))
  1313. X              `7B
  1314. X--- 222,229 -----
  1315. X              `7D
  1316. X `20
  1317. X            /*
  1318. X!           **  assign bolding, underlining or reversing attributes
  1319. X!           **  invoked via an <ESC>`5B#m found within the line
  1320. X            */
  1321. X            else if (esc_flag)
  1322. X              `7B
  1323. X**************
  1324. X*** 148,154
  1325. X            /*
  1326. X            **  expand tabs to 8 spaces if '\t' (`5EI)
  1327. X            */
  1328. X!           else if (ch == '\t' && (!MOST_T_OPT `7C`7C !MOST_V_OPT))
  1329. X              `7B
  1330. X                  j = 8 * (ii/8 + 1) - ii;  /* 8 column tabs */
  1331. X                  while(j--)
  1332. X--- 225,231 -----
  1333. X            **  assign bolding, underlining or reversing attributes
  1334. X            **  invoked via an <ESC>`5B#m found within the line
  1335. X            */
  1336. X!           else if (esc_flag)
  1337. X              `7B
  1338. X                  attributes`5Bii`5D = at_esc; /* assign attribute */
  1339. X                  out`5Bii++`5D = ch;
  1340. X**************
  1341. X*** 150,161
  1342. X            */
  1343. X            else if (ch == '\t' && (!MOST_T_OPT `7C`7C !MOST_V_OPT))
  1344. X              `7B
  1345. X!                 j = 8 * (ii/8 + 1) - ii;  /* 8 column tabs */
  1346. X!                 while(j--)
  1347. X!                   `7B
  1348. X!                       out`5Bii`5D = ' ';
  1349. X!                       attributes`5Bii++`5D = attr;
  1350. X!                   `7D
  1351. X              `7D
  1352. X             `20
  1353. X            /*
  1354. X--- 227,234 -----
  1355. X            */
  1356. X            else if (esc_flag)
  1357. X              `7B
  1358. X!                 attributes`5Bii`5D = at_esc; /* assign attribute */
  1359. X!                 out`5Bii++`5D = ch;
  1360. X              `7D
  1361. X `20
  1362. X            /*
  1363. X**************
  1364. X*** 157,163
  1365. X                        attributes`5Bii++`5D = attr;
  1366. X                    `7D
  1367. X              `7D
  1368. X!            `20
  1369. X            /*
  1370. X            **  no bold or underline attribute
  1371. X            */
  1372. X--- 230,236 -----
  1373. X                  attributes`5Bii`5D = at_esc; /* assign attribute */
  1374. X                  out`5Bii++`5D = ch;
  1375. X              `7D
  1376. X!`20
  1377. X            /*
  1378. X            **  no bold, underline, or reverse attribute
  1379. X            */
  1380. X**************
  1381. X*** 159,165
  1382. X              `7D
  1383. X             `20
  1384. X            /*
  1385. X!           **  no bold or underline attribute
  1386. X            */
  1387. X            else
  1388. X              `7B
  1389. X--- 232,238 -----
  1390. X              `7D
  1391. X `20
  1392. X            /*
  1393. X!           **  no bold, underline, or reverse attribute
  1394. X            */
  1395. X            else
  1396. X              `7B
  1397. X**************
  1398. X*** 166,171
  1399. X                  out`5Bii`5D = ch;
  1400. X                  attributes`5Bii++`5D = attr;
  1401. X              `7D
  1402. X        `7D /* while */
  1403. X      if (fold) ii = ii_max + 1;
  1404. X `20
  1405. X--- 239,272 -----
  1406. X                  out`5Bii`5D = ch;
  1407. X                  attributes`5Bii++`5D = attr;
  1408. X              `7D
  1409. X+`20
  1410. X+           /*
  1411. X+           **  handle overstriking of wrapped lines
  1412. X+           **  via `5EM if it is in a later line
  1413. X+           */
  1414. X+           if (!MOST_V_OPT && MOST_W_OPT && M_FLAG &&
  1415. X+ `09      (beg <= M_POS && beg == end + 1))
  1416. X+             `7B
  1417. X+                 if (!W_LINE)
  1418. X+                   `7B
  1419. X+                       beg = M_POS + 1;
  1420. X+                       end = M_POS - b1 + e + 1;
  1421. X+ `09`09      if (end > e1) end = e1;
  1422. X+                   `7D
  1423. X+                 else
  1424. X+                   `7B
  1425. X+                       beg = M_POS - b1 + b + 1;
  1426. X+                       if (beg > e1) beg = end + 1;
  1427. X+                       else
  1428. X+                         `7B
  1429. X+                             end = M_POS - b1 + e + 1;
  1430. X+                             if (end > e1) end = e1;
  1431. X+                         `7D
  1432. X+                   `7D
  1433. X+                 fold = 1;
  1434. X+                 ii_max = ii - 1;
  1435. X+                 ii = 0;
  1436. X+             `7D
  1437. X        `7D /* while */
  1438. X      if (fold) ii = ii_max + 1;
  1439. X `20
  1440. X**************
  1441. X*** 255,261
  1442. X            if (!MOST_V_OPT)
  1443. X              `7B
  1444. X                  /*
  1445. X!                 **  does bolding or underlining need to be turned on?
  1446. X                  */
  1447. X                  at = attr`5Bi`5D;
  1448. X                  if ((at != ' ') && (!bold `7C`7C count == COLUMN))
  1449. X--- 356,362 -----
  1450. X            if (!MOST_V_OPT)
  1451. X              `7B
  1452. X                  /*
  1453. X!                 **  does bold, underline, or reverse need to be turned on?
  1454. X                  */
  1455. X                  at = attr`5Bi`5D;
  1456. X                  if ((at != ' ') && (!bold `7C`7C count == COLUMN))
  1457. X**************
  1458. X*** 261,267
  1459. X                  if ((at != ' ') && (!bold `7C`7C count == COLUMN))
  1460. X                    `7B
  1461. X                        bold = 1;
  1462. X!                       /* u and b have same length */
  1463. X                        if (ok) for (j = 0; j < b_len; j++)
  1464. X                          `7B
  1465. X                              if (at == 'b') out`5Bii++`5D = b_str`5Bj`5D;
  1466. X--- 362,368 -----
  1467. X                  if ((at != ' ') && (!bold `7C`7C count == COLUMN))
  1468. X                    `7B
  1469. X                        bold = 1;
  1470. X!                       /* u, b and r have same length */
  1471. X                        if (ok) for (j = 0; j < b_len; j++)
  1472. X                          `7B
  1473. X                              if (at == 'b')
  1474. X**************
  1475. X*** 264,271
  1476. X                        /* u and b have same length */
  1477. X                        if (ok) for (j = 0; j < b_len; j++)
  1478. X                          `7B
  1479. X!                             if (at == 'b') out`5Bii++`5D = b_str`5Bj`5D;
  1480. X!                             else out`5Bii++`5D = u_str`5Bj`5D;
  1481. X                          `7D
  1482. X                       `20
  1483. X                    `7D
  1484. X--- 365,376 -----
  1485. X                        /* u, b and r have same length */
  1486. X                        if (ok) for (j = 0; j < b_len; j++)
  1487. X                          `7B
  1488. X!                             if (at == 'b')
  1489. X!                               out`5Bii++`5D = b_str`5Bj`5D;
  1490. X!                             else if (at == 'u')
  1491. X!                               out`5Bii++`5D = u_str`5Bj`5D;
  1492. X!                             else
  1493. X!                               out`5Bii++`5D = r_str`5Bj`5D;
  1494. X                          `7D
  1495. X                       `20
  1496. X                    `7D
  1497. X**************
  1498. X*** 269,274
  1499. X                          `7D
  1500. X                       `20
  1501. X                    `7D
  1502. X                  /*
  1503. X                  **  does bolding or underlining need to be turned off?
  1504. X                  */
  1505. X--- 374,380 -----
  1506. X                          `7D
  1507. X                       `20
  1508. X                    `7D
  1509. X+`20
  1510. X                  /*
  1511. X                  **  does bold, underline, or reverse need to be turned off
  1512. V?
  1513. X                  */
  1514. X**************
  1515. X*** 270,276
  1516. X                       `20
  1517. X                    `7D
  1518. X                  /*
  1519. X!                 **  does bolding or underlining need to be turned off?
  1520. X                  */
  1521. X                  else if ((at == ' ') && bold)
  1522. X                    `7B
  1523. X--- 376,382 -----
  1524. X                    `7D
  1525. X `20
  1526. X                  /*
  1527. X!                 **  does bold, underline, or reverse need to be turned off
  1528. V?
  1529. X                  */
  1530. X                  else if ((at == ' ') && bold)
  1531. X                    `7B
  1532. X**************
  1533. X*** 277,282
  1534. X                        bold = 0;
  1535. X                        if (ok) for (j = 0; j < n_len; j++) out`5Bii++`5D =
  1536. V n_str`5Bj`5D;
  1537. X                    `7D
  1538. X                  /*
  1539. X                  **  if its bold or underlined and line is wrapped,
  1540. X                  **  increment count by 2
  1541. X--- 383,389 -----
  1542. X                        bold = 0;
  1543. X                        if (ok) for (j = 0; j < n_len; j++) out`5Bii++`5D =
  1544. V n_str`5Bj`5D;
  1545. X                    `7D
  1546. X+`20
  1547. X                  /*
  1548. X                  **  if it's an escape or control character
  1549. X                  **  don't count it
  1550. X**************
  1551. X*** 278,285
  1552. X                        if (ok) for (j = 0; j < n_len; j++) out`5Bii++`5D =
  1553. V n_str`5Bj`5D;
  1554. X                    `7D
  1555. X                  /*
  1556. X!                 **  if its bold or underlined and line is wrapped,
  1557. X!                 **  increment count by 2
  1558. X                  */
  1559. X                  if (at != ' ' && MOST_W_OPT)
  1560. X                    count += 2;
  1561. X--- 385,392 -----
  1562. X                    `7D
  1563. X `20
  1564. X                  /*
  1565. X!                 **  if it's an escape or control character
  1566. X!                 **  don't count it
  1567. X                  */
  1568. X                  if (ch < ' ' `7C`7C ch > 126)
  1569. X                    `7B
  1570. X**************
  1571. X*** 281,297
  1572. X                  **  if its bold or underlined and line is wrapped,
  1573. X                  **  increment count by 2
  1574. X                  */
  1575. X!                 if (at != ' ' && MOST_W_OPT)
  1576. X!                   count += 2;
  1577. X!                 /*
  1578. X!                 **  if it's an escape sequence or control character
  1579. X!                 **  and line is not wrapped, don't count it
  1580. X!                 */
  1581. X!                 if (ch < ' ' && !MOST_W_OPT)
  1582. X!                   if (ch == '\033')
  1583. X!                     count -= b_len;
  1584. X!                   else
  1585. X!                     count--;
  1586. X              `7D /* if not Verbose mode */
  1587. X           `20
  1588. X            /*
  1589. X--- 388,397 -----
  1590. X                  **  if it's an escape or control character
  1591. X                  **  don't count it
  1592. X                  */
  1593. X!                 if (ch < ' ' `7C`7C ch > 126)
  1594. X!                   `7B
  1595. X!                       count--;
  1596. X!                   `7D
  1597. X              `7D /* if not Verbose mode */
  1598. X           `20
  1599. X            /*
  1600. X**************
  1601. X*** 331,337
  1602. X                        j = max_col - save;
  1603. X                    `7D
  1604. X                 `20
  1605. X!                 if (ok && (j > s_len))`20
  1606. X                    `7B
  1607. X                        ii = mark;
  1608. X                        sprintf(work,s_str,j);
  1609. X--- 431,437 -----
  1610. X                        j = max_col - save;
  1611. X                    `7D
  1612. X                 `20
  1613. X!                 if (ok && (j > s_len) && (count < max_col))`20
  1614. X                    `7B
  1615. X                        ii = mark;
  1616. X                        sprintf(work,s_str,j);
  1617. X**************
  1618. X*** 337,343
  1619. X                        sprintf(work,s_str,j);
  1620. X                        work_len = strlen(work);
  1621. X                        for (j = 0; j < work_len; j++) out`5Bii++`5D = work`
  1622. V5Bj`5D;
  1623. X-                       if (count > max_col) dollar = ii++;
  1624. X                    `7D
  1625. X                  else if (count > max_col)
  1626. X                    `7B
  1627. X--- 437,442 -----
  1628. +-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
  1629.  
  1630.