[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6643] move comment_iftex in file
From: |
Gavin D. Smith |
Subject: |
[6643] move comment_iftex in file |
Date: |
Wed, 23 Sep 2015 17:18:45 +0000 |
Revision: 6643
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6643
Author: gavin
Date: 2015-09-23 17:18:44 +0000 (Wed, 23 Sep 2015)
Log Message:
-----------
move comment_iftex in file
Modified Paths:
--------------
trunk/ChangeLog
trunk/util/texi2dvi
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2015-09-23 16:31:36 UTC (rev 6642)
+++ trunk/ChangeLog 2015-09-23 17:18:44 UTC (rev 6643)
@@ -1,5 +1,10 @@
2015-09-23 Gavin Smith <address@hidden>
+ * util/texi2dvi (comment_iftex, uncomment_iftex): Move in file
+ closer to where they are used.
+
+2015-09-23 Gavin Smith <address@hidden>
+
* util/texi2dvi (generated_files_get_from_fls): Avoid exiting
script with 'set -e' if file list is empty.
Modified: trunk/util/texi2dvi
===================================================================
--- trunk/util/texi2dvi 2015-09-23 16:31:36 UTC (rev 6642)
+++ trunk/util/texi2dvi 2015-09-23 17:18:44 UTC (rev 6643)
@@ -1231,6 +1231,60 @@
fi
}
+# Unfortunately, makeinfo --iftex --no-ifinfo doesn't work well enough
+# in versions before 5.0, as makeinfo can't parse the TeX commands
+# inside @tex blocks, so work around with sed.
+#
+# This sed script preprocesses Texinfo sources in order to keep the
+# iftex sections only. We want to remove non-TeX sections, and comment
+# (with address@hidden _texi2dvi') TeX sections so that makeinfo does not try
to
+# parse them. Nevertheless, while commenting TeX sections, don't
+# comment @macro/@end macro so that makeinfo does propagate them.
+# Similarly, preserve the @top node to avoid makeinfo complaining about
+# it being missed. Comment it out after preprocessing, so that it does
+# not appear in the generated document.
+#
+# We assume that address@hidden _texi2dvi' or address@hidden (_texi2dvi)'
starting a line is
+# not present in the document. Additionally, conditionally defined
+# macros inside the @top node may end up with the wrong value, although
+# this is unlikely in practice.
+#
+comment_iftex=\
+'/address@hidden/,/address@hidden tex/{
+ s/^/@c _texi2dvi/
+}
+/address@hidden/,/address@hidden iftex/{
+ s/^/@c _texi2dvi/
+ /address@hidden address@hidden/,/address@hidden address@hidden macro/{
+ s/address@hidden _texi2dvi//
+ }
+}
+/address@hidden/,/address@hidden ifnottex/{
+ s/^/@c (_texi2dvi)/
+ /address@hidden (_texi2dvi)@node Top/,/address@hidden (_texi2dvi)@end
ifnottex/ {
+ /address@hidden (_texi2dvi)@end ifnottex/b
+ s/address@hidden (_texi2dvi)//
+ }
+}
+/address@hidden/,/address@hidden ifinfo/{
+ /address@hidden/p
+ /address@hidden/,/address@hidden menu/p
+ t
+ s/^/@c (_texi2dvi)/
+}
+s/address@hidden/@c address@hidden/
+s/address@hidden ifnotinfo/@c address@hidden ifnotinfo/'
+
+# Uncomment @iftex blocks by removing any leading address@hidden texi2dvi'
(repeated
+# copies can sneak in via macro invocations). Likewise, comment out
+# the @top node inside a @ifnottex block.
+uncomment_iftex=\
+'s/address@hidden _texi2dvi\(@c _texi2dvi\)*//
+/address@hidden (_texi2dvi)@ifnottex/,/address@hidden (_texi2dvi)@end
ifnottex/{
+ s/^/@c (_texi2dvi)/
+}'
+
+
# insert_commands - Insert $textra commands after @setfilename (Texinfo)
# or at the beginning of the file (LaTeX). Recommended to be used for
# @finalout, @smallbook, etc.
@@ -1659,7 +1713,10 @@
}
-# Main program starts - initialize more variables.
+#
+#################### Main program starts ##########################
+
+# Initialize more variables.
#
# Save TEXINPUTS so we can construct a new TEXINPUTS path for each file.
# Likewise for bibtex and makeindex.
@@ -1670,61 +1727,6 @@
export $var
done
-# Unfortunately, makeinfo --iftex --no-ifinfo doesn't work well enough
-# in versions before 5.0, as makeinfo can't parse the TeX commands
-# inside @tex blocks, so work around with sed.
-#
-# This sed script preprocesses Texinfo sources in order to keep the
-# iftex sections only. We want to remove non-TeX sections, and comment
-# (with address@hidden _texi2dvi') TeX sections so that makeinfo does not try
to
-# parse them. Nevertheless, while commenting TeX sections, don't
-# comment @macro/@end macro so that makeinfo does propagate them.
-# Similarly, preserve the @top node to avoid makeinfo complaining about
-# it being missed. Comment it out after preprocessing, so that it does
-# not appear in the generated document.
-#
-# We assume that address@hidden _texi2dvi' or address@hidden (_texi2dvi)'
starting a line is
-# not present in the document. Additionally, conditionally defined
-# macros inside the @top node may end up with the wrong value, although
-# this is unlikely in practice.
-#
-comment_iftex=\
-'/address@hidden/,/address@hidden tex/{
- s/^/@c _texi2dvi/
-}
-/address@hidden/,/address@hidden iftex/{
- s/^/@c _texi2dvi/
- /address@hidden address@hidden/,/address@hidden address@hidden macro/{
- s/address@hidden _texi2dvi//
- }
-}
-/address@hidden/,/address@hidden ifnottex/{
- s/^/@c (_texi2dvi)/
- /address@hidden (_texi2dvi)@node Top/,/address@hidden (_texi2dvi)@end
ifnottex/ {
- /address@hidden (_texi2dvi)@end ifnottex/b
- s/address@hidden (_texi2dvi)//
- }
-}
-/address@hidden/,/address@hidden ifinfo/{
- /address@hidden/p
- /address@hidden/,/address@hidden menu/p
- t
- s/^/@c (_texi2dvi)/
-}
-s/address@hidden/@c address@hidden/
-s/address@hidden ifnotinfo/@c address@hidden ifnotinfo/'
-
-# Uncomment @iftex blocks by removing any leading address@hidden texi2dvi'
(repeated
-# copies can sneak in via macro invocations). Likewise, comment out
-# the @top node inside a @ifnottex block.
-uncomment_iftex=\
-'s/address@hidden _texi2dvi\(@c _texi2dvi\)*//
-/address@hidden (_texi2dvi)@ifnottex/,/address@hidden (_texi2dvi)@end
ifnottex/{
- s/^/@c (_texi2dvi)/
-}'
-
-# Main program continues - command line parsing.
-#
# Push a token among the arguments that will be used to notice when we
# ended options/arguments parsing.
# Use "set dummy ...; shift" rather than 'set - ..." because on
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6643] move comment_iftex in file,
Gavin D. Smith <=