From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] troff ignoring .eo/.ec after first time From: "Russ Cox" Date: Thu, 22 Nov 2007 11:55:10 -0500 In-Reply-To: <3950E912-6C70-4726-B16D-79008B73FE00@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20071122165500.7C5F21E8C22@holo.morphisms.net> Topicbox-Message-UUID: 086c1914-ead3-11e9-9d60-3106f5b1d025 > On about the third page, some code begins, but at the print() > statement at the end there is some strangeness. If you look inside > the .ms file, there are some .eo and .ec requests. .eo turns off \x > and .ec turns it back on. But why is it ignored after that first > page, which works correctly? assuming that /n/sourcesdump/2007/1122/contrib/pietro/plan9prog.ms is the file in question, the first page isn't "working" correctly either, since your print("hello, world\n"); turns into print("hello, world0); because the \n" interpolates the " register. the reason that .eo doesn't manage to turn this off is that the text between .P1 and .P2 gets copied into a troff diversion for later processing, and that later processing happens during the execution of .P2, by which time your idiom .P1 .eo text .ec .P2 has restored \ as the escape character. you can get your desired effect by doing .P1 .eo text .P2 .ec instead. russ