tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Kristaps Dzonsons <kristaps@bsd.lv>
To: "tech@mdocml.bsd.lv" <tech@mdocml.bsd.lv>
Subject: Re: PATCH: fix vertical spacing in nested lists
Date: Mon, 24 May 2010 23:33:37 +0200	[thread overview]
Message-ID: <4BFAF0B1.8070809@bsd.lv> (raw)
In-Reply-To: <20100524204516.GB21391@iris.usta.de>

> The following will only apply *after* you have applied
> 05.tabbing.patch.  It touches more or less the same lines
> of the same files.
> 
> There is no clear corresponding commit in OpenBSD, it needed
> several iterations to get this right.  In particular,
> 
> term.c 1.23:
> 
>> When the last field on an output line is empty, break the line
>> if and only if something was printed on that line.
>> This avoids double line breaks after nested lists
>> while still breaking lines after items with empty body.
> 
> term.c 1.28, mdoc_term.c 1.74:
> 
>> Partial revert of term.c rev. 1.23
>> because jmc@ noticed that it broke blank lines in literal displays.
>>
>> The original idea was to suppress stray blank lines.
>> But we don't want to suppress *all* blank lines,
>> instead just those caused by nested lists.
>> So do the check whether there was any output on this line,
>> i.e. whether or not to break the line,
>> at the right place, which is after processing the .It body.
> 
> term.c 1.29, term.h 1.15:
> 
>> Fix rendering of multiple successive .It macros without intervening text;
>> another problem reported by jmc@.
>>
>> The physical output line may contain output from more than one buffer.
>> Thus, to decide whether a line break is needed, it's insufficient to
>> only look at the number of bytes in the current output buffer.
>> Keep track of the number of characters already written, too.
> 
> 
> Joerg, you may remeber we discussed this while walking along the
> southern and western edge of the village of Nienhagen just before
> reaching the Baltic sea.  From a layering point of view, it may
> be better to do this half a layer upwards, that is not in term_flushln(),
> but in bufferc(), which would require a trivial rewrite of buffera()
> in terms of bufferc().  I doubt it can conveniently be done a full
> layer upwards, that is on the layer of mdoc(7) macros, because
> it is not at all obvious on that layer whether a macro will or will
> not generate non-whitespace output with the given output device
> settings at the end of the day.
> 
> So, it would be useful to try and write an implementation setting the
> flag in bufferc() instead of term_flushln().  If this gets done quickly
> and turns out to be better than this one, i will happily throw this one
> away and also replace it in the OpenBSD tree.  If this kind of
> replacement needs more thought or time, no problem either, then we
> can come back to it later when we are not in a hurry.  In that case,
> i propose to use this one for now:  It works and is only mildly ugly,
> and it will get us in sync.
> 
> For now, personally, i'm focussing on getting my other patches ready
> for commit, so we can reach synced state asap.
> 
> This diff is also available from
>   /usr/vhosts/mdocml.bsd.lv/patch/schwarze/08.viscol.patch
> 
> A test page is attached, covering only the nesting case.
> Testing the empty .It case in .Bl -tag is easy anyway.

I haven't tested these and will wait until it's committed to do fallout 
tests, but the logic looks fine by me, so go ahead and commit.  The more 
in-code documentation (and regression tests) in these places the better, 
as I for one get a bit lost in flushln().
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

      reply	other threads:[~2010-05-24 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-24 20:45 Ingo Schwarze
2010-05-24 21:33 ` 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=4BFAF0B1.8070809@bsd.lv \
    --to=kristaps@bsd.lv \
    --cc=tech@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).