Jason McIntyre <j...@kerhand.co.uk> writes:

> On Mon, Jul 15, 2013 at 11:34:53PM +0200, Jérémie Courrèges-Anglas wrote:
>> Jason McIntyre <j...@kerhand.co.uk> writes:
>> 
>> > On Mon, Jul 15, 2013 at 07:53:04PM +0200, Jan Stary wrote:
>> >> Some of the manpages, e.g. crontab(1),
>> >> markup the folklore phrase
>> >> 
>> >>   named file, or standard input
>> >>   if the pseudo-filename `-' is given
>> >> 
>> >> as
>> >> 
>> >>   named file, or standard input
>> >>   if the pseudo-filename
>> >>   .Sq Fl
>> >>   is given.
>> >> 
>> >> Is this correct semantic markup? IMHO not:
>> >> it just abuses the fact that the flags (Fl)
>> >> happen to start with a dash; but that's not
>> >> what is meant here; this is not a flag;
>> >> it is the literal dash that is recognized
>> >> in place of a filename.
>> 
>> Then it is an argument (Ar).
>> 
> not really. Ar represents an argument name - this is a literal
> argument.

That makes sense.

> it should therefore be Li, but because the markup on a single
> character is hard to spot, we use Sq. there is a Ql macro which "does
> the right thing", but the effect would be the same as using Sq. Sq is
> probably best, i think.
>
>> >> So I believe it should be simply
>> >> 
>> >>   .Sq -
>> >> 
>> >> Right?
>> 
>> See below.
>> 
>> >> The diff below replaces those occurences
>> >> that a grep revealed for me in /usr/share/man;
>> >> Another grep reveals that most other manpages 
>> >> actually use ".Sq -".
>> >> 
>> >> I left out oldrdist(1) and shutdown(8)
>> >> where it _is_ actually a flag
>> >> and the code processes it as such.
>> >> 
>> >>   Jan
>> >> 
>> >
>> > ok, i agree with this. Fl seems wrong. however there's some ambiguity,
>> > for me anyway - do oldrdist and shutdown actually process "-"
>> > differently, or do the manuals talk about them differently?
>> 
>> Fl may seem wrong because we're talking about an argument, but I don't
>> think a bare `-' (a hyphen) would be better.  We're talking about an
>> ascii minus sign here; mandoc_char(7) says a minus sign can be obtained
>> with \- .
>> 
>
> it's not a minus sign. it's a literal "-".

I was thinking encoding-wise: you're typing an ascii minus sign, at the
cli.  If you have a man/mdoc formatter that distinguishes hyphens and
minus signs, it could produce different output for those, and you would
not be able to copy-paste examples.  Maybe mandoc doesn't, but groff
can (some distros even disabled this behavior).

>> I wonder about cat(1) using
>> .Pq Sq \&-
>> is that really telling mandoc to treat it as a minus sign?
>> 
>> What about:
>> .Pq Sq Ar \-
>> 
>
> the \& is wrong, yes. but so is Ar
>
[...]

-- 
Jérémie Courrèges-Anglas
PGP Key fingerprint: 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494

Reply via email to