discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Lennart Jablonka <humm@ljabl.com>
To: discuss@mandoc.bsd.lv
Subject: Re: bug: quoted punctuation behaves strangely
Date: Sat, 16 Mar 2024 13:54:56 +0000	[thread overview]
Message-ID: <ZfWksCZkYk16TEIr@fluorine> (raw)
In-Reply-To: <ZfBWvRBAsZKQ7REL@www.stare.cz>

Quoth Jan Stary:
>On Mar 12 11:56:39, humm@ljabl.com wrote:
>> Consider:
>>
>> 	.Pq asdf .
>> 	.Pq asdf "."
>>
>> The expected output:
>>
>> 	(asdf).  (asdf).
>
>If I'm reading mdoc(7) right, this is what the
>Delimiters section has to say on that:
>
>        When a macro argument consists of one single input character
>        considered as a delimiter, the argument gets special handling.
>        This does not apply when delimiters appear in arguments
>        containing more than one character.
>
>Your "." (quotes included) contains more than one character,
>so it is not a delimiter.

In the troff language, a macro does not see the quotes surrounding 
an argument.  An argument can be quoted to contain spaces or 
quotes; that’s transparent to the macro.  So here, the argument 
does contain a single character and troff -mdoc treats it that 
way.  (Tested 4.4BSD-Lite2’s -mdoc, OpenBSD’s 
/usr/share/tmac/doc.tmac, and groff -mdoc.)

Further, even if that was not the case, the output would still be 
wrong:

	.Pq asdf \&.
	.Pq asdf "."

results in

	(asdf .) (asdf.)

>Also, why would you ever do this?

You wouldn’t.  And yet I did find it in the wild.
--
 To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv


      reply	other threads:[~2024-03-16 13:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 11:56 Lennart Jablonka
2024-03-12 13:21 ` Jan Stary
2024-03-16 13:54   ` Lennart Jablonka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZfWksCZkYk16TEIr@fluorine \
    --to=humm@ljabl.com \
    --cc=discuss@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).