texinfo-commits
[Top][All Lists]
Advanced

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

texinfo update (Thu Aug 26 09:22:01 EDT 2004)


From: Karl Berry
Subject: texinfo update (Thu Aug 26 09:22:01 EDT 2004)
Date: Thu, 26 Aug 2004 09:22:32 -0400

Index: ChangeLog
===================================================================
RCS file: /cvsroot/texinfo/texinfo/ChangeLog,v
retrieving revision 1.380
retrieving revision 1.381
diff -c -r1.380 -r1.381
*** ChangeLog   25 Aug 2004 15:49:48 -0000      1.380
--- ChangeLog   26 Aug 2004 12:49:46 -0000      1.381
***************
*** 1,3 ****
--- 1,18 ----
+ 2004-08-26  Stepan Kasal  <address@hidden>
+ 
+       * util/texi2dvi: fix the sed script searching for @documentencoding;
+         Double-quote some instances of "$filename_???"
+ 
+ 2004-08-26  Akim Demaille  <address@hidden>
+ 
+       Let DVI and PDF files honor the document encoding in TeX.
+ 
+       * util/texi2dvi ($language): Be sure to set its value.
+       (get_xref_files): Turn this external shell script into a function.
+       (filename_rcd, $tmpdir_rcd): New.
+       If the file is in Texinfo, and has @documentencoding, and recode
+       is available, then run it.
+ 
  2004-08-25   Akim Demaille  <address@hidden>
  
        * util/Makefile.am (texinfo.cat): Fix for srcdir != builddir.
Index: NEWS
===================================================================
RCS file: /cvsroot/texinfo/texinfo/NEWS,v
retrieving revision 1.88
retrieving revision 1.89
diff -c -r1.88 -r1.89
*** NEWS        31 Jul 2004 18:49:51 -0000      1.88
--- NEWS        26 Aug 2004 12:49:46 -0000      1.89
***************
*** 1,4 ****
! $Id: NEWS,v 1.88 2004/07/31 18:49:51 karl Exp $
  This file records noteworthy changes.
  
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
--- 1,4 ----
! $Id: NEWS,v 1.89 2004/08/26 12:49:46 karl Exp $
  This file records noteworthy changes.
  
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
***************
*** 24,29 ****
--- 24,31 ----
  * Language:
    . new command @abbr for general abbreviations.
    . new command @slanted to typeset text with a slanted font.
+ * texi2dvi:
+   . calls recode if installed and @documentencoding is specified.
  * Distribution:
    . new convenience script texi2pdf, equivalent to texi2dvi --pdf (from 
tetex).
    . automake 1.8.5.
Index: util/texi2dvi
===================================================================
RCS file: /cvsroot/texinfo/texinfo/util/texi2dvi,v
retrieving revision 1.32
retrieving revision 1.33
diff -c -r1.32 -r1.33
*** util/texi2dvi       25 Aug 2004 15:48:21 -0000      1.32
--- util/texi2dvi       26 Aug 2004 12:49:46 -0000      1.33
***************
*** 1,6 ****
  #! /bin/sh
  # texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.
! # $Id: texi2dvi,v 1.32 2004/08/25 15:48:21 karl Exp $
  #
  # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
  # 2002, 2003, 2004 Free Software Foundation, Inc.
--- 1,6 ----
  #! /bin/sh
  # texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.
! # $Id: texi2dvi,v 1.33 2004/08/26 12:49:46 karl Exp $
  #
  # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001,
  # 2002, 2003, 2004 Free Software Foundation, Inc.
***************
*** 27,33 ****
  # the `--debug' option when making a bug report.
  
  # This string is expanded by rcs automatically when this file is checked out.
! rcs_revision='$Revision: 1.32 $'
  rcs_version=`set - $rcs_revision; echo $2`
  program=`echo $0 | sed -e 's!.*/!!'`
  version="texi2dvi (GNU Texinfo 4.7) $rcs_version
--- 27,33 ----
  # the `--debug' option when making a bug report.
  
  # This string is expanded by rcs automatically when this file is checked out.
! rcs_revision='$Revision: 1.33 $'
  rcs_version=`set - $rcs_revision; echo $2`
  program=`echo $0 | sed -e 's!.*/!!'`
  version="texi2dvi (GNU Texinfo 4.7) $rcs_version
***************
*** 114,120 ****
  : ${EGREP=egrep}
  
  # return true if program $1 is somewhere in PATH, else false.
