Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!shelby!apple!brutus.cs.uiuc.edu!samsung!cs.utexas.edu!wuarchive!texbell!ficc!peter From: peter@ficc.uu.net (Peter da Silva) Newsgroups: alt.sources Subject: Patch 1 to Browse release of this morning. Message-ID: <7RM10SFxds13@ficc.uu.net> Date: 8 Feb 90 22:09:56 GMT Distribution: alt Organization: Xenix Support, FICC Lines: 145 This adds a new command to browse, 's' loads a saved macro file. The format of the macro file is also slightly changed. This is based on the version I posted this morning, but should work as applied to most versions of browse, since I haven't changed this code recently. Have fun! ------8<------- Tear along dotted line ----------------------------------- *** baseline/browse.c --- browse.c *************** *** 1324,1329 **** --- 1324,1332 ---- case 'S': savedefs(); break; + case 's': + loaddefs(); + break; case 'U'-'@': prev(nlines/2); break; *************** *** 2212,2217 **** --- 2215,2221 ---- char filename[MAXLINE]; static char lastfile[MAXLINE] = "/usr/tmp/macros"; FILE *fp; + char *p; cmdline(); outs("Save macros as "); *************** *** 2228,2237 **** return; } ! for(i=1; i= CHARSET) { + cmdline(); + outs("Not a legal macro character: "); + printf("\\%03o", i & 0xFF); + break; + } + s = buf; + while(!feof(fp)) { + c = getc(fp); + if(feof(fp)) + break; + if(c == '\n' || c == ']') + break; + if(c=='\\') { + c = getc(fp); + if(feof(fp)) + break; + } + *s++ = c; + } + if(c != ']') { + cmdline(); + outs("Unterminated macro: "); + ctloutc(i); + break; + } + *s = 0; + defent(i, buf); + } fclose(fp); } *** baseline/browse.doc --- browse.doc *************** *** 18,23 **** --- 18,24 ---- P,^B Go up 20 lines. R Rename a file. S Save definitions. + s Load definitions. dd Delete file(s). (ask for verification) DD Delete file(s). h Place cursor at beginning of line. -- _--_|\ Peter da Silva. +1 713 274 5180. . / \ \_.--._/ Xenix Support -- it's not just a job, it's an adventure! v "Have you hugged your wolf today?" `-_-'