]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/prefs2prefs_lfuns.py
Create Chapter 6 Bullets in Additional.lyx and move the bullet section into it; this...
[lyx.git] / lib / scripts / prefs2prefs_lfuns.py
index ec65f97925d8ebd69babbb45ab67a07845d47ff6..a3416a0e52d67eb722c7e5c8928968e2a28e2160 100644 (file)
@@ -4,7 +4,7 @@
 # This file is part of LyX, the document processor.
 # Licence details can be found in the file COPYING.
 
-# author Richard Heck
+# author Richard Kimberly Heck
 
 # Full author contact details are available in file CREDITS
 
@@ -221,6 +221,27 @@ def remove_date_insert(line):
        return simple_remove(line, "date-insert")
 
 
+re_delete_force = re.compile(r"((char|word)-delete-(for|back)ward)(\s+force)?")
+def delete_force(line):
+       # we change as follows:
+       # char-delete-forward -> char-delete-forward confirm
+       # but:
+       # char-delete-forward force -> char-delete-forward
+       #
+       def change(match):
+               if match.group(4):
+                       return match.group(1)
+               else:
+                       return match.group(1) + " confirm"
+
+       result = re_delete_force.subn(change, line)
+       if result[1]:
+               return (True, result[0])
+       else:
+               return no_match
+
+
+
 #
 ###########################################################
 
@@ -258,6 +279,7 @@ conversions = [
                info_rename_vcstime,
                info_rename_vcsrevision,
                info_rename_vcstreerevision,
-               remove_date_insert
+               remove_date_insert,
+                delete_force
        ]]
 ]