! # 
  findprog () {
    foundprog=false
    for dir in `echo $PATH | tr "$path_sep" " "`; do
--- 114,120 ----
  : ${EGREP=egrep}
  
  # return true if program $1 is somewhere in PATH, else false.
! #
  findprog () {
    foundprog=false
    for dir in `echo $PATH | tr "$path_sep" " "`; do
***************
*** 229,235 ****
  
  
  # We can't do much without tex.
! # 
  if findprog ${TEX:-tex}; then :; else cat <<EOM
  You don't have a working TeX binary (${TEX:-tex}) installed anywhere in
  your PATH, and texi2dvi cannot proceed without one.  If you want to use
--- 229,235 ----
  
  
  # We can't do much without tex.
! #
  if findprog ${TEX:-tex}; then :; else cat <<EOM
  You don't have a working TeX binary (${TEX:-tex}) installed anywhere in
  your PATH, and texi2dvi cannot proceed without one.  If you want to use
***************
*** 249,255 ****
  # didn't explicitly specify.  We don't check for elatex and pdfelatex
  # because (as of 2003), the LaTeX team has asked that new distributions
  # use etex by default anyway.
! # 
  # End up with the TEX and PDFTEX variables set to what we are going to use.
  if test -z "$TEX"; then
    if findprog etex; then TEX=etex; else TEX=tex; fi
--- 249,255 ----
  # didn't explicitly specify.  We don't check for elatex and pdfelatex
  # because (as of 2003), the LaTeX team has asked that new distributions
  # use etex by default anyway.
! #
  # End up with the TEX and PDFTEX variables set to what we are going to use.
  if test -z "$TEX"; then
    if findprog etex; then TEX=etex; else TEX=tex; fi
***************
*** 310,344 ****
  s/address@hidden texi2dvi//
  EOF
  
! # A shell script that computes the list of xref files.
  # Takes the filename (without extension) of which we look for xref
  # files as argument.  The index files must be reported last.
! get_xref_files=$utildir/get_xref.sh
! cat <<\EOF >$get_xref_files
! #! /bin/sh
! 
! # Get list of xref files (indexes, tables and lists).
! # Find all files having root filename with a two-letter extension,
! # saves the ones that are really Texinfo-related files.  .?o? catches
! # many files: .toc, .log, LaTeX tables and lists, FiXme's .lox, maybe more.
! for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do
!   # If file is empty, skip it.
!   test -s "$this_file" || continue
!   # If the file is not suitable to be an index or xref file, don't
!   # process it.  It's suitable if the first character is a
!   # backslash or right quote or at, as long as the first line isn't
!   # \input texinfo.
!   first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file`
!   if (test "x$first_character" = "x\\" \
!       && sed 1q $this_file | grep -v '^\\input *texinfo' >/dev/null) \
!      || test "x$first_character" = "x'" \
!      || test "x$first_character" = "x@"; then
!     xref_files="$xref_files ./$this_file"
!   fi
! done
! echo "$xref_files"
! EOF
! chmod 500 $get_xref_files
  
  # File descriptor usage:
  # 0 standard input
--- 310,341 ----
  s/address@hidden texi2dvi//
  EOF
  
! # Compute the list of xref files.
  # Takes the filename (without extension) of which we look for xref
  # files as argument.  The index files must be reported last.
! get_xref_files ()
! {
!   # Get list of xref files (indexes, tables and lists).
!   # Find all files having root filename with a two-letter extension,
!   # saves the ones that are really Texinfo-related files.  .?o? catches
!   # many files: .toc, .log, LaTeX tables and lists, FiXme's .lox, maybe more.
!   for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do
!     # If file is empty, skip it.
!     test -s "$this_file" || continue
!     # If the file is not suitable to be an index or xref file, don't
!     # process it.  It's suitable if the first character is a
!     # backslash or right quote or at, as long as the first line isn't
!     # \input texinfo.
!     first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file`
!     if (test "x$first_character" = "x\\" \
!         && sed 1q $this_file | grep -v '^\\input *texinfo' >/dev/null) \
!        || test "x$first_character" = "x'" \
!        || test "x$first_character" = "x@"; then
!       xref_files="$xref_files ./$this_file"
!     fi
!   done
!   echo "$xref_files"
! }
  
  # File descriptor usage:
  # 0 standard input
***************
*** 405,416 ****
    tmpdir_xtr=$tmpdir/xtr
    filename_xtr=$tmpdir_xtr/$filename_noext.$ext
  
    # _bak.  Copies of the previous xref files (another round is run if
    # they differ from the new one).
    tmpdir_bak=$tmpdir/bak
  
    # Make all those directories and give up if we can't succeed.
!   mkdir $tmpdir_src $tmpdir_xtr $tmpdir_bak || exit 1
  
    # Source file might include additional sources.
    # We want `.:$orig_pwd' before anything else.  (We'll add `.:' later
--- 402,417 ----
    tmpdir_xtr=$tmpdir/xtr
    filename_xtr=$tmpdir_xtr/$filename_noext.$ext
  
+   # _rcd.  The Texinfo file recoded in 7bit.
+   tmpdir_rcd=$tmpdir/rcd
+   filename_rcd=$tmpdir_rcd/$filename_noext.$ext
+ 
    # _bak.  Copies of the previous xref files (another round is run if
    # they differ from the new one).
    tmpdir_bak=$tmpdir/bak
  
    # Make all those directories and give up if we can't succeed.
!   mkdir $tmpdir_src $tmpdir_xtr $tmpdir_rcd $tmpdir_bak || exit 1
  
    # Source file might include additional sources.
    # We want `.:$orig_pwd' before anything else.  (We'll add `.:' later
***************
*** 489,494 ****
--- 490,496 ----
      [lL]a[tT]e[xX] | *.ltx | *.tex)
        # Assume a LaTeX file.  LaTeX needs bibtex and uses latex for
        # compilation.  No makeinfo.
