ob-exp: Tiny refactoring
[org-mode/org-tableheadings.git] / mk / fake_change_log.pl
blob6ed3bc27311f1a4dfdfb9b450080a32989f8e074
1 #!/usr/bin/perl
3 $file1 = shift;
4 $file2 = shift;
6 open file1,"<$file1" or die;
7 while (<file1>) {
8 if (m/^\s*\((defun|defsubst|defmacro|defcustom|defgroup|defface|defvar|defconst)\s+([-a-zA-Z0-9]+)/) {
9 if ($1 eq "defun") {
10 $fun1{$2}++;
11 } elsif ($1 eq "defsubst") {
12 $subst1{$2}++;
13 } elsif ($1 eq "defmacro") {
14 $macro1{$2}++;
15 } elsif ($1 eq "defgroup") {
16 $group1{$2}++;
17 } elsif ($1 eq "defcustom") {
18 $custom1{$2}++;
19 } elsif ($1 eq "defface") {
20 $face1{$2}++;
21 } elsif ($1 eq "defvar") {
22 $var1{$2}++;
23 } elsif ($1 eq "defconst") {
24 $const1{$2}++;
28 close file1;
30 open file2,"<$file2" or die;
31 while (<file2>) {
32 if (m/^\s*\((defun|defsubst|defmacro|defcustom|defgroup|defface|defvar|defconst)\s+([-a-zA-Z0-9]+)/) {
33 if ($1 eq "defun") {
34 $fun2{$2}++;
35 } elsif ($1 eq "defsubst") {
36 $subst2{$2}++;
37 } elsif ($1 eq "defmacro") {
38 $macro2{$2}++;
39 } elsif ($1 eq "defgroup") {
40 $group2{$2}++;
41 } elsif ($1 eq "defcustom") {
42 $custom2{$2}++;
43 } elsif ($1 eq "defface") {
44 $face2{$2}++;
45 } elsif ($1 eq "defvar") {
46 $var2{$2}++;
47 } elsif ($1 eq "defconst") {
48 $const2{$2}++;
52 close file2;
54 foreach $type ("fun","subst","macro","group","custom","face","var","const") {
55 $cmd1 = '%n1 = %' . $type . "1;";
56 $cmd2 = '%n2 = %' . $type . "2;";
57 eval $cmd1;
58 eval $cmd2;
60 print "$type added:\n";
61 foreach (keys %n2) {
62 unless (defined $n1{$_}) {
63 print " $_\n";
66 print "$type removed:\n";
67 foreach (keys %n1) {
68 unless (defined $n2{$_}) {
69 print " $_\n";