Greetings!

The following patch is a minor enhancement to scm2scm which will allow it
to fix references to gimp-image-*-undo.

Cheers!

Kevin.  (http://www.interlog.com/~kcozens/)

Internet:kcozens at interlog.com   |"What are we going to do today, Borg?"
      or:ve3syb at rac.ca          |"Same thing we always do, Pinkutus:
Packet:ve3syb@va3bbs.#scon.on.ca.na|  Try to assimilate the world!"
#include <disclaimer/favourite>    |              -Pinkutus & the Borg
--- scm2scm.orig        Thu Dec  9 22:25:42 1999
+++ scm2scm     Fri Dec 10 05:59:49 1999
@@ -73,6 +73,15 @@
 
 =cut
 
+# Fixes names of functions by swapping last two parts of the name
+# eg. gimp-image-disable-undo becomes gimp-image-undo-disable
+# Whitespace is preserved(!)
+sub fix_up_name {
+  my($a,$f,$t1,$t2,@t)=@_;
+  $f->[1] =~ s/(\w+)-(\w+)-(\w+)-(\w+)/$1-$2-$4-$3/;
+  ($a,$f,new token($t1->[0],$t1->[1],$t2->[1]),@t);
+}
+
 # drop the first argument, while preserving correct whitespace(!)
 sub drop_1st {
   my($a,$f,$t1,$t2,@t)=@_;
@@ -104,6 +113,10 @@
         "gimp-rotate|gimp-scale|gimp-selection-float|gimp-selection-layer-alpha|".
         "gimp-selection-load|gimp-shear|gimp-threshold)\$",
         \&drop_1st
+      ],
+      [
+        "^(gimp-image-disable-undo|gimp-image-enable-undo)\$",
+        \&fix_up_name
       ]],
    'api2' => [[
       ]],

Reply via email to