[LyX/master] Increment preferences format to 34: rename Cyrillic *.kmap files

Juergen Spitzmueller spitz at lyx.org
Thu Sep 17 12:41:40 UTC 2020


commit cd933534bda9f1b2d991321566ff65219145e883
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Thu Sep 17 15:32:43 2020 +0300

    Increment preferences format to 34: rename Cyrillic *.kmap files
---
 lib/configure.py                 |    2 +-
 lib/scripts/prefs2prefs_prefs.py |   15 ++++++++++++++-
 src/LyXRC.cpp                    |    2 +-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/lib/configure.py b/lib/configure.py
index 1547000..9f3c032 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -1876,7 +1876,7 @@ if __name__ == '__main__':
     lyx_check_config = True
     lyx_kpsewhich = True
     outfile = 'lyxrc.defaults'
-    lyxrc_fileformat = 33
+    lyxrc_fileformat = 34
     rc_entries = ''
     lyx_keep_temps = False
     version_suffix = ''
diff --git a/lib/scripts/prefs2prefs_prefs.py b/lib/scripts/prefs2prefs_prefs.py
index 322990a..598c06b 100644
--- a/lib/scripts/prefs2prefs_prefs.py
+++ b/lib/scripts/prefs2prefs_prefs.py
@@ -134,6 +134,8 @@
 #   and \citation_search_view.
 #   No conversion necessary.
 
+# Incremented to format 34, by yuriy
+#   Rename *.kmap files for Cyrillic languages
 
 # NOTE: The format should also be updated in LYXRC.cpp and
 # in configure.py.
@@ -439,6 +441,16 @@ def remove_use_pixmap_cache(line):
 		return no_match
 	return (True, "")
 
+def rename_cyrillic_kmap_files(line):
+	line = line.lower()
+	if not (line.startswith("\\kbmap_primary ")
+			or line.startswith("\\kbmap_secondary ")):
+		return no_match
+	line = line.replace('"bg-bds-1251"', '"bulgarian"')
+	line = line.replace('"koi8-r"', '"russian"')
+	line = line.replace('"koi8-u"', '"ukrainian"')
+	return (True, line)
+
 # End conversions for LyX 2.3 to 2.4
 ####################################
 
@@ -486,5 +498,6 @@ conversions = [
 	[ 30, []],
 	[ 31, []],
 	[ 32, []],
-	[ 33, []]
+	[ 33, []],
+	[ 34, [rename_cyrillic_kmap_files]]
 ]
diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 323881d..59bdc70 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -65,7 +65,7 @@ namespace {
 
 // The format should also be updated in configure.py, and conversion code
 // should be added to prefs2prefs_prefs.py.
-static unsigned int const LYXRC_FILEFORMAT = 33; // sanda: add \citation_search_view
+static unsigned int const LYXRC_FILEFORMAT = 34; // yuriy: rename kmap files
 // when adding something to this array keep it sorted!
 LexerKeyword lyxrcTags[] = {
 	{ "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },


More information about the lyx-cvs mailing list