bug-texinfo
[Top][All Lists]
Advanced

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

Re: [bug #43122] texi2dvi does not compile enough times to get toc


From: Vincent Belaïche
Subject: Re: [bug #43122] texi2dvi does not compile enough times to get toc
Date: Sat, 19 Sep 2015 17:42:28 +0200


Le 18/09/2015 10:56, Gavin Smith a écrit :
> On 18 September 2015 at 08:09, Vincent Belaïche
> <address@hidden> wrote:
>> It could not be so big, because we should make texi2dvi/texindex
>> backward compatible with the older extensions and make the update in
>> texinfo.tex one or two years later than for texi2dvi/texindx, assuming
>> that all user would have an uptodate texi2dvi/texindex at that time.
>
> Additionally, it would end up being supported forever, two different
> naming schemes in texi2dvi. Anyone modifying texi2dvi would waste time
> looking at code to support the multiple naming schemes, and scrolling
> past it in the text editor. As well as wasting time thinking about it
> and trying to work out if it'll affect other changes they want to make
> to texi2dvi.


Well, I agree to all your arguments, I am not saying that this does not
raise any issue, I am not saying that there is no cost in going to this
way. However, in the long run, I think that this is a good decision to
take. At least in 10 years' time we never fall again into the endless
discussion if suddenly there is some .cps or .kys extension created by
some TeX or TeX friend and we want to use these for Texinfo...

I did a trial on the latest texi2dvi, to see what it would cost just for
the name compatibility handling with older texinfo.tex/texindex, and it
is a matter of 12 code lines --- see patch attached.

VBR,
        Vincent



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
http://www.avast.com
Index: texi2dvi

===================================================================

--- texi2dvi    (revision 6616)

+++ texi2dvi    (working copy)

@@ -725,9 +725,15 @@

     echo $file
     case $in_lang in
       texinfo)
-        # texindex: texinfo.cp -> texinfo.cps
-       if index_file_p $file; then
-         echo ${file}s
+       if index_file_p $file; then
+         case $file in
+            # texindex: in_file.cp.idx -> in_file.cp.ind
+           *.*.idx) echo `echo -n $file | head -c -2`nd;;
+            # texindex: in_file.cp -> in_file.cps
+           *)
+             verbose "$file does not have the .idx extension, you should 
update texinfo.tex"
+             echo ${file}s;;
+         esac
        fi
        ;;
       latex)
@@ -1050,6 +1056,17 @@

 
     texinfo:*)
       run $TEXINDEX $index_files
+      # Handle compatibility issue with older Texinfo
+      for file in $index_files; do
+       case $file in
+         *.*.idx)
+           if test -f ${file}s && test ${file}s -nt $file; then
+             renamed_file=`echo -n $file | head -c -1`.ind
+             mv ${file}s $renamed_file
+             verbose "Moving ${file}s to $renamed_file. You should update 
texindex to handle that."
+           fi;;
+       esac
+      done
       ;;
   esac
 }

reply via email to

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