On 2016-01-04, Kornel Benko wrote:
> Am 4. Januar 2016 um 17:51:29, schrieb Guenter Milde <mi...@users.sf.net>
>> On 2016-01-04, Kornel Benko wrote:
>> > Am 4. Januar 2016 um 08:57:04, schrieb Scott Kostyshak <skost...@lyx.org>
>> >> On Sun, Jan 03, 2016 at 10:36:09PM +0000, Guenter Milde wrote:
>> >> > On 2016-01-03, Scott Kostyshak wrote:

>> >> > > If you are OK with these other test failures and you think it
>> >> > > is the right thing to do, then correct the test labels such
>> >> > > that there shouldn't be any differences to test failures after
>> >> > > your patch is applied. Post a new patch and I will confirm that
>> >> > > nothing changes.

...

>> > Günter, could you resend the patch (this time attached and not inline)?

>> I'll to so but I don't know whether this works with the GMANE-news interface.

> Apparently it does not work.

>> (OTOH, inlined patches can easily be applied by saving the complete mail and 
>> doing `git am -3 <patch.mbox>`.)

> I am not convinced that the mail-text is not corrupted in some way
> (e.g. long lines split ...).

Usually, this kind of corruption is done in the mail reader, not during
transport. git should detect such a corruption when applying the patch.
Non-ASCII could be a problem with some mail readers or providers...


> Is the patch made with 'git am ' committed, or only applied?

Commited. However, "git apply" will also work with an inline patch if passed
the saved message in mbox format (as does the standard "patch" command).

  git-apply pplies the patch but does not create a commit. Use git-am
  to create commits from patches generated by git-format-patch and/or
  received by email.
  
  -- http://git-scm.com/docs/git-apply


> How to revert?

After a commit, e.g. 

 #> git rebase -i HEAD^^
 (delete the line with the commit that should be reverted) 

Or apply to a branch and after testing throw away the branch.

Günter


>From 30b0e71be55a9a4b8cd5554bf00894dd305c3b8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnter=20Milde?= <mi...@lyx.org>
Date: Sun, 3 Jan 2016 23:28:08 +0100
Subject: [PATCH] Use polyglossia also with DVI (LuaTeX).

Simplify the logic for language package selection and make it more consistent:

Use polyglossia with non-TeX fonts (system fonts/Unicode fonts) for all
export flavours (XeTeX, LuaTeX, DVI-LuaTeX), if the language package setting
is "auto" and there is no language not supported by Babel and no package
providing Babel.

This solves some Babel-related autotest cases and leads to some new failures
due to the polyglossia language nesting problem.
---
 development/autotests/suspiciousTests | 47 ++++++++---------------------------
 development/autotests/unreliableTests |  2 +-
 src/BufferParams.cpp                  |  7 ++----
 src/LaTeXFeatures.cpp                 |  4 +--
 4 files changed, 16 insertions(+), 44 deletions(-)

diff --git a/development/autotests/suspiciousTests 
b/development/autotests/suspiciousTests
index 6ddf611..3640faa 100644
--- a/development/autotests/suspiciousTests
+++ b/development/autotests/suspiciousTests
@@ -61,8 +61,8 @@ export/doc/(es|fr)/UserGuide_pdf4_texF
 export/examples/uk/splash_(dvi3|pdf[45])_texF
 
 # missing commands (polyglossia?)
-# Explore! (works with dvi3 or language_package==babel)
-export/doc/fr/UserGuide_pdf[45]_systemF
+# Explore! (works with language_package==babel)
+export/doc/fr/UserGuide_.*_systemF
 
 # Bug in Babel-Spanish with Xe/LuaTeX and Unicode fonts:
 #
@@ -71,21 +71,11 @@ export/doc/fr/UserGuide_pdf[45]_systemF
 # Workaround: add a line to the user-preamble
 #   \@ifpackageloaded{fontspec}{\unaccentedoperators}{}
 export/doc/es/UserGuide_.*_systemF
-#
-# Export with DVI (luatex) uses Babel instead of Polyglossia.
-# Don't use the above workaround here - these documents don't require Babel
-# problem should be solved by fixing auto-selection of language package.
-export/examples/es/ejemplo_con_lyx_dvi3_systemF
-# Galician shares some code with Babel-Spanish (including the bug).
-export/doc/gl/Tutorial_dvi3_systemF
-export/examples/gl/exemplo_lyxificado_dvi3_systemF
-# document language is Spanish: changing to Basque solves the problem
-export/examples/eu/adibide_lyx-atua_dvi3_systemF
 
 # Missing characters (U+0361, U+1E61) in LM,
 # set different system font in the source?
 # + language nesting problem (may disappear after completed translation)
-export/doc/(de/|es/|fr/)Customization_pdf[45]_systemF
+export/doc/(de/|es/|fr/)Customization_.*_systemF
 
 # Probably language mess
 export/export/ja/wrong_auto_encoding_(dvi|pdf(|3))
@@ -99,14 +89,6 @@ export/export/ja/wrong_auto_encoding_(dvi|pdf(|3))
 # \c e -> 0229 LATIN SMALL LETTER E WITH CEDILLA
 export/doc/(|de/|es/|fr/)Math.*systemF
 
-# 1.) Unknown Japanese char in section if previous
-#     paragraph ended in non-Japaneese language
-#     This is the same error as in export/export/ja/wrong_auto_encoding 
(unreliableTests)
-# 2.) unknown chars üß in selected encoding in 'This is a German word: Tschüß'
-#
-# Both reasons invalid since the commit 
6b0632eea288348b912f98b79bc871830b6a3d98
-#export/doc/ja/EmbeddedObjects_(dvi|pdf|pdf3)
-
 # missing character: There is no ^^A in font [lmroman12-regular]
 # and all the line down to ^^Z and beyond...
 # XeTeX artifact? works with LuaTeX, explore:
@@ -118,9 +100,9 @@ Sublabel: lyxbugs
 # LyX bugs with a Trac number.
 
 # Language nesting and polyglossia #9633
-export/doc/(nb|sk)/Intro_pdf[45]_systemF
+export/doc/(nb|sk)/Intro.*systemF
 # missing characters + language nesting (may disappear after completed 
translation)
-export/doc/(de/|es/|fr/)Customization_pdf[45]_systemF
+export/doc/(de/|es/|fr/)Customization_.*_systemF
 #
 # Language nesting, document is OK, fails because of a bug in LyX
 # document is still worng, did only fail because of latin language
@@ -129,16 +111,14 @@ export/doc/(de/|es/|fr/)Customization_pdf[45]_systemF
 
 
 # use LuaTeX-compatible language names #9910
-# Wrong language name for LuaTeX
+# Wrong language name for LuaTeX (with Babel, no error with Polyglossia)
 # After LyX 2.1 is released, apply the patch and remove these
 # See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg181595.html
 # ! LuaTeX error 
...e/2015/texmf-dist/tex/luatex/hyph-utf8/luatex-hyphen.lua:53: luatex-hyphen: 
no entry in language.dat.lua for this language: bahasa
 export/doc/attic/id_UserGuide_dvi3.*
 export/doc/attic/id_UserGuide_pdf5.*
-export/(doc|examples)/id/.*_dvi3.*
-export/(doc|examples)/id/.*_pdf5_texF
-export/.*/hu/.*(dvi3)_.*
-export/.*/hu/.*(pdf5)_texF
+export/(doc|examples)/id/.*_(dvi3|pdf5)_texF
+export/.*/hu/.*(dvi3|pdf5)_texF
 
 # documents requiring pre-processing fail with Japanese #8823
 export/examples/ja/(knitr|lilypond|sweave)_(dvi|pdf3?)
@@ -196,12 +176,6 @@ export/.*/he/.*pdf4_texF
 export/doc/ru/(Intro|Tutorial)_(dvi3|pdf[45])_texF
 export/examples/ru/splash_(dvi3|pdf[45])_texF
 
