latex3 / lua-uni-algos

Unicode algorithms for use by LuaLaTeX packages
2 stars 4 forks source link

Always explicitly load the `kpse` module #4

Open Witiko opened 1 year ago

Witiko commented 1 year ago

Closes #3. Compared to the workaround given in #3, this solution is automatic for the user and does not require setting a kpse global.

zauguin commented 1 year ago

First of all we can't call kpse.set_program_name unconditionally without breaking kpse for other usecases since it resets the program name.

Beside that it feels like working around a conscious decision of ConTeXt. IMO doing something like local kpse = kpse or require'kpse' would make sense since this could deal with the case that kpse isn't loaded, but here the existing kpse library is explicitly hidden and overwritten with a stub. That ConTeXt decided not just not to use kpathsea but to actively hide it indicates to me that it shouldn't be used in that context. Does anyone know if the library still being available though require is an intended feature of ConTeXt or if it was just forgotten to disable it there?

Witiko commented 1 year ago

Here is my understanding: ConTeXt is commonly distributed as a part of the ConTeXt Standalone distribution, which does not contain either kpathsea or other parts of TeX Live. If you need kpsewhich in TeX Live, you can explicitly require it but it is unnecessary for the working of ConTeXt.

Witiko commented 1 year ago

However, I tend to agree that the responsibility for loading kpathsea in ConTeXt should perhaps fall on the shoulders of users, seeing how it affects the global state. Therefore, you may want to close both this pull request and #3 as a wontfix.