This is the new(er) babel mechanism to load languages via babel *.ini
files.
Some languages (or varieties) are only supported this way, some work
better with unicode engines this way (for the latter case, we have
BabelProvide 2)
As with almost everything, this class bakes its own cake also with
multiple indexes. So we need to account for this to produce
compilable output.
Not very nice, but there you go!
When setting halfline parskip with parskip provided, we still need
to set this explicitly, as we don't know the current \parskip value.
Also improve code readability.
Instead of having to add and individually test the versions to check
for, we store the current version and test on that with a specific
function isAvailableAtLeastFrom(package, year, month, day)
Currently only used for the LaTeX version, but could also be extended
for package versions.
If the main language does not require the inputenc package, but a
secondary language does, inputenc needs to be loaded as well
(without options)
Also simplify the code a bit.
File switches with documents are done via \inputencoding.
Other than with fontenc, these do not need to be laoded via options
beforehand.
Also, out current code loaded the additional languages' encoding last,
which might result in wrong encoding settings.
When there is no module, the old code would invoke tex2lyx with option
-m
instead of
-m ""
and an error would ensue.
This is because the QProcess command line parser used in Systemcall is
broken and does not recognize empty parameters as such. The solution
is to rewrite our parsecmd() parser to generate a list of parameters.
This is post-2.4.0 work.
The workaround used here is:
- set the list of modules to "," when it should be empty. In effect,
this is a list of two empty modules.
- change tex2lyx to accept empty module names and ignore them; this is
good in terms of robustness anyway.
Additionally, when there is no receiving buffer, set the defaults as
the BufferParams defaults instead of empty (this is cleaner, but
should not make a difference in practice).
In the long term, we should switch to use the QStringList-based API of
QProcess in Systemcall (see QTBUG-80640).
This quashes a new warning in clang++ 15, when std::move() (the
one-parameter version) is used as simply move(). There is a strong
recommendation from WG21 to avoid that.
Details here: https://reviews.llvm.org/D119670
It might be that we should not use that many move()s. I am not
competent to decide on that.
I also used this occasion to get rid of a spacial casing for C++11
that does not seem necessary after all.