On Thu, Sep 24, 2026 at 08:49:48AM +0300, Eli Zaretskii wrote:
> > In my opinion, it would be better if a directory component in
> > @setfilename was ignored.  In my opinion, it would be ideal if
> > @setfilename was ignored unless the Texinfo file is read from standard
> > input.  We have to maintain backward compatibility, but I would be in
> > favor of deprecating @setfilename except for that specific use.
> 
> Once again, such backward-incompatible changes should IMO and IME have
> very good reasons.  What are those reasons in this case?  Just the
> fact that this behavior might be surprising when you first hear about
> it?

Nowadays, @setfilename should only be used to specify the basefile name,
and should not contain paths.  It also should be the same as the input
file name (with .texi replaced by .info).  It is therefore redundant
with using the file name if there is one.  Therefore it could easily be
deprecated (except maybe for the case of Texinfo manual passed in
standard input), removing useless complexity in the Texinfo language.

Note that this deprecation does not mean that we should stop immediately
supporting @setfilename.  It only means that we should not document any
other use for newer Texinfo versions. 

Currently there is the following in the  manual:

 The @code{@@setfilename} line specifies the name of the output file to
 be generated by @command{texi2any}.  This command is ignored for
 @TeX{} formatting.  When present, it should be the first Texinfo
 command (that is, after @samp{\input texinfo}).  Write the
 @code{@@setfilename} command at the beginning of a line and follow it
 on the same line by the Info file name.

 The name must be different from the name of the Texinfo file.
 There are two conventions for choosing the name: you
 can either remove the extension (such as @samp{.texi}) entirely from
 the input file name, or (recommended) replace it with the @samp{.info}
 extension.  It is not advised to base the @code{@@setfilename} name
 on a entirely different name than the input file name.

 ...
 @code{@@setfilename} used to be required by the Texinfo processors
 and some other programs.  This should not be the case any more;
 @code{@@setfilename} can be omitted.  If the Texinfo input is
 processed from standard input, without an input file name to deduce the
 base file name from, @code{@@setfilename} could still be relevant.
 This is not the only way, however: @option{--output} option specifies
 the output file name on the @command{texi2any} command-line
 (@pxref{Invoking @command{texi2any}}).


My proposal would be to replace by something like

 If the Texinfo input is processed from standard input, you can use
 @setfilename to specify the manual name. .....

 @code{@@setfilename} used to be required by the Texinfo processors
 and some other programs.  If you want to support them, you should
 set @code{@@setfilename} to the input file name with .texi replaced
 by .info.


Again it does not say anything about what we do for @setfilename nor
for @setfilename with path, we could still try to do something sane
and/or backward compatible to still support correctly manuals that
use the deprecated feature.

-- 
Pat

Reply via email to