TODO revision 1.1 1 1.1 christos ************************************************************************
2 1.1 christos * Official mandoc TODO.
3 1.1 christos * $Id: TODO,v 1.1 2013/04/03 14:46:49 christos Exp $
4 1.1 christos ************************************************************************
5 1.1 christos
6 1.1 christos ************************************************************************
7 1.1 christos * parser bugs
8 1.1 christos ************************************************************************
9 1.1 christos
10 1.1 christos - ".\}" on its own line gets translated to bare ".\&"
11 1.1 christos which forces pset() into man(7)
12 1.1 christos and then triggers an unknown macro error
13 1.1 christos reported by naddy@ Sun, 3 Jul 2011 21:52:24 +0200
14 1.1 christos
15 1.1 christos ************************************************************************
16 1.1 christos * formatter bugs
17 1.1 christos ************************************************************************
18 1.1 christos
19 1.1 christos - tbl(7): Horizontal and vertical lines are formatted badly:
20 1.1 christos With the box option, there is too much white space at the end of cells.
21 1.1 christos Horizontal lines from "=" lines are a bit too long.
22 1.1 christos yuri dot pankov at gmail dot com Thu, 14 Apr 2011 05:45:26 +0400
23 1.1 christos
24 1.1 christos ************************************************************************
25 1.1 christos * missing features
26 1.1 christos ************************************************************************
27 1.1 christos
28 1.1 christos --- missing roff features ----------------------------------------------
29 1.1 christos
30 1.1 christos - The pod2man preamble wants \h'...' with quoted numerical arguments,
31 1.1 christos see for example AUTHORS in MooseX::Getopt.3p, p5-MooseX-Getopt.
32 1.1 christos reported by Andreas Voegele <mail at andreasvoegele dot com>
33 1.1 christos Tue, 22 Nov 2011 15:34:47 +0100 on ports@
34 1.1 christos
35 1.1 christos - .if n \{
36 1.1 christos .br\}
37 1.1 christos should cause an extra space to be raised.
38 1.1 christos
39 1.1 christos - .ad (adjust margins)
40 1.1 christos .ad l -- adjust left margin only (flush left)
41 1.1 christos .ad r -- adjust right margin only (flush right)
42 1.1 christos .ad c -- center text on line
43 1.1 christos .ad b -- adjust both margins (alias: .ad n)
44 1.1 christos .na -- temporarily disable adjustment without changing the mode
45 1.1 christos .ad -- re-enable adjustment without changing the mode
46 1.1 christos Adjustment mode is ignored while in no-fill mode (.nf).
47 1.1 christos
48 1.1 christos - .it (line traps) occur in mysql(1), yasm_arch(7)
49 1.1 christos generated by DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
50 1.1 christos reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500
51 1.1 christos
52 1.1 christos - .ns (no-space mode) occurs in xine-config(1)
53 1.1 christos reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
54 1.1 christos
55 1.1 christos - xloadimage(1) wants .ti (temporary indent), rep by naddy@
56 1.1 christos
57 1.1 christos - .ta (tab settings) occurs in ircbug(1) and probably gnats(1)
58 1.1 christos reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500
59 1.1 christos
60 1.1 christos - \c (interrupted text) occurs in chat(8)
61 1.1 christos
62 1.1 christos - using undefined strings or macros defines them to be empty
63 1.1 christos wl@ Mon, 14 Nov 2011 14:37:01 +0000
64 1.1 christos
65 1.1 christos --- missing mdoc features ----------------------------------------------
66 1.1 christos
67 1.1 christos - fix bad block nesting involving multiple identical explicit blocks
68 1.1 christos see the OpenBSD mdoc_macro.c 1.47 commit message
69 1.1 christos
70 1.1 christos - .Bl -column .Xo support is missing
71 1.1 christos ultimate goal:
72 1.1 christos restore .Xr and .Dv to
73 1.1 christos lib/libc/compat-43/sigvec.3
74 1.1 christos lib/libc/gen/signal.3
75 1.1 christos lib/libc/sys/sigaction.2
76 1.1 christos
77 1.1 christos - edge case: decide how to deal with blk_full bad nesting, e.g.
78 1.1 christos .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1)
79 1.1 christos from jmc@ Wed, 14 Jul 2010 18:10:32 +0100
80 1.1 christos
81 1.1 christos - \\ is now implemented correctly
82 1.1 christos * when defining strings and macros using .ds and .de
83 1.1 christos * when parsing roff(7) and man(7) macro arguments
84 1.1 christos It does not yet work in mdoc(7) macro arguments
85 1.1 christos because libmdoc does not yet use mandoc_getarg().
86 1.1 christos Also check what happens in plain text, it must be identical to \e.
87 1.1 christos
88 1.1 christos - .Bd -filled should not be the same as .Bd -ragged, but align both
89 1.1 christos the left and right margin. In groff, it is implemented in terms
90 1.1 christos of .ad b, which we don't have either. Found in cksum(1).
91 1.1 christos
92 1.1 christos - implement blank `Bl -column', such as
93 1.1 christos .Bl -column
94 1.1 christos .It foo Ta bar
95 1.1 christos .El
96 1.1 christos
97 1.1 christos - explicitly disallow nested `Bl -column', which would clobber internal
98 1.1 christos flags defined for struct mdoc_macro
99 1.1 christos
100 1.1 christos - In .Bl -column .It, the end of the line probably has to be regarded
101 1.1 christos as an implicit .Ta, if there could be one, see the following mildly
102 1.1 christos ugly code from login.conf(5):
103 1.1 christos .Bl -column minpasswordlen program xetcxmotd
104 1.1 christos .It path Ta path Ta value of Dv _PATH_DEFPATH
105 1.1 christos .br
106 1.1 christos Default search path.
107 1.1 christos reported by Michal Mazurek <akfaew at jasminek dot net>
108 1.1 christos via jmc@ Thu, 7 Apr 2011 16:00:53 +0059
109 1.1 christos
110 1.1 christos - inside `.Bl -column' phrases, punctuation is handled like normal
111 1.1 christos text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -."
112 1.1 christos
113 1.1 christos - inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf'
114 1.1 christos is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab."
115 1.1 christos but should give "ab ."
116 1.1 christos
117 1.1 christos - set a meaningful default if no `Bl' list type is assigned
118 1.1 christos
119 1.1 christos - have a blank `It' head for `Bl -tag' not puke
120 1.1 christos
121 1.1 christos - prohibit `Nm' from having non-text HEAD children
122 1.1 christos (e.g., NetBSD mDNSShared/dns-sd.1)
123 1.1 christos (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified)
124 1.1 christos
125 1.1 christos - When there is free text in the SYNOPSIS and that free text contains
126 1.1 christos the .Nm macro, groff somehow understands to treat the .Nm as an in-line
127 1.1 christos macro, while mandoc treats it as a block macro and breaks the line.
128 1.1 christos No idea how the logic for distinguishing in-line and block instances
129 1.1 christos should be, needs investigation.
130 1.1 christos uqs@ Thu, 2 Jun 2011 11:03:51 +0200
131 1.1 christos uqs@ Thu, 2 Jun 2011 11:33:35 +0200
132 1.1 christos
133 1.1 christos --- missing man features -----------------------------------------------
134 1.1 christos
135 1.1 christos - groff an-ext.tmac macros (.UR, .UE) occur in xine(5)
136 1.1 christos reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
137 1.1 christos
138 1.1 christos - -T[x]html doesn't stipulate non-collapsing spaces in literal mode
139 1.1 christos
140 1.1 christos --- missing tbl features -----------------------------------------------
141 1.1 christos
142 1.1 christos - implement basic non-parametric .de to support e.g. sox(1)
143 1.1 christos reported by naddy@ Sat, 16 Oct 2010 23:51:57 +0200
144 1.1 christos *** sox(1) still doesn't work, tbl(1) errors need investigation
145 1.1 christos
146 1.1 christos - allow standalone `.' to be interpreted as an end-of-layout
147 1.1 christos delimiter instead of being thrown away as a no-op roff line
148 1.1 christos reported by Yuri Pankov, Wed 18 May 2011 11:34:59 CEST
149 1.1 christos
150 1.1 christos --- missing misc features ----------------------------------------------
151 1.1 christos
152 1.1 christos - clean up escape sequence handling, creating three classes:
153 1.1 christos (1) fully implemented, or parsed and ignored without loss of content
154 1.1 christos (2) unimplemented, potentially causing loss of content
155 1.1 christos or serious mangling of formatting (e.g. \n) -> ERROR
156 1.1 christos see textproc/mgdiff(1) for nice examples
157 1.1 christos (3) undefined, just output the character -> perhaps WARNING
158 1.1 christos
159 1.1 christos - The \t escape sequence is the same as a literal tab, see for example
160 1.1 christos the ASCII table in hexdump(1) where
161 1.1 christos .Bl -column \&000_nu \&001_so \&002_st \&003_et \&004_eo
162 1.1 christos .It \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq
163 1.1 christos produces
164 1.1 christos 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq
165 1.1 christos and the example in oldrdist(1)
166 1.1 christos
167 1.1 christos - look at pages generated from reStructeredText, e.g. devel/mercurial hg(1)
168 1.1 christos These are a weird mixture of man(7) and custom autogenerated low-level
169 1.1 christos roff stuff. Figure out to what extent we can cope.
170 1.1 christos For details, see http://docutils.sourceforge.net/rst.html
171 1.1 christos noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200
172 1.1 christos reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100
173 1.1 christos
174 1.1 christos - check compatibility with Plan9:
175 1.1 christos http://swtch.com/usr/local/plan9/tmac/tmac.an
176 1.1 christos http://swtch.com/plan9port/man/man7/man.html
177 1.1 christos "Anthony J. Bentley" <anthonyjbentley (a] gmail.com> 28 Dec 2010 21:58:40 -0700
178 1.1 christos
179 1.1 christos ************************************************************************
180 1.1 christos * formatting issues: ugly output
181 1.1 christos ************************************************************************
182 1.1 christos
183 1.1 christos - a column list with blank `Ta' cells triggers a spurrious
184 1.1 christos start-with-whitespace printing of a newline
185 1.1 christos
186 1.1 christos - double quotes inside double quotes are escaped by doubling them
187 1.1 christos implement this in mdoc(7), too
188 1.1 christos so far, we only have it in roff(7) and man(7)
189 1.1 christos reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500
190 1.1 christos
191 1.1 christos - perl(1) SYNOPSIS looks bad; reported by deraadt@
192 1.1 christos 1) man(7) seems to need SYNOPSIS .Nm blocks, too
193 1.1 christos
194 1.1 christos - In .Bl -column,
195 1.1 christos .It Em Authentication<tab>Key Length
196 1.1 christos ought to render "Key Length" with emphasis, too,
197 1.1 christos see OpenBSD iked.conf(5).
198 1.1 christos reported again Nicolas Joly via wiz@ Wed, 12 Oct 2011 00:20:00 +0200
199 1.1 christos
200 1.1 christos - empty phrases in .Bl column produce too few blanks
201 1.1 christos try e.g. .Bl -column It Ta Ta
202 1.1 christos reported by millert Fri, 02 Apr 2010 16:13:46 -0400
203 1.1 christos
204 1.1 christos - .%T can have trailing punctuation. Currently, it puts the trailing
205 1.1 christos punctuation into a trailing MDOC_TEXT element inside its own scope.
206 1.1 christos That element should rather be outside its scope, such that the
207 1.1 christos punctuation does not get underlines. This is not trivial to
208 1.1 christos implement because .%T then needs some features of in_line_eoln() -
209 1.1 christos slurp all arguments into one single text element - and one feature
210 1.1 christos of in_line() - put trailing punctuation out of scope.
211 1.1 christos Found in mount_nfs(8) and exports(5), search for "Appendix".
212 1.1 christos
213 1.1 christos - in enclosures, mandoc sometimes fancies a bogus end of sentence
214 1.1 christos reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059
215 1.1 christos
216 1.1 christos ************************************************************************
217 1.1 christos * formatting issues: gratuitous differences
218 1.1 christos ************************************************************************
219 1.1 christos
220 1.1 christos - .Rv (and probably .Ex) print different text if an `Nm' has been named
221 1.1 christos or not (run a manual without `Nm blah' to see this). I'm not sure
222 1.1 christos that this exists in the wild, but it's still an error.
223 1.1 christos
224 1.1 christos - In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet
225 1.1 christos is just "o\bo".
226 1.1 christos see for example OpenBSD ksh(1)
227 1.1 christos
228 1.1 christos - The characters "|" and "\*(Ba" should never be bold,
229 1.1 christos not even in the middle of a word, e.g. ".Cm b\*(Bac" in
230 1.1 christos "mknod [-m mode] name b|c major minor"
231 1.1 christos in OpenBSD ksh(1)
232 1.1 christos
233 1.1 christos - A bogus .Pp between two .It must not produce a double blank line,
234 1.1 christos see between -R and -r in OpenBSD rm(1), before "update" in mount(8),
235 1.1 christos or in DIAGNOSTICS in init(8), or before "is always true" in ksh(1).
236 1.1 christos The same happens with .Pp just before .El, see bgpd.conf(5).
237 1.1 christos Also have `It' complain if `Pp' is invoked at certain times (not
238 1.1 christos -compact?).
239 1.1 christos
240 1.1 christos - .Pp between two .It in .Bl -column should produce one,
241 1.1 christos not two blank lines, see e.g. login.conf(5).
242 1.1 christos reported by jmc@ Sun, 17 Apr 2011 14:04:58 +0059
243 1.1 christos reported again by sthen@ Wed, 18 Jan 2012 02:09:39 +0000 (UTC)
244 1.1 christos
245 1.1 christos - If the *first* line after .It is .Pp, break the line right after
246 1.1 christos the tag, do not pad with space characters before breaking.
247 1.1 christos See the description of the a, c, and i commands in sed(1).
248 1.1 christos
249 1.1 christos - If the first line after .It is .D1, do not assert a blank line
250 1.1 christos in between, see for example tmux(1).
251 1.1 christos reported by nicm@ 13 Jan 2011 00:18:57 +0000
252 1.1 christos
253 1.1 christos - .Nx 1.0a
254 1.1 christos should be "NetBSD 1.0A", not "NetBSD 1.0a",
255 1.1 christos see OpenBSD ccdconfig(8).
256 1.1 christos
257 1.1 christos - In .Bl -tag, if a tag exceeds the right margin and must be continued
258 1.1 christos on the next line, it must be indented by -width, not width+1;
259 1.1 christos see "rule block|pass" in OpenBSD ifconfig(8).
260 1.1 christos
261 1.1 christos - When the -width string contains macros, the macros must be rendered
262 1.1 christos before measuring the width, for example
263 1.1 christos .Bl -tag -width ".Dv message"
264 1.1 christos in magic(5), located in src/usr.bin/file, is the same
265 1.1 christos as -width 7n, not -width 11n.
266 1.1 christos The same applies to .Bl -column column widths;
267 1.1 christos reported again by Nicolas Joly Thu, 1 Mar 2012 13:41:26 +0100 via wiz@ 5 Mar
268 1.1 christos
269 1.1 christos - The \& zero-width character counts as output.
270 1.1 christos That is, when it is alone on a line between two .Pp,
271 1.1 christos we want three blank lines, not two as in mandoc.
272 1.1 christos
273 1.1 christos - When .Fn arguments exceed one output line, all but the first
274 1.1 christos should be indented, see e.g. rpc(3);
275 1.1 christos reported by jmc@ on discuss@ Fri, 29 Oct 2010 13:48:33 +0100
276 1.1 christos reported again by Nicolas Joly via wiz@ Sun, 18 Sep 2011 18:24:40 +0200
277 1.1 christos Also, we don't want to break the line within the argument of:
278 1.1 christos .Fa "chtype tl"
279 1.1 christos
280 1.1 christos - .Ns should work when called at the end of an input line, see
281 1.1 christos the following code in vi(1):
282 1.1 christos .It Xo
283 1.1 christos .Op Ar line
284 1.1 christos .Cm a Ns Op Cm ppend Ns
285 1.1 christos .Op Cm !\&
286 1.1 christos .Xc
287 1.1 christos The input text is appended after the specified line.
288 1.1 christos
289 1.1 christos - Header lines of excessive length:
290 1.1 christos Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c
291 1.1 christos and document it in mdoc(7) and man(7) COMPATIBILITY
292 1.1 christos found while talking to Chris Bennett
293 1.1 christos
294 1.1 christos - In man(7), the sequence
295 1.1 christos .HP
296 1.1 christos one line of regular text
297 1.1 christos .SH
298 1.1 christos should not produce two blank lines before the .SH,
299 1.1 christos see for example named-checkconf(8).
300 1.1 christos
301 1.1 christos - In man(7), the sequence
302 1.1 christos .SH HEADER
303 1.1 christos <blank line>
304 1.1 christos .PP
305 1.1 christos regular text
306 1.1 christos should not produce any blank lines between the header and the text,
307 1.1 christos see for example rsync(1).
308 1.1 christos Reported by naddy@ Mon, 28 Mar 2011 20:45:42 +0200
309 1.1 christos
310 1.1 christos - In man(7), the sequence
311 1.1 christos regular text
312 1.1 christos .IP
313 1.1 christos .IP "tag"
314 1.1 christos indented text
315 1.1 christos should produce one, not four blank lines between the regular text
316 1.1 christos and the tag, see for example rsync(1).
317 1.1 christos Likewise,
318 1.1 christos regular text
319 1.1 christos .IP
320 1.1 christos indented text
321 1.1 christos should produce one, not two blank lines in between, and
322 1.1 christos regular text
323 1.1 christos .IP
324 1.1 christos .RS
325 1.1 christos .IP tag
326 1.1 christos indented text
327 1.1 christos should produce one, not three blank lines.
328 1.1 christos Reported by naddy@ Mon, 28 Mar 2011 20:45:42 +0200
329 1.1 christos
330 1.1 christos - trailing whitespace must be ignored even when followed by a font escape,
331 1.1 christos see for example
332 1.1 christos makes
333 1.1 christos \fBdig \fR
334 1.1 christos operate in batch mode
335 1.1 christos in dig(1).
336 1.1 christos
337 1.1 christos ************************************************************************
338 1.1 christos * error reporting issues
339 1.1 christos ************************************************************************
340 1.1 christos
341 1.1 christos - .TP directly followed by .RS gives an assertion.
342 1.1 christos
343 1.1 christos ************************************************************************
344 1.1 christos * performance issues
345 1.1 christos ************************************************************************
346 1.1 christos
347 1.1 christos Several areas can be cleaned up to make mandoc even faster. These are
348 1.1 christos
349 1.1 christos - improve hashing mechanism for macros (quite important: performance)
350 1.1 christos
351 1.1 christos - improve hashing mechanism for characters (not as important)
352 1.1 christos
353 1.1 christos - the PDF file is HUGE: this can be reduced by using relative offsets
354 1.1 christos
355 1.1 christos - instead of re-initialising the roff predefined-strings set before each
356 1.1 christos parse, create a read-only version the first time and copy it
357 1.1 christos
358 1.1 christos ************************************************************************
359 1.1 christos * structural issues
360 1.1 christos ************************************************************************
361 1.1 christos
362 1.1 christos - We use the input line number at several places to distinguish
363 1.1 christos same-line from different-line input. That plainly doesn't work
364 1.1 christos with user-defined macros, leading to random breakage.
365 1.1 christos
366 1.1 christos - Find better ways to prevent endless loops
367 1.1 christos in roff(7) macro and string expansion.
368 1.1 christos
369 1.1 christos - Finish cleanup of date handling.
370 1.1 christos Decide which formats should be recognized where.
371 1.1 christos Update both mdoc(7) and man(7) documentation.
372 1.1 christos Triggered by Tim van der Molen Tue, 22 Feb 2011 20:30:45 +0100
373