zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] fix problem with blank lines in examples in documents
@ 2015-11-11 10:15 Jun T.
  0 siblings, 0 replies; only message in thread
From: Jun T. @ 2015-11-11 10:15 UTC (permalink / raw)
  To: zsh-workers

In man pages and zsh.pdf, blank lines in examples are causing
minor format problems.

As an example, see the example script in the description of the zle
standard widget "recursive-edit" (in zshzle.1), which looks like

	self-insert-ucase() {
          LBUFFER+=${(U)KEYS[-1]}
	}
	(1st blank line)
	integer stat
	(2nd blank line)
	...

In "man zshzle", only the 1st part (before the 1st blank line) of
the example has the bold attribute. In zsh.pdf, section 18.6.6,
each blank line in the example is replaced by two blank lines.

The same problem exists in the example at the end of "ABBREVIATED
DYNAMIC REFERENCES TO DIRECTORIES" in zshcontrib (or 26.4.3 in
zsh.pdf).

It seems that the blank line causes the yodl macro PARAGRAPH()
to be called even in the example() macro. The patch below may be
a possible fix. I've checked (with yodl 3.0) that, at least with
the current set of *.yo, the patch does not introduce any bad
side effects (manpages and zsh.texi generated with the patch have
no undesired diffs form those generated without it).


diff --git a/Doc/zman.yo b/Doc/zman.yo
index 73cc186..5050edb 100644
--- a/Doc/zman.yo
+++ b/Doc/zman.yo
@@ -174,9 +174,11 @@ def(itemiz)(1)(\
 COMMENT(--- special effects ---)
 
 def(example)(1)(\
+  undef(PARAGRAPH)\
   NOTRANS(.RS)+NL()NOTRANS(.nf)+NL()\
   NOTRANS(\fB)ARG1+NOTRANS(\fP)\
   +NL()NOTRANS(.fi)+NL()NOTRANS(.RE)\
+  STDPAR()\
 )
 
 def(nofill)(1)(\
diff --git a/Doc/ztexi.yo b/Doc/ztexi.yo
index 6995677..e878345 100644
--- a/Doc/ztexi.yo
+++ b/Doc/ztexi.yo
@@ -225,9 +225,11 @@ def(nofill)(1)(\
 )
 
 def(example)(1)(\
+  undef(PARAGRAPH)\
   NOTRANS(@example)+NL()\
   ARG1\
   +NL()NOTRANS(@end example)\
+  STDPAR()\
 )
 
 def(indent)(1)(\




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-11 10:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-11 10:15 [PATCH] fix problem with blank lines in examples in documents Jun T.

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).