texlive[73408] Build/source/texk/web2c/cwebdir/ctwill-proofsort:

commits+ascherer at tug.org commits+ascherer at tug.org
Sat Jan 11 12:42:54 CET 2025


Revision: 73408
          https://tug.org/svn/texlive?view=revision&revision=73408
Author:   ascherer
Date:     2025-01-11 12:42:54 +0100 (Sat, 11 Jan 2025)
Log Message:
-----------
[CTWILL] Fix the sorting order of double entries.

In section MMIX-PIPE{U+00A7}197, both 'p' and 'q' have multiple definitions,
one differing by the 'meaning', the other differing by section number.
While the identifiers get sorted as '$key's in the first place (I),
columns three (meaning) and one (location) have to be taken into account
to make ends meet (II).

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort

Modified: trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort
===================================================================
--- trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort	2025-01-11 10:32:07 UTC (rev 73407)
+++ trunk/Build/source/texk/web2c/cwebdir/ctwill-proofsort	2025-01-11 11:42:54 UTC (rev 73408)
@@ -61,17 +61,18 @@
 		$print_index = 1;
 		%mini_index = (); # reset mini-index storage
 	} elsif ("}\\FI\n" eq $line) { # end of mini-index
-		foreach my $key ($collator ?
+		foreach my $key ($collator ?  # (I) sort by second column
 			$collator->sort(keys %mini_index) :
 			sort {"\L$a" cmp "\L$b"} keys %mini_index) {
-			print join "\n", @{ $mini_index{$key} };
+			print sort { # (II) sort by third and first column
+				my ($a_loc,undef,$a_id) = split / /, $a, 3;
+				my ($b_loc,undef,$b_id) = split / /, $b, 3;
+				$a_id cmp $b_id || $a_loc cmp $b_loc }
+			@{ $mini_index{$key} };
 		}
 		$print_index = 0;
 	} elsif ($print_index) { # mini-index entry
-		my (undef,$key,$type) = split / /, $line,3;
-		# 1st column is the section number (internal or external)
-		# 2nd column is the identifier
-		# the rest is the type of the identifier
+		my (undef,$key) = split / /, $line; # 2nd column is the key
 		$key =~ s/\\//g; # strip internal TeX escape(s)
 		$key =~ m/\w*\{(\w+)\}/; # extract plain key from control seq.
 		$key =~ m/\$(\w+)\$/ unless defined $1; # extract @f TeX key



More information about the tex-live-commits mailing list.