+       language=latex
        bibtex=${BIBTEX:-bibtex}
        makeinfo= # no point in running makeinfo on latex source.
        texindex=${MAKEINDEX:-makeindex}
***************
*** 503,508 ****
--- 505,511 ----
  
      *)
        # Assume a Texinfo file.  Texinfo files need makeinfo, texindex and tex.
+       language=texinfo
        bibtex=
        texindex=${TEXINDEX:-texindex}
        textra_cmd='/address@hidden/a'
***************
*** 592,601 ****
    if test -n "$textra"; then
      $verbose "Inserting extra commands: $textra"
      sed "$textra_cmd\\
! $textra" "$filename_input" >$filename_xtr
      filename_input=$filename_xtr
    fi
  
    # If clean mode was specified, then move to the temporary directory.
    if test "$clean" = t; then
      $verbose "cd $tmpdir_src"
--- 595,624 ----
    if test -n "$textra"; then
      $verbose "Inserting extra commands: $textra"
      sed "$textra_cmd\\
! $textra" "$filename_input" >"$filename_xtr"
      filename_input=$filename_xtr
    fi
  
+   # If this is a Texinfo file with a specified input encoding, and
+   # recode is available, then recode to plain 7 bit Texinfo.
+   if test $language = texinfo; then
+     pgm='s/\(^\|.* \)@documentencoding  *\([^ ][^ ]*\)\( .*\|$\)/\2/  
+       t found                                                
+       d                                                     
+       :found                                               
+       q'
+     encoding=`sed -e "$pgm" "$filename_input"`
+     if test -n "$encoding" && findprog recode; then
+       $verbose "Recoding from $encoding to Texinfo."
+       if recode "$encoding"..texinfo <"$filename_input" >"$filename_rcd" \
+          && test -s "$filename_rcd"; then
+         filename_input=$filename_rcd
+       else
+         $verbose "Recoding failed, using original input."
+       fi
+     fi
+   fi
+ 
    # If clean mode was specified, then move to the temporary directory.
    if test "$clean" = t; then
      $verbose "cd $tmpdir_src"
***************
*** 603,609 ****
    fi
  
    while :; do # will break out of loop below
!     orig_xref_files=`$get_xref_files "$filename_noext"`
  
      # Save copies of originals for later comparison.
      if test -n "$orig_xref_files"; then
--- 626,632 ----
    fi
  
    while :; do # will break out of loop below
!     orig_xref_files=`get_xref_files "$filename_noext"`
  
      # Save copies of originals for later comparison.
      if test -n "$orig_xref_files"; then
***************
*** 664,672 ****
      fi
  
      # Finally, run TeX.
!     cmd="$tex $tex_args $filename_input"
!     $verbose "Running $cmd ..."
!     if $cmd >&5; then :; else
        echo "$0: $tex exited with bad status, quitting." >&2
        echo "$0: see $filename_noext.log for errors." >&2
        test "$clean" = t \
--- 687,695 ----
      fi
  
      # Finally, run TeX.
!     cmd="$tex $tex_args"
!     $verbose "Running $cmd $filename_input ..."
!     if $cmd "$filename_input" >&5; then :; else
        echo "$0: $tex exited with bad status, quitting." >&2
        echo "$0: see $filename_noext.log for errors." >&2
        test "$clean" = t \
***************
*** 688,694 ****
      fi
  
      # Check if xref files changed.
!     new_xref_files=`$get_xref_files "$filename_noext"`
      $verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`"
      $verbose "New xref files      = `echo $new_xref_files | sed 's|\./||g'`"
  
--- 711,717 ----
      fi
  
      # Check if xref files changed.
!     new_xref_files=`get_xref_files "$filename_noext"`
      $verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`"
      $verbose "New xref files      = `echo $new_xref_files | sed 's|\./||g'`"
  
***************
*** 728,735 ****
      $thumbpdf "$filename_noext" >&5 ||
        fatal "$thumbpdf exited with bad status, quitting."
  
!     $verbose "Running $cmd ..."
!     if $cmd >&5; then :; else
        echo "$0: $tex exited with bad status, quitting." >&2
        echo "$0: see $filename_noext.log for errors." >&2
        test "$clean" = t \
--- 751,758 ----
      $thumbpdf "$filename_noext" >&5 ||
        fatal "$thumbpdf exited with bad status, quitting."
  
!     $verbose "Running $cmd $filename_input..."
!     if $cmd "$filename_input" >&5; then :; else
        echo "$0: $tex exited with bad status, quitting." >&2
        echo "$0: see $filename_noext.log for errors." >&2
        test "$clean" = t \
P ChangeLog
P NEWS
P util/texi2dvi


reply via email to

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