discuss@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: discuss@mdocml.bsd.lv
Subject: Re: more spacing badness
Date: Wed, 22 Sep 2010 10:11:21 +0200	[thread overview]
Message-ID: <4C99BA29.8030401@bsd.lv> (raw)
In-Reply-To: <20100922070918.GB22622@bramka.kerhand.co.uk>

> not only that, but somewhere along the way the SYNOPSIS for test(1) got
> fixed! now we have:
> 
> 	[ test ]
> instead of
> 	[    test ]

Yes, I forgot to mention that test(1) was used as test input.  This was 
an effect of those commits.

> not only that, but the -column alignments in sysctl(3) got fixed
> somewhere along the way too.
> 
> super!

Great!  I hadn't noticed that.

>> Of course, i was eager to see whether Jason's "vi\ \&" would now work.
>> Guess what - it didn't.  I first had to fix *two* bugs in my own code.
>>
>> First, my favourite function term_flushline() handled trailing white
>> space correctly, but not trailing escaped blank characters.  In the
>> initial parsing loop, escaped whitespace is counted as normal
>> characters, then in the final output loop, it gets converted to
>> normal blanks, and finally, normal blanks (which break out of the
>> initial parsing loop) are counted again, so trailing escaped blanks
>> ended up being counted twice against the column width.
>>
>> Having fixed that one, Jason's "vi\ \&" still wouldn't work.
>> The reason was a quirk implemented for mdoc's .Bl -hang lists.
>> In such lists, when the head is wider than the declared head
>> width, the body gets pushed ahead to make room for the head;
>> when the head is shorter, the body gets aligned at the declared
>> position.  The quirk being that when the head is exactly one
>> character shorter than the declared width, the body gets pulled
>> back one character - for whatever reason.  That quirk got triggered
>> and defeated Jason's nicely escaped blank.
>>
>> So, the second fix is to remove the -hang flag from the SYNOPSIS
>> .Nm block handling.  I don't remember why i put that flag there
>> in the first place, it is clearly not needed.  The width is
>> calculated such that the header will always fit, so pushing ahead
>> is never needed, and we certainly do not want to pull back.
>>
>> OK?
>>
> 
> with this my vi hack does work correctly. thanks.

Ingo, feel free to commit it, then, if it doesn't regress anything.

Thanks,

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

      reply	other threads:[~2010-09-22  8:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10 21:14 Jason McIntyre
2010-09-15 15:53 ` Kristaps Dzonsons
2010-09-21 23:05   ` Ingo Schwarze
2010-09-22  7:09     ` Jason McIntyre
2010-09-22  8:11       ` Kristaps Dzonsons [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=4C99BA29.8030401@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=discuss@mdocml.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).