On Tue, Sep 13, 2022 at 08:14:48PM -0400, Stefan Monnier wrote: > > There's something I don't understand about @include: > > Say, I have: > > doc/foo.texi > doc/gpl.texi > bar.texi > > if my `foo.texi` has > > @include gpl.texi > @include ../bar.texi > > I will be able to use successfully both > > cd doc; makeinfo --no-split foo.texi -o ../foo.info > > will work fine, but > > makeinfo --no-split doc/foo.texi -o foo.info > > will signal an error that it can't find `../bar.texi` > (note: it *did* find `gpl.texi`). > > Why are the two includes treated differently?
It is because includes with leading . or .. in their paths in or include that are absolute paths are treated differently from other includes: they are not searched for in include directories. Also, when you call makeinfo --no-split doc/foo.texi -o foo.info the doc/ directory is included in the @include search path in addition to the current directory, therefore gpl.texi is found. The ../bar.texi include file is still only searched for relative to the working directory. Unless I missed something, none of these two information is documented. > How can I convince `makeinfo` to find the `bar.texi` file in both cases? Right now, I can't think of a way to make this happen. The only thing I can think of would be to change the code to consider that only paths with leading . are considered differently. -- Pat