Annotation of mandoc/TODO, Revision 1.84
1.1 kristaps 1: ************************************************************************
1.37 kristaps 2: * Official mandoc TODO.
1.84 ! kristaps 3: * $Id: TODO,v 1.83 2011/01/24 01:34:56 schwarze Exp $
1.27 kristaps 4: ************************************************************************
5:
6: ************************************************************************
1.61 schwarze 7: * parser bugs
8: ************************************************************************
9:
1.81 schwarze 10: - .TP before .SH is still FATAL in man(7)
11: reported by brad@ Sat, 15 Jan 2011 15:54:54 -0500
12:
1.83 schwarze 13: - The mdoc(7) parser should handle `\.' as punctuation:
14: .Ql .if ${VAR} op something \.
15: should produce
16: `.if ${VAR} op something'.
17: not
18: `.if ${VAR} op something .'
19: as seen in make(1).
20: To escape the dot, one would use `\&.'.
21:
1.61 schwarze 22: - the roff parser doesn't tolerate additional characters between
23: a macro and the \} terminating a conditional block, e.g.
24: .if n \{
25: .br \}
26: reported by ulrich spoerlein Tue, 19 Oct 2010 20:39:50 +0200
27:
1.74 schwarze 28: ************************************************************************
29: * formatter bugs
30: ************************************************************************
1.63 schwarze 31:
1.61 schwarze 32: ************************************************************************
1.1 kristaps 33: * missing features
34: ************************************************************************
1.70 kristaps 35:
1.79 schwarze 36: --- missing roff features ----------------------------------------------
37:
1.82 schwarze 38: - .ad (adjust margins)
39: .ad l -- adjust left margin only (flush left)
40: .ad r -- adjust right margin only (flush right)
41: .ad c -- center text on line
42: .ad b -- adjust both margins (alias: .ad n)
43: .na -- temporarily disable adjustment without changing the mode
44: .ad -- re-enable adjustment without changing the mode
45: Adjustment mode is ignored while in no-fill mode (.nf).
46:
1.81 schwarze 47: - .it (line traps) occur in mysql(1), yasm_arch(7)
48: generated by DocBook XSL Stylesheets v1.71.1 <http://docbook.sf.net/>
49: reported by brad@ Sat, 15 Jan 2011 15:48:18 -0500
50:
1.80 schwarze 51: - .ns (no-space mode) occurs in xine-config(1)
52: reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
1.61 schwarze 53:
1.80 schwarze 54: - xloadimage(1) wants .ti (temporary indent), rep by naddy@
1.81 schwarze 55:
56: - .ta (tab settings) occurs in ircbug(1) and probably gnats(1)
57: reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500
1.75 schwarze 58:
1.80 schwarze 59: - pod2man expects `tr' to be implemented for \*(-- to work
1.79 schwarze 60:
1.83 schwarze 61: - \c (interrupted text) occurs in chat(8)
62:
1.79 schwarze 63: --- missing mdoc features ----------------------------------------------
64:
1.18 schwarze 65: - fix bad block nesting involving multiple identical explicit blocks
66: see the OpenBSD mdoc_macro.c 1.47 commit message
67:
1.1 kristaps 68: - .Bl -column .Xo support is missing
69: ultimate goal:
70: restore .Xr and .Dv to
71: lib/libc/compat-43/sigvec.3
72: lib/libc/gen/signal.3
73: lib/libc/sys/sigaction.2
74:
1.28 schwarze 75: - edge case: decide how to deal with blk_full bad nesting, e.g.
76: .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1)
77: from jmc@ Wed, 14 Jul 2010 18:10:32 +0100
78:
1.74 schwarze 79: - \\ is now implemented correctly
80: * when defining strings and macros using .ds and .de
81: * when parsing roff(7) and man(7) macro arguments
82: It does not yet work in mdoc(7) macro arguments
83: because libmdoc does not yet use mandoc_getarg().
84: Also check what happens in plain text, it must be identical to \e.
1.82 schwarze 85:
86: - .Bd -filled should not be the same as .Bd -ragged, but align both
87: the left and right margin. In groff, it is implemented in terms
88: of .ad b, which we don't have either. Found in cksum(1).
1.22 schwarze 89:
1.10 kristaps 90: - implement blank `Bl -column', such as
91: .Bl -column
92: .It foo Ta bar
93: .El
1.11 kristaps 94:
95: - explicitly disallow nested `Bl -column', which would clobber internal
96: flags defined for struct mdoc_macro
1.42 schwarze 97:
98: - inside `.Bl -column' phrases, punctuation is handled like normal
99: text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -."
100:
101: - inside `.Bl -column' phrases, TERMP_IGNDELIM handling by `Pf'
102: is not safe, e.g. `.Bl -column .It Pf a b .' gives "ab."
103: but should give "ab ."
1.12 kristaps 104:
105: - set a meaningful default if no `Bl' list type is assigned
1.13 kristaps 106:
107: - have a blank `It' head for `Bl -tag' not puke
1.20 kristaps 108:
109: - prohibit `Nm' from having non-text HEAD children
110: (e.g., NetBSD mDNSShared/dns-sd.1)
111: (mdoc_html.c and mdoc_term.c `Nm' handlers can be slightly simplified)
1.57 kristaps 112:
1.79 schwarze 113: --- missing man features -----------------------------------------------
1.63 schwarze 114:
115: - bashbug(1) complains "line scope broken" after
116: .SM
117: .B something
118: should either just work or be a warning
119: reported by naddy@
1.79 schwarze 120:
1.80 schwarze 121: - groff an-ext.tmac macros (.UR, .UE) occur in xine(5)
122: reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
123:
1.79 schwarze 124: --- missing tbl features -----------------------------------------------
125:
126: - implement basic non-parametric .de to support e.g. sox(1)
127: reported by naddy@ Sat, 16 Oct 2010 23:51:57 +0200
128: *** sox(1) still doesn't work, tbl(1) errors need investigation
129:
130: --- missing misc features ----------------------------------------------
131:
132: - clean up escape sequence handling, creating three classes:
133: (1) fully implemented, or parsed and ignored without loss of content
134: (2) unimplemented, potentially causing loss of content
135: or serious mangling of formatting (e.g. \n) -> ERROR
136: see textproc/mgdiff(1) for nice examples
137: (3) undefined, just output the character -> perhaps WARNING
138:
1.83 schwarze 139: - The \t escape sequence is the same as a literal tab, see for example
140: the ASCII table in hexdump(1) where
141: .Bl -column \&000_nu \&001_so \&002_st \&003_et \&004_eo
142: .It \&000\ nul\t001\ soh\t002\ stx\t003\ etx\t004\ eot\t005\ enq
143: produces
144: 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq
145: and the example in oldrdist(1)
146:
1.79 schwarze 147: - look at pages generated from reStructeredText, e.g. devel/mercurial hg(1)
148: These are a weird mixture of man(7) and custom autogenerated low-level
149: roff stuff. Figure out to what extent we can cope.
1.80 schwarze 150: For details, see http://docutils.sourceforge.net/rst.html
1.79 schwarze 151: noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200
152: reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100
1.71 schwarze 153:
154: - check compatibility with Plan9:
155: http://swtch.com/usr/local/plan9/tmac/tmac.an
156: http://swtch.com/plan9port/man/man7/man.html
157: "Anthony J. Bentley" <anthonyjbentley@gmail.com> 28 Dec 2010 21:58:40 -0700
1.63 schwarze 158:
1.1 kristaps 159: ************************************************************************
160: * formatting issues: ugly output
161: ************************************************************************
1.33 schwarze 162:
1.67 schwarze 163: - double quotes inside double quotes are escaped by doubling them
1.74 schwarze 164: implement this in mdoc(7), too
165: so far, we only have it in roff(7) and man(7)
1.67 schwarze 166: reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500
167:
1.28 schwarze 168: - perl(1) SYNOPSIS looks bad; reported by deraadt@
1.29 kristaps 169: 1) man(7) seems to need SYNOPSIS .Nm blocks, too
1.1 kristaps 170:
1.39 schwarze 171: - In .Bl -column,
172: .It Em Authentication<tab>Key Length
173: ought to render "Key Length" with emphasis, too,
174: see OpenBSD iked.conf(5).
175:
1.1 kristaps 176: - empty phrases in .Bl column produce too few blanks
177: try e.g. .Bl -column It Ta Ta
178: reported by millert Fri, 02 Apr 2010 16:13:46 -0400
1.48 schwarze 179:
1.83 schwarze 180: - .%T can have trailing punctuation. Currently, it puts the trailing
181: punctuation into a trailing MDOC_TEXT element inside its own scope.
182: That element should rather be outside its scope, such that the
183: punctuation does not get underlines. This is not trivial to
184: implement because .%T then needs some features of in_line_eoln() -
185: slurp all arguments into one single text element - and one feature
186: of in_line() - put trailing punctuation out of scope.
187: Found in mount_nfs(8) and exports(5), search for "Appendix".
188:
1.48 schwarze 189: - in enclosures, mandoc sometimes fancies a bogus end of sentence
190: reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059
1.35 kristaps 191:
1.1 kristaps 192: ************************************************************************
193: * formatting issues: gratuitious differences
194: ************************************************************************
1.65 kristaps 195:
196: - .Rv (and probably .Ex) print different text if an `Nm' has been named
197: or not (run a manual without `Nm blah' to see this). I'm not sure
198: that this exists in the wild, but it's still an error.
1.38 schwarze 199:
200: - In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet
201: is just "o\bo".
202: see for example OpenBSD ksh(1)
203:
204: - The characters "|" and "\*(Ba" should never be bold,
205: not even in the middle of a word, e.g. ".Cm b\*(Bac" in
206: "mknod [-m mode] name b|c major minor"
207: in OpenBSD ksh(1)
208:
209: - A bogus .Pp between two .It must not produce a double blank line,
1.39 schwarze 210: see between -R and -r in OpenBSD rm(1), before "update" in mount(8),
1.83 schwarze 211: or in DIAGNOSTICS in init(8), or before "is always true" in ksh(1).
212: The same happens with .Pp just before .El, see bgpd.conf(5).
1.68 kristaps 213: Also have `It' complain if `Pp' is invoked at certain times (not
214: -compact?).
1.39 schwarze 215:
1.83 schwarze 216: - If the *first* line after .It is .Pp, break the line right after
217: the tag, do not pad with space characters before breaking.
218: See the description of the a, c, and i commands in sed(1).
219:
220: - If the first line after .It is .D1, do not assert a blank line
221: in between, see for example tmux(1).
222: reported by nicm@ 13 Jan 2011 00:18:57 +0000
223:
1.39 schwarze 224: - .Nx 1.0a
225: should be "NetBSD 1.0A", not "NetBSD 1.0a",
226: see OpenBSD ccdconfig(8).
227:
1.83 schwarze 228: - The space character joining .Dx .Fx .Nx .Ox (are these all?) to its
229: argument is non-breaking. See the cdio(1) HISTORY and many others.
230:
231: - .Bx uses a dash before its argument, not a space,
232: see for example the chpass(1) and column(1) HISTORY.
233: Besides, the second argument is capitalized, for example,
234: .Bx 4.3 tahoe .
235: produces 4.3BSD-Tahoe.
236:
1.39 schwarze 237: - In .Bl -tag, if a tag exceeds the right margin and must be continued
238: on the next line, it must be indented by -width, not width+1;
239: see "rule block|pass" in OpenBSD ifconfig(8).
1.56 schwarze 240:
1.83 schwarze 241: - When the -width string contains macros, the macros must be rendered
242: before measuring the width, for example
243: .Bl -tag -width ".Dv message"
244: in magic(5), located in src/usr.bin/file, is the same
245: as -width 7n, not -width 11n.
246:
1.56 schwarze 247: - The \& zero-width character counts as output.
248: That is, when it is alone on a line between two .Pp,
249: we want three blank lines, not two as in mandoc.
1.63 schwarze 250:
251: - When .Fn arguments exceed one output line, all but the first
252: should be indented, see e.g. rpc(3);
253: reported by jmc@ on discuss@ Fri, 29 Oct 2010 13:48:33 +0100
1.64 schwarze 254:
1.83 schwarze 255: - .Ns should only be effective when called by another macro,
256: not as a stand-alone macro at the beginning of a line;
257: see for example the awk(1) SYNOPSIS.
258:
259: - .Ns should work when called at the end of an input line, see
260: the following code in vi(1):
261: .It Xo
262: .Op Ar line
263: .Cm a Ns Op Cm ppend Ns
264: .Op Cm !\&
265: .Xc
266: The input text is appended after the specified line.
267:
1.64 schwarze 268: - Header lines of excessive length:
269: Port OpenBSD man_term.c rev. 1.25 to mdoc_term.c
270: and document it in mdoc(7) and man(7) COMPATIBILITY
271: found while talking to Chris Bennett
1.83 schwarze 272:
273: - In man(7), the sequence
274: .HP
275: one line of regular text
276: .SH
277: should not produce two blank lines before the .SH,
278: see for example named-checkconf(8).
279:
280: - In man(7), the sequence
281: regular text
282: .RS
283: .IP
284: should have a blank line between the text and the beginning of the
285: indented paragraph, see for example sudo(1).
286:
287: - At least sometimes, .sp is ignored right after .SH; see named.conf(5).
288:
289: - trailing whitespace must be ignored even when followed by a font escape,
290: see for example
291: makes
292: \fBdig \fR
293: operate in batch mode
294: in dig(1).
1.75 schwarze 295:
296: ************************************************************************
297: * error reporting issues
298: ************************************************************************
1.1 kristaps 299:
1.9 kristaps 300: ************************************************************************
301: * performance issues
302: ************************************************************************
303:
304: Several areas can be cleaned up to make mandoc even faster. These are
305:
306: - improve hashing mechanism for macros (quite important: performance)
307:
308: - improve hashing mechanism for characters (not as important)
1.23 kristaps 309:
1.37 kristaps 310: - the PDF file is HUGE: this can be reduced by using relative offsets
311:
1.23 kristaps 312: ************************************************************************
313: * structural issues
314: ************************************************************************
1.67 schwarze 315:
316: - Find better ways to prevent endless loops
317: in roff(7) macro and string expansion.
318:
CVSweb