9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] plan9 ms .if h test
@ 2011-03-30 14:21 Rudolf Sykora
  2011-03-30 16:55 ` pmarin
  0 siblings, 1 reply; 5+ messages in thread
From: Rudolf Sykora @ 2011-03-30 14:21 UTC (permalink / raw)


Hello 9fans,

in the troff ms-definition file (in plan 9, p9p)
/sys/lib/tmac/tmac.s
I can find this structures
.if h ...
or
.ie h ...

I really can't find what this test means (the 'h'), I only know the
o,e,t,n built-ins.
Please, can anybody tell?

[
In p9p, it's e.g. on
/opt/plan9/tmac/tmac.s:329 you have
.ie h .ll \\n(LLu
.el \{\
...
]

Thank you very much!
Ruda



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

* [9fans] plan9 ms .if h test
  2011-03-30 14:21 [9fans] plan9 ms .if h test Rudolf Sykora
@ 2011-03-30 16:55 ` pmarin
  2011-03-30 17:12   ` pmarin
  0 siblings, 1 reply; 5+ messages in thread
From: pmarin @ 2011-03-30 16:55 UTC (permalink / raw)


I searched where the register h is defined:

% 9 grep -n '.nr h ' tmac.*

tmac.cs:103: .nr h 6
tmac.cs:477: .  nr h \\ne \}
tmac.mcs:208: .nr h 6
tmac.mcs:840: .nr h \\ne

where h has the same meaning:
'''\"	h - cover sheet basic distribution length

Both tmac.cs and tmac.mcs load tmac.s in their inicialization so
probably h  only have sense when tmac.cs or tmac.mcs are used.

I think that if you are only using the ms macros then h is not
important because is not defined.

Cheers.
pmarin.




On Wed, Mar 30, 2011 at 4:21 PM, Rudolf Sykora <rudolf.sykora at gmail.com> wrote:
> Hello 9fans,
>
> in the troff ms-definition file (in plan 9, p9p)
> /sys/lib/tmac/tmac.s
> I can find this structures
> .if h ...
> or
> .ie h ...
>
> I really can't find what this test means (the 'h'), I only know the
> o,e,t,n built-ins.
> Please, can anybody tell?
>
> [
> In p9p, it's e.g. on
> /opt/plan9/tmac/tmac.s:329 you have
> .ie h .ll \\n(LLu
> .el \{\
> ...
> ]
>
> Thank you very much!
> Ruda
>
>



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

* [9fans] plan9 ms .if h test
  2011-03-30 16:55 ` pmarin
@ 2011-03-30 17:12   ` pmarin
  2011-03-30 17:31     ` pmarin
  0 siblings, 1 reply; 5+ messages in thread
From: pmarin @ 2011-03-30 17:12 UTC (permalink / raw)


Never mind: ".if c" is only using for built-ins.

