bug-texinfo
[Top][All Lists]
Advanced

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

Re: (gnu)sed in texinfo


From: Karl Berry
Subject: Re: (gnu)sed in texinfo
Date: Fri, 4 Jul 2014 23:35:06 GMT

    Mihai> You know, taking a look at run_recode(), it doesn't use the
    "$from" local variable at all for encoding, which looks like a bug.

Indeed.  Thanks for noticing and mentioning that.

It appears to me that the recode feature in texi2dvi never worked, at
least since the --recode-from option was added.  And --recode-from also
never had the intended effect.

Since all that happened years ago, if correct, I conclude that no one is
using --recode or --recode-from.  Therefore I propose removing these
options instead of fixing the code.  texi2dvi has become much too
complicated IMHO, and I'd be thrilled to take any possible chance at
simplification.

Does anyone want to argue for preservation of --recode and/or
--recode-from?  Akim, Sergey?  Since you two were the ones who
originally sent me the patches.  I'll give you-all a couple of days
before I remove it :).

Code as it is today and has been since 2006 or so:
http://svn.savannah.gnu.org/viewvc/trunk/util/texi2dvi?root=texinfo&r1=1802&r2=1817

      if test -n "$recode_from"; then
        from=$recode_from
        to=$encoding
      else
        from=$encoding
        to=$texinfo
      fi
      ...
      if recode "$encoding..$to" <"$in_input" >"$in_rcd" \

My argument for brokenness:

1) if $recode_from is non-null, $from is set but not used in the recode
call, as pointed out by Mihai.

2) if $recode_from is null, then $to is set to $texinfo, which is not a
variable set in the script, and will thus generally be unset.
Presumably this was intended to be the constant string "texinfo", not
the variable deref "$texinfo".

Therefore I see no cases where the recode invocation is as intended, or
where it does anything useful.  It either ends up doing
"$encoding..$encoding" or "$encoding..".  I admit I didn't actually run
anything, just looked at the code ...

karl

P.S. I admit I fail to see the win to recoding in the first place.



reply via email to

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