🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text
Article #4341

troff question

#4341
From: Steve Ring
Date: Wed, 13 Jan 1988 20:01
44 lines
1576 bytes
When I create a macro, say
.de XX
.	\" Ignore trailing blank(s), tab, 
.ie '\\$1' ' \{\
.	tm <space> calling NO ARGS:
.	IP
.\}
.el .ie '\\$1'	' \{\
.	tm <tab> calling NO ARGS:
.	IP
.\}
.el \{\
.	tm calling with ARGS:  ["\\$1"] ["\\$2"]
.	IP "\\$1" "\\$2"\}
..

I want to call it with either
.XX
or 
.XX <name> <length>

but if the user has left over <spaces> and/or <tabs> on the end of the .XX
line (when used without parameters), the macro will use these unwanted
<spaces> <tabs> as arguments. The problem is that is you have on a macro line
.<macro><tab>
then the <macros> sees <tab> as argument $1
I want to skip over these. I can test for each one individually as I have
above, but what about the following combinations:

.XX<space><space><tab><EOL>
.XX<tab><tab><tab><EOL>
.XX<space><tab><EOL>
.XX<tab><space><tab><tab><EOL>

in another words, I want the following, somewhat like in sed 
(sed -e 's/[<space><tab>]*//' to get rid of multiple <space><tab> characters).

.ie '\\$1'[<spaces><tabs>]*' .IP	\" There are no arguments
.el .IP \\$1 \\$2

Any help???-- 
Steve Ring, Compugraphic Corp. Wilmington, Mass. 01887 (617)658-5600 X5092
"Transplanted Buckeye - Go BROWNS!"
...!{decvax,ima,ism780c,ulowell,laidbak,cgeuro,cg-f}!cg-atla!ring
Technical Details
Message-ID: <1265@cg-atla.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!m2c!ulowell!cg-atla!ring

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!m2c!ulowell!cg-atla!ring
From: ring@cg-atla.UUCP (Steve Ring)
Newsgroups: comp.text
Subject: troff question
Message-ID: <1265@cg-atla.UUCP>
Date: 13 Jan 88 20:01:51 GMT
Organization: Compugraphic Corp., Wilmington, Mass
Lines: 44
Keywords: troff