[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 4 Feb 2024 12:38:18 -0500 (EST) |
branch: master
commit 62fbcd226eddd16460323a9c029c5fe6dc178ae3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Feb 4 16:55:53 2024 +0100
* Texinfo/Convert/NodeNameNormalization.pm (_convert): rename $command
as $cmdname and use it more through the code.
---
ChangeLog | 5 +++++
tp/Texinfo/Convert/NodeNameNormalization.pm | 21 ++++++++++-----------
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9dcdb3a0e5..50d2681e39 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-02-04 Patrice Dumas <pertusus@free.fr>
+
+ * Texinfo/Convert/NodeNameNormalization.pm (_convert): rename $command
+ as $cmdname and use it more through the code.
+
2024-02-04 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Indices.pm (setup_sortable_index_entries),
diff --git a/tp/Texinfo/Convert/NodeNameNormalization.pm
b/tp/Texinfo/Convert/NodeNameNormalization.pm
index d61e25ad37..ad7df8d15a 100644
--- a/tp/Texinfo/Convert/NodeNameNormalization.pm
+++ b/tp/Texinfo/Convert/NodeNameNormalization.pm
@@ -271,18 +271,18 @@ sub _convert($)
$result =~ s/\s+/ /g;
}
if ($element->{'cmdname'}) {
- my $command = $element->{'cmdname'};
- if (defined($normalize_node_nobrace_symbol_text{$element->{'cmdname'}})) {
- return $normalize_node_nobrace_symbol_text{$element->{'cmdname'}};
- } elsif
(defined($normalize_node_brace_no_arg_commands{$element->{'cmdname'}})) {
- $command = $element->{'extra'}->{'clickstyle'}
+ my $cmdname = $element->{'cmdname'};
+ if (defined($normalize_node_nobrace_symbol_text{$cmdname})) {
+ return $normalize_node_nobrace_symbol_text{$cmdname};
+ } elsif (defined($normalize_node_brace_no_arg_commands{$cmdname})) {
+ $cmdname = $element->{'extra'}->{'clickstyle'}
if ($element->{'extra'}
and defined($element->{'extra'}->{'clickstyle'})
and
defined($normalize_node_brace_no_arg_commands{$element->{'extra'}->{'clickstyle'}}));
- my $result = $normalize_node_brace_no_arg_commands{$command};
+ my $result = $normalize_node_brace_no_arg_commands{$cmdname};
return $result;
# commands with braces
- } elsif ($accent_commands{$element->{'cmdname'}}) {
+ } elsif ($accent_commands{$cmdname}) {
return '' if (!$element->{'args'});
my $accent_text = _convert($element->{'args'}->[0]);
my $accented_char
@@ -294,10 +294,9 @@ sub _convert($)
$accented_char = $accent_text;
}
return $accented_char;
- } elsif ($Texinfo::Commands::ref_commands{$element->{'cmdname'}}) {
+ } elsif ($Texinfo::Commands::ref_commands{$cmdname}) {
my @args_try_order;
- if ($element->{'cmdname'} eq 'inforef'
- or $element->{'cmdname'} eq 'link') {
+ if ($cmdname eq 'inforef' or $cmdname eq 'link') {
@args_try_order = (0, 1, 2);
} else {
@args_try_order = (0, 1, 2, 4, 3);
@@ -314,7 +313,7 @@ sub _convert($)
} elsif ($element->{'args'} and $element->{'args'}->[0]
and (($element->{'args'}->[0]->{'type'}
and $element->{'args'}->[0]->{'type'} eq 'brace_command_arg')
- or $element->{'cmdname'} eq 'math')) {
+ or $cmdname eq 'math')) {
return _convert($element->{'args'}->[0]);
}
}