CVS log for mandoc/term_tab.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.9 / (download) - annotate - [select for diffs], Wed Jul 16 14:33:08 2025 UTC (4 weeks, 5 days ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +6 -6 lines
Diff to previous 1.8 (colored)

In 2009, kristaps@ decided that using EN as the basic unit for
horizontal widths on terminal output devices was the simplest option.
It made sense because one EN is the smallest possible horizontal
cursor movement on a terminal.  In 2014, kristaps@ implemented the 'u'
unit (BU, "basic unit") for scaled width input as 1/24 EN, but all
internal variables continued to store widths in units of EN.

This causes compatibility problems with groff, which internally
represents widths in units of BU rather than EN.  Various high-level
macros internally calculate sums of user-controlled widths with a
sub-EN precision.  In mandoc, the coarse internal representation
causes rounding errors, in some cases resulting in wrong indentations.

Fix this by changing many internal variables in the terminal formatter
to store widths in units of BU instead of EN, improving compatibility.

An example of a manual page where mandoc output becomes more
compatible with groff output is clang(1) - a page generated by the
atrocious rst2man(1) tool, which insists, among other insanity, on
indenting by non-integer multiples of EN.

This patch includes the following related changes:
* The termp.advance and endline functions now update termp.viscol.
* Rename termp.width to termp.getwidth to help grep(1).
* Delete term_hen() which becomes the same as term_hspan().
* Delete the unused struct termp_tbl.
* Delete the unused tbl_sulen functions.

In the tbl_term formatter, pass an additional coloff argument to
all the data and fill functions, to deal with mismatches between
the desired and the actual cursor position: the desired position
is now maintained with BU precision, but the actual position is of
course still an integer multiple of EN.

Also simplify tbl_literal() by leaving TERMP_CENTER and TERMP_RIGHT
adjustment to term_flushln(), which already contains code for that
very purpose.

We are really lucky to have the regress/ test suite.  Without it,
tricky and pervasive low-level refactoring of this kind would be
impossible because it would unavoidably cause lots of regressions.

Revision 1.8 / (download) - annotate - [select for diffs], Fri Jul 4 19:13:51 2025 UTC (6 weeks, 3 days ago) by schwarze
Branch: MAIN
Changes since 1.7: +1 -16 lines
Diff to previous 1.7 (colored)

delete the unused function term_tab_iset(); even tbl(7) no longer needs it

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 4 18:56:31 2021 UTC (3 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.6: +17 -7 lines
Diff to previous 1.6 (colored)

Provide a cleanup function for the term_tab module, freeing memory
and resetting the internal state to the initial state.
Call this function from the proper place in term_free().

With the way the module is currently used, this does not imply any
functional change, but doing proper cleanup is more robust, makes
it easier during code review to understand what is going on, and
makes it explicit that there is no memory leak.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Jun 22 19:20:40 2020 UTC (5 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (colored)

Because mandoc_aux.h and mandoc.h use __attribute__, all files that
include mandoc_aux.h or mandoc.h need to include config.h, too.
It is suspected that for example IRIX needs this, or it is likely
to throw errors in these files because the system compiler doesn't
understand __attribute__.
Issue reported by Kazuo Kuroi <kazuo at irixnet dot org>.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Dec 16 00:21:05 2018 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.4: +1 -1 lines
Diff to previous 1.4 (colored)

s/OpenBSD/Id/ in CVS Ids

Revision 1.4 / (download) - annotate - [select for diffs], Sat Jun 17 14:55:30 2017 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4, VERSION_1_14_3, VERSION_1_14_2
Changes since 1.3: +15 -0 lines
Diff to previous 1.3 (colored)

tables leak tab settings to subsequent text

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 14 17:51:15 2017 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.2: +4 -8 lines
Diff to previous 1.2 (colored)

improve rounding rules for scaling units
in horizontal orientation in the terminal formatter

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jun 8 12:54:58 2017 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored)

make the internal a2roffsu() interface more powerful by returning
a pointer to the end of the parsed data, making it easier to
parse subsequent bytes

Revision 1.1 / (download) - annotate - [select for diffs], Sun May 7 17:31:45 2017 UTC (8 years, 3 months ago) by schwarze
Branch: MAIN

Basic implementation of the roff(7) .ta (define tab stops) request.
This is the first feature made possible by the parser reorganization.
Improves the formatting of the SYNOPSIS in many Xenocara GL manuals.
Also important for ports, as reported by many, including naddy@.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb