commit 686b55e70d8c62edf29859c72b841eb69d6e7cfd
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Aug 25 18:01:26 2024 +0200

    Amend fc605cf138c
    
    Use proper option if main and a secondary language have BabelProvide 2
---
 lib/languages        |  3 ++-
 src/BufferParams.cpp | 10 +++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/languages b/lib/languages
index 868bde49de..d5ac3bd699 100644
--- a/lib/languages
+++ b/lib/languages
@@ -133,7 +133,8 @@
 #   if a corresponding language module exists.
 # * BabelProvide determines if and when a language should be loaded from
 #   babel *.ini files with babel. Possible values:
-#   0 (= never, default), 1 (always), 2 (with Unicode engines/non-TeX fonts)
+#   0 (= never, default), 1 (always), 2 (with Unicode engines/non-TeX fonts).
+#   The latter advises babel to ignore existing *.ldf files.
 # * BabelOpts are comma separated, no matter how they shall be represented
 #   in the output.
 # * BabelOptFormat specifies how the language-specific options shall be
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index f82fd1d24c..8f5dbfdcac 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -3502,6 +3502,7 @@ string BufferParams::babelCall(LaTeXFeatures const & 
features, string lang_opts,
        langs.insert(language);
        ostringstream os;
        string force_provide;
+       bool have_main_forceprovide = false;
        for (auto const & l : langs) {
                string blang = l->babel();
                bool use_opt = langoptions;
@@ -3534,12 +3535,15 @@ string BufferParams::babelCall(LaTeXFeatures const & 
features, string lang_opts,
                if (bp == 2 && useNonTeXFonts) {
                        // here we need to tell babel to use the ini
                        // even though an *.ldf exists
-                       if (l == language)
+                       if (l == language) {
                                force_provide = force_provide.empty()
                                                ? "provide=*"
                                                : "provide*=*";
-                       else
-                               force_provide = "provide+=*";
+                               have_main_forceprovide = true;
+                       } else
+                               force_provide = have_main_forceprovide
+                                               ? "provide*=*"
+                                               : "provide+=*";
                        have_mods = true;
                }
                if (bp != 1 && use_opt)
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to