From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-1.sys.kth.se (smtp-1.sys.kth.se [130.237.32.175]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o4OLVwhh032450 for ; Mon, 24 May 2010 15:31:58 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by smtp-1.sys.kth.se (Postfix) with ESMTP id C543C155AEA for ; Mon, 24 May 2010 23:31:52 +0200 (CEST) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-1.sys.kth.se ([127.0.0.1]) by localhost (smtp-1.sys.kth.se [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7TRg9nWuqCKL for ; Mon, 24 May 2010 23:31:51 +0200 (CEST) X-KTH-Auth: kristaps [85.8.61.100] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from lappy.bsd.lv (h85-8-61-100.dynamic.se.alltele.net [85.8.61.100]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 5060D1558C5 for ; Mon, 24 May 2010 23:31:51 +0200 (CEST) Message-ID: <4BFAF0B1.8070809@bsd.lv> Date: Mon, 24 May 2010 23:33:37 +0200 From: Kristaps Dzonsons User-Agent: Thunderbird 2.0.0.16 (X11/20080812) X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: "tech@mdocml.bsd.lv" Subject: Re: PATCH: fix vertical spacing in nested lists References: <20100524204516.GB21391@iris.usta.de> In-Reply-To: <20100524204516.GB21391@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > 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