-# dvi3 uses Babel. Autostrings use Cyrillic LICRs,
-# however these are missing in xunicode.sty. 2 solutions:
-#  LuX: use polyglossia also with dvi3 (LuaTeX) and non-TeX fonts,
-#  LaTeX: define Cyrillic LICRs for EU1 and EU2 (similar to greek-euenc.def)
-export/doc/uk/Intro_dvi3_systemF
-
 # LuaTeX fails for an \textbackslash{}mbox in an index, e.g. $a_{\mbox{a}}$
 # This construct appears in the included bib file biblioExample.bib in
 # the entry Eisenstein2005. Error message is
@@ -216,7 +190,8 @@ export/examples/instant_preview_pdf[25].*
 # Gives the following error:
 # # ! Package hpstatement Error: H or P statement "H251"
 # # (hpstatement)                is not defined.
-export/examples/H-P-statements_pdf[45]_systemF
+# seems to be polyglossia-related (dvi3 worked with babel)
+export/examples/H-P-statements_.*_systemF
 
 
 Sublabel: multilingual
@@ -225,7 +200,7 @@ Sublabel: multilingual
 # No problem with inserted German (or other foreign language) text
 # No problem if the table is Slovak too
 # Seems to be a problem with Check and Slovak Babel support. File a bug there.
-export/export/TableErrorIfSlovakTextInserted_(dvi|pdf|pdf[23]|pdf[45]_texF|dvi3_.*F)
+export/export/TableErrorIfSlovakTextInserted_(dvi|pdf|pdf[23]|pdf[45]_texF|dvi3_systemF)
 
 
 Sublabel: attic
diff --git a/development/autotests/unreliableTests 
b/development/autotests/unreliableTests
index 4932822..a5c6154 100644
--- a/development/autotests/unreliableTests
+++ b/development/autotests/unreliableTests
@@ -13,7 +13,7 @@ Sublabel: nonstandard
 export/templates/IUCr-article_(dvi|pdf).*
 
export/templates/ja_beamer-conference-ornate-20min_(pdf2|pdf[45]_(texF|systemF))
 
export/templates/es_beamer-conference-ornate-20min_(pdf2|pdf[45]_(texF|systemF))
-export/templates/kluwer_pdf[45]_systemF
+export/templates/kluwer_.*_systemF
 export/examples/modernCV_pdf4_(tex|system)F
 export/templates/ectaart_(dvi3|pdf5)_(tex|system)F
 
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index e3121c7..fe47c05 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1399,11 +1399,8 @@ void BufferParams::validate(LaTeXFeatures & features) 
const
        }
 
        // some languages are only available via polyglossia
-       if ((features.runparams().flavor == OutputParams::XETEX
-            || features.runparams().flavor == OutputParams::LUATEX)
-           && (features.hasPolyglossiaExclusiveLanguages()
-               || useNonTeXFonts))
-               features.require("polyglossia");
+       if (features.hasPolyglossiaExclusiveLanguages())
+          features.require("polyglossia");
 
        if (useNonTeXFonts && fontsMath() != "auto")
                features.require("unicode-math");
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index feab837..a69fd59 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -382,14 +382,14 @@ LaTeXFeatures::LangPackage LaTeXFeatures::langPackage() 
const
        if (local_lp == "none")
                return LANG_PACK_NONE;
 
-       /* If "auto" is selected, we load polyglossia if required,
+       /* If "auto" is selected, we load polyglossia with non-TeX fonts,
         * else we select babel.
         * If babel is selected (either directly or via the "auto"
         * mechanism), we really do only require it if we have
         * a language that needs it.
         */
        bool const polyglossia_required =
-               isRequired("polyglossia")
+               params_.useNonTeXFonts
                && isAvailable("polyglossia")
                && !isProvided("babel")
                && this->hasOnlyPolyglossiaLanguages();
-- 
2.5.1


Reply via email to