From 366b319e422bbe71ab667cb89e15d69ac60e83c0 Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Fri, 11 Dec 2015 03:08:33 +0000 Subject: [PATCH] New LFUN tabular-feature: update prefs2prefs.py --- lib/scripts/prefs2prefs_lfuns.py | 29 ++++++++++++++++++++++++++++- src/LyXAction.h | 2 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/scripts/prefs2prefs_lfuns.py b/lib/scripts/prefs2prefs_lfuns.py index 99f75c36eb..ff55a61e8d 100644 --- a/lib/scripts/prefs2prefs_lfuns.py +++ b/lib/scripts/prefs2prefs_lfuns.py @@ -140,6 +140,30 @@ def tabular_feature(line): return simple_renaming(line, "tabular-feature", "inset-modify tabular") +re_tabular_feature = re.compile(r"inset-modify\s+tabular(\s+from-dialog)?") +def redo_tabular_feature(line): + # we change as follows: + # inset-modify tabular -> tabular-feature + # but: + # inset-modify tabular from-dialog -> inset-modify tabular + # + # "from-dialog" was never used directly but the user might do, if they + # followed the standard instructions to create a custom shortcut by looking + # at the message panel. The equivalent functionality is now provided by + # inset-modify tabular (without from-dialog). + def change(match): + if match.group(1): + return "inset-modify tabular" + else: + return "tabular-feature" + + result = re_tabular_feature.subn(change, line) + if result[1]: + return (True, result[0]) + else: + return no_match + + re_Bar2bar = re.compile(r'^(\\(?:bind|unbind))\s+"([^"]*)Bar"(\s+"[^"]+")') def Bar2bar(line): m = re_Bar2bar.search(line) @@ -197,7 +221,10 @@ conversions = [ view_split, label_copy_as_reference ]], - [ 3, [ # list of conversions to format 3, LyX 2.2 + [ 3, [ # list of conversions to format 3 remove_print_support + ]], + [ 4, [ # list of conversions to format 4, LyX 2.2 + redo_tabular_feature ]] ] diff --git a/src/LyXAction.h b/src/LyXAction.h index d0a7942646..bf7bf35638 100644 --- a/src/LyXAction.h +++ b/src/LyXAction.h @@ -22,7 +22,7 @@ namespace lyx { // current LFUN format -static unsigned int const LFUN_FORMAT = 3; +static unsigned int const LFUN_FORMAT = 4; // gm: tabular-feature class FuncRequest; class LyXErr; -- 2.39.2