On Thu, Sep 24, 2026 at 11:06:49PM +0200, Patrice Dumas wrote: > 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.
I don't see why we need to deprecate the command, especially since it was used in pretty much all Texinfo files until fairly recently (it was a requirement of Automake). The Texinfo documentation used to state that @setfilename should be used in manuals: (Git commit: cfa5ef336a, 2015-10-12 21:02:23 +0000) diff --git a/ChangeLog b/ChangeLog index 8609f3ea1d..908db06ac7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-10-12 Gavin Smith <[email protected]> + + * doc/texinfo.texi (@setfilename): @setfilename not required. + 2015-10-09 Gavin Smith <[email protected]> * doc/texinfo.texi (Testing for Texinfo Commands): Use @@@@ in diff --git a/doc/texinfo.texi b/doc/texinfo.texi index 29e9eaff9a..f65e5a767f 100644 --- a/doc/texinfo.texi +++ b/doc/texinfo.texi @@ -1921,9 +1921,6 @@ @node @code{@@setfilename} @@setfilename @var{info-file-name} @end example -This command is required for @TeX{}, and very strongly recommended for -@code{makeinfo}. - Write the @code{@@setfilename} command at the beginning of a line and follow it on the same line by the Info file name. Do not write anything else on the line. It's noted as no longer required in the NEWS for Texinfo 6.1 (2016-02-06). I don't think we should mark a command as deprecated when its use was practically mandatory for the majority of the history of the 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. People will want to consult the Texinfo manual for how @setfilename is used in existing manuals so we still need to document it to some extent. > 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. ..... I think it makes sense to put this first as this is the case where the command is actually useful. I'll attempt an edit to the manual based on your suggested text. > @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. @setfilename with a path isn't a usage we particularly want to promote. As we don't say anything about this in the manual currently, there is no need to start. > > -- > Pat
