tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* [PATCH] \*(Px and \*(Ai
@ 2011-04-20 11:46 Kristaps Dzonsons
  2011-04-20 12:03 ` Joerg Sonnenberger
       [not found] ` <20110420125208.GF13691@harkle.bramka>
  0 siblings, 2 replies; 6+ messages in thread
From: Kristaps Dzonsons @ 2011-04-20 11:46 UTC (permalink / raw)
  To: tech, jmc

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

Hi,

As discussed on tech@openbsd.org,

http://comments.gmane.org/gmane.os.openbsd.tech/24663

we're missing two symbols defined in tmac.doc.  The enclosed patch 
includes them (not the documentation bits for mandoc_char.7, which I'd 
include if this is ok'd).

For the record, I don't particularly like these as they discourage using 
`St' in favour of hand-rolling standards.  I think this should be taken 
into account when deciding on whether to ok this.

So... thoughts?

Kristaps

[-- Attachment #2: patch.chars.txt --]
[-- Type: text/plain, Size: 962 bytes --]

Index: chars.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.c,v
retrieving revision 1.34
diff -u -r1.34 chars.c
--- chars.c	22 Mar 2011 10:13:01 -0000	1.34
+++ chars.c	20 Apr 2011 11:41:48 -0000
@@ -41,7 +41,7 @@
 #define CHARS_BOTH	 (CHARS_CHAR | CHARS_STRING)
 };
 
-#define	LINES_MAX	  351
+#define	LINES_MAX	  353
 
 #define CHAR(in, ch, code) \
 	{ NULL, (in), (ch), (code), CHARS_CHAR },
Index: chars.in
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.in,v
retrieving revision 1.36
diff -u -r1.36 chars.in
--- chars.in	16 Mar 2011 22:49:55 -0000	1.36
+++ chars.in	20 Apr 2011 11:41:48 -0000
@@ -375,6 +375,8 @@
 STRING("right-singlequote",	"\'",		8217)
 STRING("rp",			")",		41)
 STRING("Tm",			"(Tm)",		8482)
+STRING("Px",			"POSIX",	0)
+STRING("Ai",			"ANSI",		0)
 
 /* Lines. */
 CHAR("ba",			"|",		124)

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

* Re: [PATCH] \*(Px and \*(Ai
  2011-04-20 11:46 [PATCH] \*(Px and \*(Ai Kristaps Dzonsons
@ 2011-04-20 12:03 ` Joerg Sonnenberger
  2011-04-20 12:24   ` Kristaps Dzonsons
       [not found] ` <20110420125208.GF13691@harkle.bramka>
  1 sibling, 1 reply; 6+ messages in thread
From: Joerg Sonnenberger @ 2011-04-20 12:03 UTC (permalink / raw)
  To: tech

On Wed, Apr 20, 2011 at 01:46:19PM +0200, Kristaps Dzonsons wrote:
> For the record, I don't particularly like these as they discourage
> using `St' in favour of hand-rolling standards.  I think this should
> be taken into account when deciding on whether to ok this.

Warning for this with -Tlint?

Joerg
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

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

* Re: [PATCH] \*(Px and \*(Ai
  2011-04-20 12:03 ` Joerg Sonnenberger
@ 2011-04-20 12:24   ` Kristaps Dzonsons
  0 siblings, 0 replies; 6+ messages in thread
From: Kristaps Dzonsons @ 2011-04-20 12:24 UTC (permalink / raw)
  To: tech

On 04/20/2011 02:03 PM, Joerg Sonnenberger wrote:
> On Wed, Apr 20, 2011 at 01:46:19PM +0200, Kristaps Dzonsons wrote:
>> For the record, I don't particularly like these as they discourage
>> using `St' in favour of hand-rolling standards.  I think this should
>> be taken into account when deciding on whether to ok this.
>
> Warning for this with -Tlint?

Tlint doesn't do any post-parse analysis, which is when the glyph lookup 
occurs, so this isn't architecturally easy to pull off and will end up 
bloating code just for a corner case.

I think a saner option is to either document the escapes as being 
"dangerous" (really, all mandoc_char(7) predefined escapes are 
"dangerous") or just not documenting them at all (as they don't appear 
in any documentation I could find).
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

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

* Re: [PATCH] \*(Px and \*(Ai
       [not found] ` <20110420125208.GF13691@harkle.bramka>
@ 2011-04-20 20:10   ` Kristaps Dzonsons
  2011-04-20 21:36     ` Ingo Schwarze
  0 siblings, 1 reply; 6+ messages in thread
From: Kristaps Dzonsons @ 2011-04-20 20:10 UTC (permalink / raw)
  To: Jason McIntyre; +Cc: tech

[-- Attachment #1: Type: text/plain, Size: 889 bytes --]

On 20/04/2011 14:52, Jason McIntyre wrote:
> On Wed, Apr 20, 2011 at 01:46:19PM +0200, Kristaps Dzonsons wrote:
>> Hi,
>>
>> As discussed on tech@openbsd.org,
>>
>> http://comments.gmane.org/gmane.os.openbsd.tech/24663
>>
>> we're missing two symbols defined in tmac.doc.  The enclosed patch
>> includes them (not the documentation bits for mandoc_char.7, which I'd
>> include if this is ok'd).
>>
>> For the record, I don't particularly like these as they discourage using
>> `St' in favour of hand-rolling standards.  I think this should be taken
>> into account when deciding on whether to ok this.
>>
>> So... thoughts?
>>
>> Kristaps
>
> i personally don;t care. i can remove the one instance of Px if that's
> what we prefer. i certainly don;t want Px and Ai all over the manuals.

Enclosed is a patch with the documentation.  I think this is good enough 
to discourage usage.  Oks?

[-- Attachment #2: patch.chars.txt --]
[-- Type: text/plain, Size: 2138 bytes --]

Index: chars.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.c,v
retrieving revision 1.34
diff -u -r1.34 chars.c
--- chars.c	22 Mar 2011 10:13:01 -0000	1.34
+++ chars.c	20 Apr 2011 20:09:29 -0000
@@ -41,7 +41,7 @@
 #define CHARS_BOTH	 (CHARS_CHAR | CHARS_STRING)
 };
 
-#define	LINES_MAX	  351
+#define	LINES_MAX	  353
 
 #define CHAR(in, ch, code) \
 	{ NULL, (in), (ch), (code), CHARS_CHAR },
Index: chars.in
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.in,v
retrieving revision 1.36
diff -u -r1.36 chars.in
--- chars.in	16 Mar 2011 22:49:55 -0000	1.36
+++ chars.in	20 Apr 2011 20:09:29 -0000
@@ -375,6 +375,8 @@
 STRING("right-singlequote",	"\'",		8217)
 STRING("rp",			")",		41)
 STRING("Tm",			"(Tm)",		8482)
+STRING("Px",			"POSIX",	0)
+STRING("Ai",			"ANSI",		0)
 
 /* Lines. */
 CHAR("ba",			"|",		124)
Index: mandoc_char.7
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc_char.7,v
retrieving revision 1.42
diff -u -r1.42 mandoc_char.7
--- mandoc_char.7	9 Feb 2011 22:53:20 -0000	1.42
+++ mandoc_char.7	20 Apr 2011 20:09:30 -0000
@@ -481,8 +481,12 @@
 .It \e(ts    Ta \(ts        Ta sigma terminal
 .El
 .Sh PREDEFINED STRINGS
-These are not recommended for use, as they differ across
-implementations:
+Predefined strings are inherited from the macro packages of historical
+troff implementations.
+They are
+.Em not recommended
+for use, as they differ across implementations.
+Manuals using these predefined macros are almost certainly not portable.
 .Pp
 .Bl -column -compact -offset indent "Input" "Rendered" "Description"
 .It Em Input Ta Em Rendered Ta Em Description
@@ -512,6 +516,8 @@
 .It \e*(>=   Ta \*(>=       Ta greater-than-equal
 .It \e*(aa   Ta \*(aa       Ta acute
 .It \e*(ga   Ta \*(ga       Ta grave
+.It \e*(Px   Ta \*(Px       Ta POSIX standard name
+.It \e*(Ai   Ta \*(Ai       Ta ANSI standard name
 .El
 .Sh NUMBERED CHARACTERS
 For backward compatibility with existing manuals,

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

* Re: [PATCH] \*(Px and \*(Ai
  2011-04-20 20:10   ` Kristaps Dzonsons
@ 2011-04-20 21:36     ` Ingo Schwarze
  2011-04-20 22:22       ` Kristaps Dzonsons
  0 siblings, 1 reply; 6+ messages in thread
From: Ingo Schwarze @ 2011-04-20 21:36 UTC (permalink / raw)
  To: tech; +Cc: Jason McIntyre

Hi Kristaps,

Kristaps Dzonsons wrote on Wed, Apr 20, 2011 at 10:10:35PM +0200:

> Enclosed is a patch with the documentation.  I think this is good
> enough to discourage usage.  Oks?

Yes, i agree we should have them for backward compatibility,
warning would be rather messy right now, and the documentation
should strongly discourage them.

Thus, OK, except for one nit inline.

Yours,
  Ingo

> Index: chars.c
> ===================================================================
> RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.c,v
> retrieving revision 1.34
> diff -u -r1.34 chars.c
> --- chars.c	22 Mar 2011 10:13:01 -0000	1.34
> +++ chars.c	20 Apr 2011 20:09:29 -0000
> @@ -41,7 +41,7 @@
>  #define CHARS_BOTH	 (CHARS_CHAR | CHARS_STRING)
>  };
>  
> -#define	LINES_MAX	  351
> +#define	LINES_MAX	  353
>  
>  #define CHAR(in, ch, code) \
>  	{ NULL, (in), (ch), (code), CHARS_CHAR },
> Index: chars.in
> ===================================================================
> RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.in,v
> retrieving revision 1.36
> diff -u -r1.36 chars.in
> --- chars.in	16 Mar 2011 22:49:55 -0000	1.36
> +++ chars.in	20 Apr 2011 20:09:29 -0000
> @@ -375,6 +375,8 @@
>  STRING("right-singlequote",	"\'",		8217)
>  STRING("rp",			")",		41)
>  STRING("Tm",			"(Tm)",		8482)
> +STRING("Px",			"POSIX",	0)
> +STRING("Ai",			"ANSI",		0)
>  
>  /* Lines. */
>  CHAR("ba",			"|",		124)
> Index: mandoc_char.7
> ===================================================================
> RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc_char.7,v
> retrieving revision 1.42
> diff -u -r1.42 mandoc_char.7
> --- mandoc_char.7	9 Feb 2011 22:53:20 -0000	1.42
> +++ mandoc_char.7	20 Apr 2011 20:09:30 -0000
> @@ -481,8 +481,12 @@
>  .It \e(ts    Ta \(ts        Ta sigma terminal
>  .El
>  .Sh PREDEFINED STRINGS
> -These are not recommended for use, as they differ across
> -implementations:
> +Predefined strings are inherited from the macro packages of historical
> +troff implementations.
> +They are
> +.Em not recommended
> +for use, as they differ across implementations.
> +Manuals using these predefined macros are almost certainly not portable.

That should read "... using these predefined *strings*...".
Those are not macros.

>  .Pp
>  .Bl -column -compact -offset indent "Input" "Rendered" "Description"
>  .It Em Input Ta Em Rendered Ta Em Description
> @@ -512,6 +516,8 @@
>  .It \e*(>=   Ta \*(>=       Ta greater-than-equal
>  .It \e*(aa   Ta \*(aa       Ta acute
>  .It \e*(ga   Ta \*(ga       Ta grave
> +.It \e*(Px   Ta \*(Px       Ta POSIX standard name
> +.It \e*(Ai   Ta \*(Ai       Ta ANSI standard name
>  .El
>  .Sh NUMBERED CHARACTERS
>  For backward compatibility with existing manuals,

--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

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

* Re: [PATCH] \*(Px and \*(Ai
  2011-04-20 21:36     ` Ingo Schwarze
@ 2011-04-20 22:22       ` Kristaps Dzonsons
  0 siblings, 0 replies; 6+ messages in thread
From: Kristaps Dzonsons @ 2011-04-20 22:22 UTC (permalink / raw)
  To: tech; +Cc: Ingo Schwarze, Jason McIntyre

>> Enclosed is a patch with the documentation.  I think this is good
>> enough to discourage usage.  Oks?
>
> Yes, i agree we should have them for backward compatibility,
> warning would be rather messy right now, and the documentation
> should strongly discourage them.
>
> Thus, OK, except for one nit inline.
>
> Yours,
>    Ingo
>
>> Index: chars.c
>> ===================================================================
>> RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.c,v
>> retrieving revision 1.34
>> diff -u -r1.34 chars.c
>> --- chars.c	22 Mar 2011 10:13:01 -0000	1.34
>> +++ chars.c	20 Apr 2011 20:09:29 -0000
>> @@ -41,7 +41,7 @@
>>   #define CHARS_BOTH	 (CHARS_CHAR | CHARS_STRING)
>>   };
>>
>> -#define	LINES_MAX	  351
>> +#define	LINES_MAX	  353
>>
>>   #define CHAR(in, ch, code) \
>>   	{ NULL, (in), (ch), (code), CHARS_CHAR },
>> Index: chars.in
>> ===================================================================
>> RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/chars.in,v
>> retrieving revision 1.36
>> diff -u -r1.36 chars.in
>> --- chars.in	16 Mar 2011 22:49:55 -0000	1.36
>> +++ chars.in	20 Apr 2011 20:09:29 -0000
>> @@ -375,6 +375,8 @@
>>   STRING("right-singlequote",	"\'",		8217)
>>   STRING("rp",			")",		41)
>>   STRING("Tm",			"(Tm)",		8482)
>> +STRING("Px",			"POSIX",	0)
>> +STRING("Ai",			"ANSI",		0)
>>
>>   /* Lines. */
>>   CHAR("ba",			"|",		124)
>> Index: mandoc_char.7
>> ===================================================================
>> RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc_char.7,v
>> retrieving revision 1.42
>> diff -u -r1.42 mandoc_char.7
>> --- mandoc_char.7	9 Feb 2011 22:53:20 -0000	1.42
>> +++ mandoc_char.7	20 Apr 2011 20:09:30 -0000
>> @@ -481,8 +481,12 @@
>>   .It \e(ts    Ta \(ts        Ta sigma terminal
>>   .El
>>   .Sh PREDEFINED STRINGS
>> -These are not recommended for use, as they differ across
>> -implementations:
>> +Predefined strings are inherited from the macro packages of historical
>> +troff implementations.
>> +They are
>> +.Em not recommended
>> +for use, as they differ across implementations.
>> +Manuals using these predefined macros are almost certainly not portable.
>
> That should read "... using these predefined *strings*...".
> Those are not macros.

Ooops!  Ingo, thanks for the lookover---I'll commit a fixed version of 
this in a few.

Kristaps
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

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

end of thread, other threads:[~2011-04-20 22:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-20 11:46 [PATCH] \*(Px and \*(Ai Kristaps Dzonsons
2011-04-20 12:03 ` Joerg Sonnenberger
2011-04-20 12:24   ` Kristaps Dzonsons
     [not found] ` <20110420125208.GF13691@harkle.bramka>
2011-04-20 20:10   ` Kristaps Dzonsons
2011-04-20 21:36     ` Ingo Schwarze
2011-04-20 22:22       ` Kristaps Dzonsons

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