Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH (?): Man page formatting in zshbuiltins



This is a rather obscure thing, and I'm not going to commit it yet in hopes
that somebody who knows yodl better than I do will be able to fix it more
cleanly.

The problem occurs when using nested startitem()/enditem() pairs.  When the
very last item() in the list has more than one paragraph of text, the call
to enditem() that follows will remove too many levels of indentation.  This
doesn't happen if the final item() has only a single paragraph (i.e., no
blank lines in the second argument), so it has something to do with the way
zman.yo redefines the PARAGRAPH() macro ... I think ....

The hack in this patch is to delay the enditem() until after any text that
must appear at only one level less indentation has been output, and to do
that only ifzman().

Index: Doc/Zsh/builtins.yo
===================================================================
@@ -841,8 +841,8 @@
 character is tested, so that e.g. `tt(read -t -k 2)' can still block on the
 second character.
 )
-enditem()
-
+ifnzman(enditem()
+)
 If the first argument contains a `tt(?)', the remainder of this
 word is used as a var(prompt) on standard error when the shell
 is interactive.
@@ -858,6 +858,7 @@
 cancels both tt(-p) and tt(-u).
 
 The tt(-c) or tt(-l) flags cancel any and all of tt(-kpquz).
+ifzman(enditem())
 )
 cindex(parameters, marking readonly)
 alias(readonly)(typeset -r)
@@ -1467,13 +1468,14 @@
 var(name)s to specify the loading style of all following functions, up to
 the next tt(-k) or tt(-z).
 )
-enditem()
-
+ifnzman(enditem()
+)
 The created file always contains two versions of the compiled
 format, one for big-endian machines and one for small-endian
 machines.  The upshot of this is that the compiled file is machine
 independent and if it is read or mapped, only one half of the file
 is actually used (and mapped).
+ifzman(enditem())
 )
 module(zformat)(zsh/zutil)
 module(zftp)(zsh/zftp)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author