commit 56bec528b5327eafac72f47db82999b0ad3a2eb5
Author: Enrico Forestieri <for...@lyx.org>
Date:   Mon Mar 20 14:37:25 2017 +0100

    Amend 72a488d7
    
    - Mention the new buffer parameter in development/FORMAT
    
    - Assure that lyx2lyx generates the same output obtained when saving
      a converted document from within lyx
    
    - Don't require any action when converting a document created with
      lyx 2.2 in order to assure unchanged output (thanks José for the hint)
---
 development/FORMAT     |    1 +
 lib/RELEASE-NOTES      |    5 -----
 lib/lyx2lyx/lyx_2_3.py |    9 +++++++++
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/development/FORMAT b/development/FORMAT
index 0bb7de0..cffdfd7 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -13,6 +13,7 @@ changes happened in particular if possible. A good example 
would be
          the font ligatures -- and --- when they would have been exported
          as the macros \textendash and \textemdash, unless instructed
          otherwise by a document preference.
+         - New buffer param \use_dash_ligatures {true|false}
 
 2017-02-04 Jürgen Spitzmüller <sp...@lyx.org>
        * Format incremented to 534: Support for chapterbib
diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES
index 55e2f02..9264e59 100644
--- a/lib/RELEASE-NOTES
+++ b/lib/RELEASE-NOTES
@@ -88,11 +88,6 @@
 
 !!Caveats when upgrading from earlier versions to 2.3.x
 
-* When loading documents created with LyX 2.2, you might need to check
-  "Don't use ligatures for en- and em-dashes" in Document→Settings→Fonts
-  to avoid changed output if they contain en- or em-dashes and use TeX fonts.
-  You don't need to do this for documents created with earlier versions.
-
 * If the "Use non-TeX fonts" and "Don't use ligatures for en- and em-dashes"
   document preferences are not checked, when exporting documents containing
   en- and em-dashes to the format of LyX 2.0 or earlier, the following line
diff --git a/lib/lyx2lyx/lyx_2_3.py b/lib/lyx2lyx/lyx_2_3.py
index 53eff20..09b1c63 100644
--- a/lib/lyx2lyx/lyx_2_3.py
+++ b/lib/lyx2lyx/lyx_2_3.py
@@ -1845,6 +1845,15 @@ def revert_chapterbib(document):
 def convert_dashligatures(document):
     " Remove a zero-length space (U+200B) after en- and em-dashes. "
 
+    i = find_token(document.header, "\\use_microtype", 0)
+    if i != -1:
+        if document.start == 508:
+            # This was created by LyX 2.2
+            document.header[i+1:i+1] = ["\\use_dash_ligatures false"]
+        else:
+            # This was created by LyX 2.1 or earlier
+            document.header[i+1:i+1] = ["\\use_dash_ligatures true"]
+
     i = 0
     while i < len(document.body):
         words = document.body[i].split()

Reply via email to