texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * util/texi2dvi (--expand): Remove lengthy block


From: Gavin D. Smith
Subject: branch master updated: * util/texi2dvi (--expand): Remove lengthy block of code using sed to comment out @tex blocks. Suggestion from Patrice. * NEWS, TODO, README-hacking: update
Date: Sun, 13 Nov 2022 06:05:12 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a200456659 * util/texi2dvi (--expand): Remove lengthy block of code 
using sed to comment out @tex blocks.  Suggestion from Patrice. * NEWS, TODO, 
README-hacking: update
a200456659 is described below

commit a200456659d02b0ea1be4a3250865743ad3397af
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Nov 13 11:05:02 2022 +0000

    * util/texi2dvi (--expand): Remove lengthy block of code
    using sed to comment out @tex blocks.  Suggestion from Patrice.
    * NEWS, TODO, README-hacking: update
---
 ChangeLog      |  6 ++++++
 NEWS           |  5 +++++
 README-hacking |  5 -----
 TODO           |  6 +-----
 util/texi2dvi  | 59 +++-------------------------------------------------------
 5 files changed, 15 insertions(+), 66 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d71373c830..b59ad0e2a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-11-13  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * util/texi2dvi (--expand): Remove lengthy block of code
+       using sed to comment out @tex blocks.  Suggestion from Patrice.
+       * NEWS, TODO, README-hacking: update
+
 2022-11-12  Werner Lemberg  <wl@gnu.org>
 
        * doc/texinfo.tex (\unicodechardefs): Add missing % after }.
diff --git a/NEWS b/NEWS
index cdeff0bda1..0a30b4f323 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,11 @@ See the manual for detailed information.
       with printed output.
     . Change @point expansion to U+22C6 in HTML Cross-references.
 
+* texi2dvi
+ . macro expansion with texi2any requires at least version 5.0 (only
+   happens with --expand option or with very old texinfo.tex)
+
+
 7.0 (7 November 2022)
 * texi2any
  . LaTeX added as an output format, selected with --latex
diff --git a/README-hacking b/README-hacking
index ac497da156..23395bb9f3 100644
--- a/README-hacking
+++ b/README-hacking
@@ -347,8 +347,3 @@ cvs -qn update, followed by cvs add.  When done, run cvs 
commit.
 configure.ac, util/texi2dvi: add "dev" to versions for clarity,
 until it's time to do pretests again.
 
-after next release:
-check TODO file and do pending tasks
-delete these lines from README-hacking
-
-
diff --git a/TODO b/TODO
index 9d07ba7045..4da6336e7f 100644
--- a/TODO
+++ b/TODO
@@ -61,7 +61,7 @@ If you are interested in working on any of these, email 
bug-texinfo@gnu.org.
   - LaTeX: customization and internationalization.
 
 * TeX:
-  - turn off @set txicodevaristt after next release
+  - should we turn off @set txicodevaristt?
   - Index above @item allows page break.
   - Table of contents is misaligned if there are 10 or more [sub]sections.
   - @float captions should be typeset in a smaller font?
@@ -102,10 +102,6 @@ If you are interested in working on any of these, email 
bug-texinfo@gnu.org.
   - support info dir entries for other than the current info file name;
     see comments in menu_item_equal.
 
-* texi2dvi
-  - replace sed substitutions in comment_iftex by a call of makeinfo:
-     makeinfo -c TEXINFO_OUTPUT_FORMAT=plaintexinfo --iftex --no-ifinfo
-
 * Distribution:
   - generate txi-??.tex from .po's to make translators' jobs easier.
     From Akim and Karl E.
diff --git a/util/texi2dvi b/util/texi2dvi
index e51d5860f3..1425e7d3a7 100755
--- a/util/texi2dvi
+++ b/util/texi2dvi
@@ -195,7 +195,7 @@ EOF
 version ()
 {
   cat <<EOF
-texi2dvi (GNU Texinfo 7.0)
+texi2dvi (GNU Texinfo 7.0dev)
 
 Copyright (C) 2022 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
@@ -1200,10 +1200,10 @@ to tex itself simply not working."
     # (running missing) and then we end up with things like '"-I"',
     # and "-I" (including the quotes) is not an option name.  This
     # happens with gettext 0.14.5, at least.
-    $SED "$comment_iftex" "$command_line_filename" \
+    cat "$command_line_filename" \
       | eval $makeinfo --footnote-style=end -I "$in_dir" $run_mi_includes \
         -o /dev/null --macro-expand=- \
-      | $SED "$uncomment_iftex" >"$in_src"
+        >"$in_src"
     # Continue only if everything succeeded.
     if test $? -ne 0 \
        || test ! -r "$in_src"; then
@@ -1214,59 +1214,6 @@ to tex itself simply not working."
   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 `@c _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 `@c _texi2dvi' or `@c (_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=\
-'/^@tex/,/^@end tex/{
-  s/^/@c _texi2dvi/
-}
-/^@iftex/,/^@end iftex/{
-  s/^/@c _texi2dvi/
-  /^@c _texi2dvi@macro/,/^@c _texi2dvi@end macro/{
-    s/^@c _texi2dvi//
-  }
-}
-/^@ifnottex/,/^@end ifnottex/{
-  s/^/@c (_texi2dvi)/
-  /^@c (_texi2dvi)@node Top/,/^@c (_texi2dvi)@end ifnottex/ {
-    /^@c (_texi2dvi)@end ifnottex/b
-    s/^@c (_texi2dvi)//
-  }
-}
-/^@ifinfo/,/^@end ifinfo/{
-  /^@node/p
-  /^@menu/,/^@end menu/p
-  t
-  s/^/@c (_texi2dvi)/
-}
-s/^@ifnotinfo/@c _texi2dvi@ifnotinfo/
-s/^@end ifnotinfo/@c _texi2dvi@end ifnotinfo/'
-
-# Uncomment @iftex blocks by removing any leading `@c texi2dvi' (repeated
-# copies can sneak in via macro invocations).  Likewise, comment out
-# the @top node inside a @ifnottex block.
-uncomment_iftex=\
-'s/^@c _texi2dvi\(@c _texi2dvi\)*//
-/^@c (_texi2dvi)@ifnottex/,/^@c (_texi2dvi)@end ifnottex/{
-  s/^/@c (_texi2dvi)/
-}'
-
 
 # insert_commands - Insert $textra commands at the beginning of the file. 
 # Recommended to be used for @finalout, @smallbook, etc.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]