bug-texinfo
[Top][All Lists]
Advanced

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

Re: info: INFOPATH interpretation severely flawed


From: Eli Zaretskii
Subject: Re: info: INFOPATH interpretation severely flawed
Date: Mon, 07 May 2012 00:09:46 +0300

> From: Bruno Haible <address@hidden>
> Cc: address@hidden
> Date: Sun, 06 May 2012 22:56:02 +0200
> 
> Eli Zaretskii wrote:
> > it's a flaw in the basic design of the Info system: it doesn't
> > cope well, to say the least, with several versions of the same manual
> > that are accessible from the same Info session.
> 
> OK, now where to put the improvement/fix?
> 
> Inside 'install-info', it's too early to detect "conflicts", because
> $INFOPATH is not known at that time.

But 'install-info' could add to 'dir' the full absolute file name of
the file it is installing.  Then the value of INFOPATH doesn't
matter.  The only drawback is that you need to re-run 'install-info'
if you ever move the whole tree somewhere else.

> The solution I'm seeing is to apply this variation:
> 
>   dir_buffer = ""
>   dir_buffer_regions = {}
>   for directory in $INFOPATH
>     dir_buffer += contents of $directory/dir
>     dir_buffer_regions += (start offset of this contents in $dir_buffer,
>                            end offset of this contents in $dir_buffer,
>                            $directory)
>   done

This will probably work (although I'd need to refresh my memory of how
the stand-alone Info does all this in details), but a more
sophisticated reader in Emacs might thwart this, because it takes the
liberty to rearrange the entries (I think).  There, you'd need to
store the information in some other way (like some text property or
something).

> In this way,
>   - while creating the dir_buffer, you don't need to make more file
>     accesses; just store the associated directory in the dir_buffer_regions
>     (list of triples),
>   - while looking up the info file for the given menu item, you don't
>     need to make more file accesses either; just look in the directory
>     where the specific region of the dir_buffer came from first, and in
>     the remaining elements of $INFOPATH afterwards.

OK, but still asking Info for the manual of FOO version X.Y is not
possible, if all the versions of FOO have the same entries in their
'dir' files.



reply via email to

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