On Wed, Mar 30, 2011 at 6:55 PM, pmarin <pmarin.mail at gmail.com> wrote:
> I searched where the register h is defined:
>
> % 9 grep -n '.nr h ' tmac.*
>
> tmac.cs:103: .nr h 6
> tmac.cs:477: . ?nr h \\ne \}
> tmac.mcs:208: .nr h 6
> tmac.mcs:840: .nr h \\ne
>
> where h has the same meaning:
> '''\" ? h - cover sheet basic distribution length
>
> Both tmac.cs and tmac.mcs load tmac.s in their inicialization so
> probably h ?only have sense when tmac.cs or tmac.mcs are used.
>
> I think that if you are only using the ms macros then h is not
> important because is not defined.
>
> Cheers.
> pmarin.
>
>
>
>
> On Wed, Mar 30, 2011 at 4:21 PM, Rudolf Sykora <rudolf.sykora at gmail.com> wrote:
>> Hello 9fans,
>>
>> in the troff ms-definition file (in plan 9, p9p)
>> /sys/lib/tmac/tmac.s
>> I can find this structures
>> .if h ...
>> or
>> .ie h ...
>>
>> I really can't find what this test means (the 'h'), I only know the
>> o,e,t,n built-ins.
>> Please, can anybody tell?
>>
>> [
>> In p9p, it's e.g. on
>> /opt/plan9/tmac/tmac.s:329 you have
>> .ie h .ll \\n(LLu
>> .el \{\
>> ...
>> ]
>>
>> Thank you very much!
>> Ruda
>>
>>
>



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

* [9fans] plan9 ms .if h test
  2011-03-30 17:12   ` pmarin
@ 2011-03-30 17:31     ` pmarin
  2011-03-30 18:03       ` Rudolf Sykora
  0 siblings, 1 reply; 5+ messages in thread
From: pmarin @ 2011-03-30 17:31 UTC (permalink / raw)


I found it.

from htmlroff(1):


"Conditional input

To make it easier to write input files that can be formatted by both
troff and htmlroff, htmlroff adds a new condition h which evaluates
true in .if and .ie requests. The t condition continues to evaluate
true, to accomodate input files trying to distinguish between troff
and nroff. To write a conditional matching troff alone, use ?.if !h
.if t?."

http://swtch.com/plan9port/man/man7/htmlroff.html

Cheers.
pmarin.


On Wed, Mar 30, 2011 at 7:12 PM, pmarin <pmarin.mail at gmail.com> wrote:
> Never mind: ".if c" is only using for built-ins.
>
> On Wed, Mar 30, 2011 at 6:55 PM, pmarin <pmarin.mail at gmail.com> wrote:
>> I searched where the register h is defined:
>>
>> % 9 grep -n '.nr h ' tmac.*
>>
>> tmac.cs:103: .nr h 6
>> tmac.cs:477: . ?nr h \\ne \}
>> tmac.mcs:208: .nr h 6
>> tmac.mcs:840: .nr h \\ne
>>
>> where h has the same meaning:
>> '''\" ? h - cover sheet basic distribution length
>>
>> Both tmac.cs and tmac.mcs load tmac.s in their inicialization so
>> probably h ?only have sense when tmac.cs or tmac.mcs are used.
>>
>> I think that if you are only using the ms macros then h is not
>> important because is not defined.
>>
>> Cheers.
>> pmarin.
>>
>>
>>
>>
>> On Wed, Mar 30, 2011 at 4:21 PM, Rudolf Sykora <rudolf.sykora at gmail.com> wrote:
>>> Hello 9fans,
>>>
>>> in the troff ms-definition file (in plan 9, p9p)
>>> /sys/lib/tmac/tmac.s
>>> I can find this structures
>>> .if h ...
>>> or
>>> .ie h ...
>>>
>>> I really can't find what this test means (the 'h'), I only know the
>>> o,e,t,n built-ins.
>>> Please, can anybody tell?
>>>
>>> [
>>> In p9p, it's e.g. on
>>> /opt/plan9/tmac/tmac.s:329 you have
>>> .ie h .ll \\n(LLu
>>> .el \{\
>>> ...
>>> ]
>>>
>>> Thank you very much!
>>> Ruda
>>>
>>>
>>
>



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

* [9fans] plan9 ms .if h test
  2011-03-30 17:31     ` pmarin
@ 2011-03-30 18:03       ` Rudolf Sykora
  0 siblings, 0 replies; 5+ messages in thread
From: Rudolf Sykora @ 2011-03-30 18:03 UTC (permalink / raw)


On 30 March 2011 19:31, pmarin <pmarin.mail at gmail.com> wrote:
> To make it easier to write input files that can be formatted by both
> troff and htmlroff, htmlroff adds a new condition h which evaluates
> true in .if and .ie requests. The t condition continues to evaluate
> true, to accomodate input files trying to distinguish between troff
> and nroff. To write a conditional matching troff alone, use ?.if !h
> .if t?."
>
> http://swtch.com/plan9port/man/man7/htmlroff.html
>
> Cheers.
> pmarin.

Ok. Actually, it seems that troff evaluates anything it doesn't know as false:

.ie v .tm trueee
.el .tm falsee

% 9 troff a >/dev/null
falsee
%

(and the same happens to 'h').
Thanks!
Ruda



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

end of thread, other threads:[~2011-03-30 18:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-30 14:21 [9fans] plan9 ms .if h test Rudolf Sykora
2011-03-30 16:55 ` pmarin
2011-03-30 17:12   ` pmarin
2011-03-30 17:31     ` pmarin
2011-03-30 18:03       ` Rudolf Sykora

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).