1 ************************************************************************
2 * Official mandoc TODO.
3 * $Id: TODO,v 1.89 2011/02/03 10:24:21 kristaps Exp $
4 ************************************************************************
6 ************************************************************************
8 ************************************************************************
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).
16 - .TP before .SH is still FATAL in man(7)
17 reported by brad@ Sat, 15 Jan 2011 15:54:54 -0500
19 - The mdoc(7) parser should handle `\.' as punctuation:
20 .Ql .if ${VAR} op something \.
22 `.if ${VAR} op something'.
24 `.if ${VAR} op something .'
26 To escape the dot, one would use `\&.'.
28 - the roff parser doesn't tolerate additional characters between
29 a macro and the \} terminating a conditional block, e.g.
32 reported by ulrich spoerlein Tue, 19 Oct 2010 20:39:50 +0200
34 ************************************************************************
36 ************************************************************************
38 ************************************************************************
40 ************************************************************************
42 --- missing roff features ----------------------------------------------
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).
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
57 - .ns (no-space mode) occurs in xine-config(1)
58 reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
60 - xloadimage(1) wants .ti (temporary indent), rep by naddy@
62 - .ta (tab settings) occurs in ircbug(1) and probably gnats(1)
63 reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500
65 - pod2man expects `tr' to be implemented for \*(-- to work
67 - \c (interrupted text) occurs in chat(8)
69 --- missing mdoc features ----------------------------------------------
71 - fix bad block nesting involving multiple identical explicit blocks
72 see the OpenBSD mdoc_macro.c 1.47 commit message
74 - .Bl -column .Xo support is missing
76 restore .Xr and .Dv to
77 lib/libc/compat-43/sigvec.3
79 lib/libc/sys/sigaction.2
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
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.
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).
96 - implement blank `Bl -column', such as
101 - explicitly disallow nested `Bl -column', which would clobber internal
102 flags defined for struct mdoc_macro
104 - inside `.Bl -column' phrases, punctuation is handled like normal
105 text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -."
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 ."
111 - set a meaningful default if no `Bl' list type is assigned
113 - have a blank `It' head for `Bl -tag' not puke
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)
119 --- missing man features -----------------------------------------------
121 - bashbug(1) complains "line scope broken" after
124 should either just work or be a warning
127 - groff an-ext.tmac macros (.UR, .UE) occur in xine(5)
128 reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500
130 --- missing tbl features -----------------------------------------------
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
136 --- missing misc features ----------------------------------------------
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
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
150 000 nul 001 soh 002 stx 003 etx 004 eot 005 enq
151 and the example in oldrdist(1)
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.
156 For details, see http://docutils.sourceforge.net/rst.html
157 noted by stsp@ Sat, 24 Apr 2010 09:17:55 +0200
158 reminded by nicm@ Mon, 3 May 2010 09:52:41 +0100
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
165 ************************************************************************
166 * formatting issues: ugly output
167 ************************************************************************
169 - a column list with blank `Ta' cells triggers a spurrious
170 start-with-whitespace printing of a newline
172 - double quotes inside double quotes are escaped by doubling them
173 implement this in mdoc(7), too
174 so far, we only have it in roff(7) and man(7)
175 reminded by millert@ Thu, 09 Dec 2010 17:29:52 -0500
177 - perl(1) SYNOPSIS looks bad; reported by deraadt@
178 1) man(7) seems to need SYNOPSIS .Nm blocks, too
181 .It Em Authentication<tab>Key Length
182 ought to render "Key Length" with emphasis, too,
183 see OpenBSD iked.conf(5).
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
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".
198 - in enclosures, mandoc sometimes fancies a bogus end of sentence
199 reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059
201 ************************************************************************
202 * formatting issues: gratuitious differences
203 ************************************************************************
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.
209 - In .Bl -bullet, the groff bullet is "+\b+\bo\bo", the mandoc bullet
211 see for example OpenBSD ksh(1)
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"
218 - A bogus .Pp between two .It must not produce a double blank line,
219 see between -R and -r in OpenBSD rm(1), before "update" in mount(8),
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).
222 Also have `It' complain if `Pp' is invoked at certain times (not
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).
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
234 should be "NetBSD 1.0A", not "NetBSD 1.0a",
235 see OpenBSD ccdconfig(8).
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).
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.
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.
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
255 - .Ns should work when called at the end of an input line, see
256 the following code in vi(1):
259 .Cm a Ns Op Cm ppend Ns
262 The input text is appended after the specified line.
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
269 - In man(7), the sequence
271 one line of regular text
273 should not produce two blank lines before the .SH,
274 see for example named-checkconf(8).
276 - In man(7), the sequence
280 should have a blank line between the text and the beginning of the
281 indented paragraph, see for example sudo(1).
283 - At least sometimes, .sp is ignored right after .SH; see named.conf(5).
285 - trailing whitespace must be ignored even when followed by a font escape,
289 operate in batch mode
292 ************************************************************************
293 * error reporting issues
294 ************************************************************************
296 ************************************************************************
298 ************************************************************************
300 Several areas can be cleaned up to make mandoc even faster. These are
302 - improve hashing mechanism for macros (quite important: performance)
304 - improve hashing mechanism for characters (not as important)
306 - the PDF file is HUGE: this can be reduced by using relative offsets
308 ************************************************************************
310 ************************************************************************
312 - Find better ways to prevent endless loops
313 in roff(7) macro and string expansion.