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