From 3687fff671f2ab23f53ee986f9881fb0a10c81f1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 22 Feb 2025 04:21:10 +0100 Subject: [PATCH] * admin/check-doc-strings: Reduce false positives. (cherry picked from commit 79ab873b9b679ec0aedb03ce246035d8e5d4b09c) --- admin/check-doc-strings | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/admin/check-doc-strings b/admin/check-doc-strings index b119b50885b..ced8989b2d2 100755 --- a/admin/check-doc-strings +++ b/admin/check-doc-strings @@ -256,7 +256,7 @@ while (my $file = ) { ## $maxargs \s*(\S+)\s*, ## $interactive - \s*((?:0|\"(?:(?:[^\\\"]|\\.)*)\"))\s*, + \s*((?:0|NULL|\"(?:(?:[^\\\"]|\\.)*)\"))\s*, ## $docstring \s*doc:\s*\/\*\s*(.*?)\s*\*\/ # attributes -- skip @@ -297,7 +297,7 @@ while (my $file = ) { $contents =~ s/(?:\s|;);.*//mog; my @matches = ($contents =~ - /\((def(?:un|subst|macro))\s+(\S+)\s+\(([^()]*)\)\s+\"((?:[^\\\"]|\\.)+)\"(.*?)\)/sgo); + /\((def(?:un|subst|macro)|cl-defun)\s+(\S+)\s+\(([^()]*)\)\s+\"((?:[^\\\"]|\\.)+)\"(.*?)\)/sgo); while (@matches) { my ($defform, $function, $parms, $docstring, $code_fragment) = splice (@matches, 0, 5); @@ -320,17 +320,21 @@ while (my $file = ) { my $contents = FileContents $file; $contents =~ s/(?:\s|;);.*//mog; - my @matches = ($contents =~ /^\((?:defalias|fset|define-function)\s+\'([A-Za-z0-9_-]+)\s+\'([A-Za-z0-9_-]+)/mog); + my @matches = ($contents =~ /^\((?:defalias|fset|define-function)\s+\'([A-Za-z0-9_<>=-]+)\s+[#]?\'([A-Za-z0-9_-]+)/mog); while (@matches) { my ($alias, $aliasee) = splice (@matches, 0, 2); print "alias $alias aliasee $aliasee\n"; if (exists $code_funtype{$aliasee}) { $code_funtype{$alias} = $code_funtype{$aliasee}; } + else {$code_funtype{$alias} = 1;} if (exists $code_arglist{$aliasee}) { $code_arglist{$alias} = $code_arglist{$aliasee}; } } } +# FIXME: Consider cl-defgeneric, minor and major modes. + foreach my $fun (sort keys %texi_funtype) { if (not exists $code_funtype{$fun}) { + next if $fun eq 'foo'; print "nuke-this-doc: $fun $texi_funtype{$fun}\n"; } } -- 2.39.5