Re: [PATCH v3 07/13] libc.7: ffix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[This is a re-send without the attachment, which kernel.org rejected.]

Hi Alex,

At 2023-01-06T01:39:09+0100, Alejandro Colomar wrote:
> On 1/6/23 01:17, G. Branden Robinson wrote:
> > $ groff -man -Tpdf <<EOF > quote.pdf
> > .TH foo 1 2023-01-05 "groff test suite"
> > .SH Name
> > foo \- "frobnicate" a \(lqbar\(rq
> > EOF
> > $ evince quote.pdf
> 
> For some reason, I momentarily though that those would produce the
> same code.  I think I was confused by some other thing: in some cases
> you can use '"', but in others you must use \(dq (macro arguments).
> Probably that triggered a wrong connection in my brain...

Right.  \(dq is strictly equivalent to " (as a glyph) everywhere, but in
arguments to macros and some requests, " serves as a quotation operator
in the language.

groff 1.23's Texinfo manual says:

--begin snip--
5.6.3 Calling Macros
--------------------

If a macro of the desired name does not exist when called, it is
created, assigned an empty definition, and a warning in category 'mac'
is emitted.  Calling an undefined macro _does_ end a macro definition
naming it as its end macro (*note Writing Macros::).

   To embed spaces _within_ a macro argument, enclose the argument in
neutral double quotes '"'.  Horizontal motion escape sequences are
sometimes a better choice for arguments to be formatted as text.

   Consider calls to a hypothetical section heading macro 'uh'.

     .uh The Mouse Problem
     .uh "The Mouse Problem"
     .uh The\~Mouse\~Problem
     .uh The\ Mouse\ Problem

The first line calls 'uh' with three arguments: 'The', 'Mouse', and
'Problem'.  The remainder call the 'uh' macro with one argument, 'The
Mouse Problem'.  The last solution, using escaped spaces, can be found
in documents prepared for AT&T 'troff'.  It can cause surprise when text
is adjusted, because '\SP' inserts a _fixed-width_, non-breaking space.
GNU 'troff''s '\~' escape sequence inserts an adjustable, non-breaking
space.(1)  (*note Calling Macros-Footnote-1::)

   The foregoing raises the question of how to embed neutral double
quotes or backslashes in macro arguments when _those_ characters are
desired as literals.  In GNU 'troff', the special character escape
sequence '\[rs]' produces a backslash and '\[dq]' a neutral double
quote.

   In GNU 'troff''s AT&T compatibility mode, these characters remain
available as '\(rs' and '\(dq', respectively.  AT&T 'troff' did not
consistently define these special characters, but its descendants can be
made to support them.  *Note Device and Font Description Files::.
--end snip--

> Which by the way reminds me that in language, we use the ellipses
> together with the last word. 

In English, yes.  I won't promise you that French doesn't surround it
with   (non-breaking spaces).  Natural languages may vary here.

> Where did this idea of separating it in synopses come from? Maybe
> logic thinking, such as placing the period outside of quotes...

My _guess_ as to the _reason_ is as I said earlier--to reinforce the
idea that the optional arguments are whitespace-separated.  As for where
it came from, the strongest historical claim I can readily make is that
it appears in the earliest Unix man pages for which we have hard copy.

So that would be the ar(I) page in the (First Edition) Unix Programmer's
Manual, dated 3 November 1971.  Let me know if you don't have ready
access to a copy and I can email it privately.

> So, I guess I'll pick that patch.  I'll tell you if I do.

When you've reported one as applied, should I drop it from my further
revisions of the patch group?

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux