[tex-live] texdoc in luatex

David Kastrup dak at gnu.org
Sun Jul 22 12:18:33 CEST 2007


Frank Küster <frank at kuesterei.ch> writes:

> [...]
>> Personally, I'd prefer something like (don't know the expressions,
>> though):
>>
>> "([a-zA-Z]:)?[^:;]*"
>> for matching purposes, independent of platform.  It will mean that
>> under Unix, single-character relative directory specs will have to be
>> preceded with "./" in order to be recognized correctly.  And it will
>> disallow using either : or ; within paths itself (except for a
>> directory spec).
>
> I'm not sure we understand each other (and wheter I always said
> sensible things in the past, don't have that old mails any more).
>
> This string.gmatch with : and/or ; is only used twice in texdoclua,
> and that is when iterating over the contents of a list returned by
> kpathsea when looking up variables.  At a first approximation,
> there's no drive letters involved, just lists of paths (or
> extensions, in the case of TEXDOCEXT) from texmf.cnf.
>
> So the right handling depends on the path separators used.

Which is a dependency I want to avoid, at the cost of not handling
some quite academical cases properly on on one of the systems (of
course, which cases are not handled properly is different on each
system).

> On my Linux system,
>
>  kpsewhich --expand-braces '$TEXDOCS'
>
> results in a list with `:' as the separator.  Of course if I split the
> list at this character, drive specifiers on Windows will be split of,
> too - that's the problem.
>
> To find a clean solution, I think I need to know whether the
> separators are consistent among systems: If it's always `:' on
> Unix-likes and always `;' on Windowsen, then I don't see the need
> for "complicated" regexes, we just split at the unique,
> system-dependent separator.

The problem with that is

a) that every single program must know and deal with the right
separators.  This is enfuriatingly hard to do.  We have to do this in
AUCTeX, and it is a fragile piece of ****.  If kpathsea used my
heuristics, it would not matter what separator I pick.

b) Cygwin.  Windows system, : separator.  If you use the Cygwin TeX.
If not, ; separator.

> Only if the separator is not that predictable, then do we need to do
> the ([a-zA-Z]:)? magic.

Well, you can ask kpathsea about the separator being used.  That
should in most cases work and put you off the hook.  And what puts you
_completely_ off the hook, of course, it to just let kpathsea parse
your paths.

It would not make sense for luatexdoc to do anything that kpathsea
does not do.  The place where such a change should end up is kpathsea,
and working on it somewhere else is a waste of time.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


More information about the tex-live mailing list