9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] troff ignoring .eo/.ec after first time
@ 2007-11-21 22:06 Pietro Gagliardi
  2007-11-21 22:39 ` Martin Neubauer
  2007-11-22 16:55 ` Russ Cox
  0 siblings, 2 replies; 3+ messages in thread
From: Pietro Gagliardi @ 2007-11-21 22:06 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hello. Try this:

	tbl /n/sources/contrib/pietro/plan9prog.ms | troff -ms | page

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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] troff ignoring .eo/.ec after first time
  2007-11-21 22:06 [9fans] troff ignoring .eo/.ec after first time Pietro Gagliardi
@ 2007-11-21 22:39 ` Martin Neubauer
  2007-11-22 16:55 ` Russ Cox
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Neubauer @ 2007-11-21 22:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

ms(6) says:

	Many nroff and troff
	requests are unsafe in conjunction with this package, but
	the following requests may be used with impunity after the
	first .PP: `.bp', `.br', `.sp', `.ls', `.na'.

Maybe this helps,
	Martin

* Pietro Gagliardi (pietro10@mac.com) wrote:
> Hello. Try this:
> 
> 	tbl /n/sources/contrib/pietro/plan9prog.ms | troff -ms | page
> 
> 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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9fans] troff ignoring .eo/.ec after first time
  2007-11-21 22:06 [9fans] troff ignoring .eo/.ec after first time Pietro Gagliardi
  2007-11-21 22:39 ` Martin Neubauer
@ 2007-11-22 16:55 ` Russ Cox
  1 sibling, 0 replies; 3+ messages in thread
From: Russ Cox @ 2007-11-22 16:55 UTC (permalink / raw)
  To: 9fans

> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-22 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-21 22:06 [9fans] troff ignoring .eo/.ec after first time Pietro Gagliardi
2007-11-21 22:39 ` Martin Neubauer
2007-11-22 16:55 ` Russ Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).