[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Gather @seealso and @seeentry index entries with
From: |
Patrice Dumas |
Subject: |
branch master updated: Gather @seealso and @seeentry index entries with other entries |
Date: |
Thu, 29 Sep 2022 12:19:47 -0400 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new d3081a0853 Gather @seealso and @seeentry index entries with other
entries
d3081a0853 is described below
commit d3081a08535abd12e01fe1a11006ae650504b96e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Sep 29 18:19:34 2022 +0200
Gather @seealso and @seeentry index entries with other entries
* tp/Texinfo/ParserNonXS.pm (_enter_index_entry),
tp/Texinfo/XS/parsetexi/api.c (build_single_index_data),
tp/Texinfo/Convert/HTML.pm (_convert_printindex_command)
(_prepare_index_entries, output_internal_links),
tp/Texinfo/Convert/Plaintext.pm (process_printindex),
tp/init/chm.pm: keep index entries with @seealso or @seeentry
with other index entries in 'index_names' index 'index_entries'.
Ignore these index entries, if needed, in converters.
* tp/Texinfo/Convert/Plaintext.pm (process_printindex): do not
output the index header if all the index entries are ignored.
---
ChangeLog | 16 +++++
tp/Texinfo/Convert/HTML.pm | 16 +++++
tp/Texinfo/Convert/Plaintext.pm | 37 ++++++-----
tp/Texinfo/ParserNonXS.pm | 10 +--
tp/Texinfo/XS/parsetexi/api.c | 10 +--
tp/init/chm.pm | 4 ++
tp/t/results/indices/double_seeentry_seealso.pl | 73 ++++++++++++++++++++--
.../multiple_index_text_sortas_seeentry_seealso.pl | 10 ++-
.../indices/printindex_index_entry_in_copying.pl | 8 +--
...rintindex_index_entry_in_copying_in_footnote.pl | 23 ++-----
...ndex_index_entry_in_copying_no_insertcopying.pl | 15 +----
tp/t/results/indices/same_only_seealso_seeentry.pl | 31 +++++++--
tp/t/results/indices/same_seealso_seeentry.pl | 24 +++++--
tp/t/results/indices/seeentry.pl | 33 +++++++---
.../res_parser/formatting_docbook/formatting.xml | 6 +-
.../res_parser/formatting_latex/formatting.tex | 6 +-
.../res_parser/formatting_xml/formatting.xml | 24 +++----
17 files changed, 234 insertions(+), 112 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c186b354ff..e945e32957 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2022-09-29 Patrice Dumas <pertusus@free.fr>
+
+ Gather @seealso and @seeentry index entries with other entries
+
+ * tp/Texinfo/ParserNonXS.pm (_enter_index_entry),
+ tp/Texinfo/XS/parsetexi/api.c (build_single_index_data),
+ tp/Texinfo/Convert/HTML.pm (_convert_printindex_command)
+ (_prepare_index_entries, output_internal_links),
+ tp/Texinfo/Convert/Plaintext.pm (process_printindex),
+ tp/init/chm.pm: keep index entries with @seealso or @seeentry
+ with other index entries in 'index_names' index 'index_entries'.
+ Ignore these index entries, if needed, in converters.
+
+ * tp/Texinfo/Convert/Plaintext.pm (process_printindex): do not
+ output the index header if all the index entries are ignored.
+
2022-09-29 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/ParserNonXS.pm (_enter_index_entry),
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index d25c805498..073d2fe17a 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -5051,6 +5051,10 @@ sub _convert_printindex_command($$$$)
my $entries_text = '';
my $entry_nr = -1;
foreach my $index_entry_ref (@{$letter_entry->{'entries'}}) {
+ # FIXME format instead of ignoring
+ next if ($index_entry_ref->{'entry_element'}->{'extra'}
+ and
($index_entry_ref->{'entry_element'}->{'extra'}->{'seeentry'}
+ or
$index_entry_ref->{'entry_element'}->{'extra'}->{'seealso'}));
$entry_nr++;
# to avoid double error messages set ignore_notice if an entry was
# already formatted once, for example if there are multiple printindex.
@@ -5148,6 +5152,10 @@ sub _convert_printindex_command($$$$)
}
}
+ if (scalar(@non_alpha) + scalar(@alpha) == 0) {
+ return '';
+ }
+
my $non_breaking_space = $self->get_info('non_breaking_space');
# Format the summary letters
@@ -8155,6 +8163,10 @@ sub _prepare_index_entries($)
foreach my $index_name (sort(keys(%$index_names))) {
foreach my $index_entry
(@{$index_names->{$index_name}->{'index_entries'}}) {
+ # does not refer to the document
+ next if ($index_entry->{'entry_element'}->{'extra'}
+ and ($index_entry->{'entry_element'}->{'extra'}->{'seeentry'}
+ or
$index_entry->{'entry_element'}->{'extra'}->{'seealso'}));
my $region = '';
$region = "$index_entry->{'entry_region'}->{'cmdname'}-"
if (defined($index_entry->{'entry_region'}));
@@ -9343,6 +9355,10 @@ sub output_internal_links($)
foreach my $index_name (sort(keys (%{$index_entries_by_letter}))) {
foreach my $letter_entry (@{$index_entries_by_letter->{$index_name}}) {
foreach my $index_entry (@{$letter_entry->{'entries'}}) {
+ # does not refer to the document
+ next if ($index_entry->{'entry_element'}->{'extra'}
+ and
($index_entry->{'entry_element'}->{'extra'}->{'seeentry'}
+ or
$index_entry->{'entry_element'}->{'extra'}->{'seealso'}));
my $href;
$href = $self->command_href($index_entry->{'entry_element'}, '');
# Obtain term by converting to text
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index a3e7196299..4fe0fac5cf 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -1252,26 +1252,19 @@ sub process_printindex($$;$)
return '';
}
- my $result = '';
- $result .= _add_newline_if_needed($self);
- if ($in_info) {
- my $info_printindex_magic = "\x{00}\x{08}[index\x{00}\x{08}]\n";
- $result .= $info_printindex_magic;
- add_text_count($self, $info_printindex_magic);
- _add_lines_count($self, 1);
- }
- my $heading = "* Menu:\n\n";
-
- $result .= $heading;
- add_text_count($self, $heading);
- _add_lines_count($self, 2);
-
# first determine the line numbers for the spacing of their formatting
my %line_nrs;
my %entry_nodes;
my $max_index_line_nr_string_length = 0;
my %ignored_entries;
foreach my $entry (@{$self->{'index_entries'}->{$index_name}}) {
+ # FIXME format in a way instead of ignoring
+ if ($entry->{'entry_element'}->{'extra'}
+ and ($entry->{'entry_element'}->{'extra'}->{'seeentry'}
+ or $entry->{'entry_element'}->{'extra'}->{'seealso'})) {
+ $ignored_entries{$entry} = 1;
+ next;
+ }
my $line_nr;
if (defined
($self->{'index_entries_line_location'}->{$entry->{'entry_element'}})) {
@@ -1306,6 +1299,22 @@ sub process_printindex($$;$)
$line_nrs{$entry} = $line_nr;
}
+ return '' if (scalar(%line_nrs) == 0);
+
+ my $result = '';
+ $result .= _add_newline_if_needed($self);
+ if ($in_info) {
+ my $info_printindex_magic = "\x{00}\x{08}[index\x{00}\x{08}]\n";
+ $result .= $info_printindex_magic;
+ add_text_count($self, $info_printindex_magic);
+ _add_lines_count($self, 1);
+ }
+ my $heading = "* Menu:\n\n";
+
+ $result .= $heading;
+ add_text_count($self, $heading);
+ _add_lines_count($self, 2);
+
# this is used to count entries that are the same
my %entry_counts = ();
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index 05ea9e263e..daeaadb219 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -2723,13 +2723,10 @@ sub _enter_index_entry($$$$$$$)
my $index_name = $self->{'command_index'}->{$command_container};
my $index = $self->{'index_names'}->{$index_name};
- # if the entry has seeentry or seealso it won't be pushed in
- # $index->{'index_entries'}, so it may remain empty.
if (!defined($index->{'index_entries'})) {
$index->{'index_entries'} = [];
}
- # not accounting for seeentry/seealso entries
my $number = scalar(@{$index->{'index_entries'}}) + 1;
# FIXME index_type_command does not seems to be used anywhere.
@@ -2763,12 +2760,7 @@ sub _enter_index_entry($$$$$$$)
$index_name), $source_info);
}
- # Skip these as these entries do not refer to the place in the document where
- # the index commands occurred.
- if (!defined $current->{'extra'}->{'seeentry'}
- and !defined $current->{'extra'}->{'seealso'}) {
- push @{$index->{'index_entries'}}, $index_entry;
- }
+ push @{$index->{'index_entries'}}, $index_entry;
$current->{'extra'}->{'index_entry'} = $index_entry;
}
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 977def9214..213e1a7170 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -848,14 +848,8 @@ build_single_index_data (INDEX *i)
STORE2("index_ignore_chars", newRV_inc ((SV *)hv));
}
- /* Skip these as these entries do not refer to the place in the document
- where the index commands occurred. */
- if (!lookup_extra (e->command, "seeentry")
- && !lookup_extra (e->command, "seealso"))
- {
- av_push (entries, newRV_inc ((SV *)entry));
- entry_number++;
- }
+ av_push (entries, newRV_inc ((SV *)entry));
+ entry_number++;
/* We set this now because the index data structures don't
exist at the time that the main tree is built. */
diff --git a/tp/init/chm.pm b/tp/init/chm.pm
index 9340a9bc85..5c9d37bed0 100644
--- a/tp/init/chm.pm
+++ b/tp/init/chm.pm
@@ -247,6 +247,10 @@ sub chm_init($)
if ($index_entries) {
foreach my $index_name (sort(keys(%$index_entries))) {
foreach my $index_entry_ref (@{$index_entries->{$index_name}}) {
+ # do not register index entries that do not point to the document
+ next if ($index_entry_ref->{'entry_element'}->{'extra'}
+ and
($index_entry_ref->{'entry_element'}->{'extra'}->{'seeentry'}
+ or
$index_entry_ref->{'entry_element'}->{'extra'}->{'seealso'}));
my $origin_href
= $self->command_href($index_entry_ref->{'entry_element'}, '');
my $entry = _chm_convert_tree_to_text($self,
diff --git a/tp/t/results/indices/double_seeentry_seealso.pl
b/tp/t/results/indices/double_seeentry_seealso.pl
index aebeadc1b5..79a1cfabc1 100644
--- a/tp/t/results/indices/double_seeentry_seealso.pl
+++ b/tp/t/results/indices/double_seeentry_seealso.pl
@@ -237,6 +237,7 @@ $result_trees{'double_seeentry_seealso'} = {
'entry_element' => {},
'entry_node' => {},
'entry_number' => 1,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -329,7 +330,8 @@ $result_trees{'double_seeentry_seealso'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 2,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -422,7 +424,8 @@ $result_trees{'double_seeentry_seealso'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 3,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -480,7 +483,8 @@ $result_trees{'double_seeentry_seealso'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 4,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -814,13 +818,29 @@ $result_menus{'double_seeentry_seealso'} = {
'structure' => {}
};
-$result_errors{'double_seeentry_seealso'} = [];
+$result_errors{'double_seeentry_seealso'} = [
+ {
+ 'error_line' => 'warning: empty index key in @cindex
+',
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => '',
+ 'text' => 'empty index key in @cindex',
+ 'type' => 'warning'
+ }
+];
$result_floats{'double_seeentry_seealso'} = {};
-$result_indices_sort_strings{'double_seeentry_seealso'} = {};
+$result_indices_sort_strings{'double_seeentry_seealso'} = {
+ 'cp' => [
+ 'aaa',
+ 'ddd',
+ 'ggg'
+ ]
+};
@@ -868,6 +888,19 @@ coding: utf-8
End:
';
+$result_converted_errors{'info'}->{'double_seeentry_seealso'} = [
+ {
+ 'error_line' => 'warning: empty index key in @cindex
+',
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => '',
+ 'text' => 'empty index key in @cindex',
+ 'type' => 'warning'
+ }
+];
+
+
$result_converted{'plaintext'}->{'double_seeentry_seealso'} = 'top
***
@@ -877,6 +910,19 @@
$result_converted{'plaintext'}->{'double_seeentry_seealso'} = 'top
';
+$result_converted_errors{'plaintext'}->{'double_seeentry_seealso'} = [
+ {
+ 'error_line' => 'warning: empty index key in @cindex
+',
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => '',
+ 'text' => 'empty index key in @cindex',
+ 'type' => 'warning'
+ }
+];
+
+
$result_converted{'html_text'}->{'double_seeentry_seealso'} = '<div
class="top-level-extent" id="Top">
<div class="nav-panel">
@@ -901,8 +947,22 @@
$result_converted{'html_text'}->{'double_seeentry_seealso'} = '<div class="top-l
</div>
';
+$result_converted_errors{'html_text'}->{'double_seeentry_seealso'} = [
+ {
+ 'error_line' => 'warning: empty index key in @cindex
+',
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => '',
+ 'text' => 'empty index key in @cindex',
+ 'type' => 'warning'
+ }
+];
+
+
$result_converted{'latex'}->{'double_seeentry_seealso'} =
'\\documentclass{book}
+\\usepackage{imakeidx}
\\usepackage{amsfonts}
\\usepackage{amsmath}
\\usepackage[gen]{eurosym}
@@ -920,6 +980,8 @@ $result_converted{'latex'}->{'double_seeentry_seealso'} =
'\\documentclass{book}
\\makeatletter
\\newcommand{\\GNUTexinfosettitle}{No Title}%
+\\makeindex[name=cp]%
+
% redefine the \\mainmatter command such that it does not clear page
% as if in double page
\\renewcommand\\mainmatter{\\clearpage\\@mainmattertrue\\pagenumbering{arabic}}
@@ -953,6 +1015,7 @@ $result_converted{'latex'}->{'double_seeentry_seealso'} =
'\\documentclass{book}
\\index[cp]{ggg|see{hhh}}%
\\index[cp]{!subggg|seealso{fff}}%
+\\printindex[cp]
\\end{document}
';
diff --git
a/tp/t/results/indices/multiple_index_text_sortas_seeentry_seealso.pl
b/tp/t/results/indices/multiple_index_text_sortas_seeentry_seealso.pl
index 99da2f98eb..c5bae617c6 100644
--- a/tp/t/results/indices/multiple_index_text_sortas_seeentry_seealso.pl
+++ b/tp/t/results/indices/multiple_index_text_sortas_seeentry_seealso.pl
@@ -271,6 +271,7 @@
$result_trees{'multiple_index_text_sortas_seeentry_seealso'} = {
'entry_element' => {},
'entry_node' => {},
'entry_number' => 1,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -348,7 +349,7 @@
$result_trees{'multiple_index_text_sortas_seeentry_seealso'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 2,
'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
@@ -425,7 +426,8 @@
$result_trees{'multiple_index_text_sortas_seeentry_seealso'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 2,
+ 'entry_number' => 3,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -690,7 +692,9 @@
$result_floats{'multiple_index_text_sortas_seeentry_seealso'} = {};
$result_indices_sort_strings{'multiple_index_text_sortas_seeentry_seealso'} = {
'cp' => [
- 'BB'
+ 'A---S',
+ 'BB',
+ 'entry secret'
]
};
diff --git a/tp/t/results/indices/printindex_index_entry_in_copying.pl
b/tp/t/results/indices/printindex_index_entry_in_copying.pl
index 42209bafac..daff6fd84b 100644
--- a/tp/t/results/indices/printindex_index_entry_in_copying.pl
+++ b/tp/t/results/indices/printindex_index_entry_in_copying.pl
@@ -1270,10 +1270,6 @@
$result_converted{'info'}->{'printindex_index_entry_in_copying'} = 'This is , pr
ftable item
xftable xitem
- [index ]
-* Menu:
-
-
File: , Node: Top, Next: chapter, Up: (dir)
@@ -1336,8 +1332,8 @@ xftable xitem
Tag Table:
-Node: Top131
-Node: chapter687
+Node: Top109
+Node: chapter665
End Tag Table
diff --git
a/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
b/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
index 8307843ae6..aa5d597900 100644
--- a/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
+++ b/tp/t/results/indices/printindex_index_entry_in_copying_in_footnote.pl
@@ -788,10 +788,6 @@
$result_converted{'info'}->{'printindex_index_entry_in_copying_in_footnote'} = '
Copying(1).
- [index ]
-* Menu:
-
-
---------- Footnotes ----------
(1) In footnote
@@ -806,10 +802,6 @@ Top.
Copying(1).
- [index ]
-* Menu:
-
-
* Menu:
* chapter::
@@ -829,7 +821,7 @@ Copying(1).
[index ]
* Menu:
-* Copying this document: Top. (line 20)
+* Copying this document: Top. (line 16)
---------- Footnotes ----------
@@ -838,10 +830,10 @@ Copying(1).
Tag Table:
-Node: Top118
-Ref: Top-Footnote-1279
-Node: chapter299
-Ref: chapter-Footnote-1512
+Node: Top96
+Ref: Top-Footnote-1235
+Node: chapter255
+Ref: chapter-Footnote-1468
End Tag Table
@@ -859,9 +851,6 @@ Top.
Copying(1).
-* Menu:
-
-
---------- Footnotes ----------
(1) In footnote
@@ -873,7 +862,7 @@ Copying(1).
* Menu:
-* Copying this document: Top. (line 12)
+* Copying this document: Top. (line 9)
---------- Footnotes ----------
diff --git
a/tp/t/results/indices/printindex_index_entry_in_copying_no_insertcopying.pl
b/tp/t/results/indices/printindex_index_entry_in_copying_no_insertcopying.pl
index 684fe8ada9..6defc72ea5 100644
--- a/tp/t/results/indices/printindex_index_entry_in_copying_no_insertcopying.pl
+++ b/tp/t/results/indices/printindex_index_entry_in_copying_no_insertcopying.pl
@@ -1230,10 +1230,6 @@
$result_converted{'info'}->{'printindex_index_entry_in_copying_no_insertcopying'
ftable item
xftable xitem
- [index ]
-* Menu:
-
-
File: , Node: Top, Next: chapter, Up: (dir)
@@ -1252,15 +1248,11 @@ File: , Node: chapter, Prev: Top, Up: Top
1 Chapter
*********
- [index ]
-* Menu:
-
-
Tag Table:
-Node: Top131
-Node: chapter218
+Node: Top109
+Node: chapter196
End Tag Table
@@ -1279,9 +1271,6 @@ Top.
1 Chapter
*********
-* Menu:
-
-
';
diff --git a/tp/t/results/indices/same_only_seealso_seeentry.pl
b/tp/t/results/indices/same_only_seealso_seeentry.pl
index 9313596d3b..64855fd1dd 100644
--- a/tp/t/results/indices/same_only_seealso_seeentry.pl
+++ b/tp/t/results/indices/same_only_seealso_seeentry.pl
@@ -211,6 +211,7 @@ $result_trees{'same_only_seealso_seeentry'} = {
'entry_element' => {},
'entry_node' => {},
'entry_number' => 1,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -277,7 +278,8 @@ $result_trees{'same_only_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 2,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -350,7 +352,8 @@ $result_trees{'same_only_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 3,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -417,7 +420,8 @@ $result_trees{'same_only_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 4,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -490,7 +494,8 @@ $result_trees{'same_only_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 5,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -557,7 +562,8 @@ $result_trees{'same_only_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 6,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -852,7 +858,16 @@ $result_errors{'same_only_seealso_seeentry'} = [];
$result_floats{'same_only_seealso_seeentry'} = {};
-$result_indices_sort_strings{'same_only_seealso_seeentry'} = {};
+$result_indices_sort_strings{'same_only_seealso_seeentry'} = {
+ 'cp' => [
+ 'aaa',
+ 'aaa',
+ 'bbb',
+ 'bbb',
+ 'ccc',
+ 'ccc'
+ ]
+};
@@ -925,6 +940,7 @@
$result_converted{'html_text'}->{'same_only_seealso_seeentry'} = '<div class="to
$result_converted{'latex'}->{'same_only_seealso_seeentry'} =
'\\documentclass{book}
+\\usepackage{imakeidx}
\\usepackage{amsfonts}
\\usepackage{amsmath}
\\usepackage[gen]{eurosym}
@@ -942,6 +958,8 @@ $result_converted{'latex'}->{'same_only_seealso_seeentry'}
= '\\documentclass{bo
\\makeatletter
\\newcommand{\\GNUTexinfosettitle}{No Title}%
+\\makeindex[name=cp]%
+
% redefine the \\mainmatter command such that it does not clear page
% as if in double page
\\renewcommand\\mainmatter{\\clearpage\\@mainmattertrue\\pagenumbering{arabic}}
@@ -979,6 +997,7 @@ $result_converted{'latex'}->{'same_only_seealso_seeentry'}
= '\\documentclass{bo
\\index[cp]{ccc|seealso{also}}%
\\index[cp]{ccc|see{entry}}%
+\\printindex[cp]
\\end{document}
';
diff --git a/tp/t/results/indices/same_seealso_seeentry.pl
b/tp/t/results/indices/same_seealso_seeentry.pl
index 6d391cb786..feb02e2d59 100644
--- a/tp/t/results/indices/same_seealso_seeentry.pl
+++ b/tp/t/results/indices/same_seealso_seeentry.pl
@@ -211,6 +211,7 @@ $result_trees{'same_seealso_seeentry'} = {
'entry_element' => {},
'entry_node' => {},
'entry_number' => 1,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -277,7 +278,8 @@ $result_trees{'same_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 2,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -350,7 +352,8 @@ $result_trees{'same_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 3,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -417,7 +420,8 @@ $result_trees{'same_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 4,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -490,7 +494,8 @@ $result_trees{'same_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 5,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -557,7 +562,8 @@ $result_trees{'same_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 6,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -604,7 +610,7 @@ $result_trees{'same_seealso_seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 7,
'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
@@ -912,6 +918,12 @@ $result_floats{'same_seealso_seeentry'} = {};
$result_indices_sort_strings{'same_seealso_seeentry'} = {
'cp' => [
+ 'aaa',
+ 'aaa',
+ 'bbb',
+ 'bbb',
+ 'ccc',
+ 'ccc',
'entry'
]
};
diff --git a/tp/t/results/indices/seeentry.pl b/tp/t/results/indices/seeentry.pl
index d00e59eb47..c027b1fdd7 100644
--- a/tp/t/results/indices/seeentry.pl
+++ b/tp/t/results/indices/seeentry.pl
@@ -203,6 +203,7 @@ $result_trees{'seeentry'} = {
'entry_element' => {},
'entry_node' => {},
'entry_number' => 1,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -269,7 +270,8 @@ $result_trees{'seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 2,
+ 'in_code' => 0,
'index_at_command' => 'cindex',
'index_ignore_chars' => {},
'index_name' => 'cp',
@@ -343,6 +345,7 @@ $result_trees{'seeentry'} = {
'entry_element' => {},
'entry_node' => {},
'entry_number' => 1,
+ 'in_code' => 1,
'index_at_command' => 'findex',
'index_ignore_chars' => {},
'index_name' => 'fn',
@@ -409,7 +412,8 @@ $result_trees{'seeentry'} = {
'entry_content' => [],
'entry_element' => {},
'entry_node' => {},
- 'entry_number' => 1,
+ 'entry_number' => 2,
+ 'in_code' => 1,
'index_at_command' => 'findex',
'index_ignore_chars' => {},
'index_name' => 'fn',
@@ -707,7 +711,16 @@ $result_errors{'seeentry'} = [];
$result_floats{'seeentry'} = {};
-$result_indices_sort_strings{'seeentry'} = {};
+$result_indices_sort_strings{'seeentry'} = {
+ 'cp' => [
+ 'aaa',
+ 'ddd'
+ ],
+ 'fn' => [
+ 'f---aaa',
+ 'f---ddd'
+ ]
+};
@@ -717,8 +730,8 @@ $result_converted{'docbook'}->{'seeentry'} = '<chapter
label="1" id="chapter-ind
<indexterm role="cp"><primary>aaa</primary><see>bbb</see></indexterm>
<indexterm role="cp"><primary>ddd</primary><seealso>ccc</seealso></indexterm>
-<indexterm
role="fn"><primary>f—aaa</primary><see>f—bbb</see></indexterm>
-<indexterm
role="fn"><primary>f—ddd</primary><seealso>f—ccc</seealso></indexterm>
+<indexterm role="fn"><primary>f---aaa</primary><see>f---bbb</see></indexterm>
+<indexterm
role="fn"><primary>f---ddd</primary><seealso>f---ccc</seealso></indexterm>
<index role="cp"></index>
<index role="fn"></index>
@@ -787,6 +800,7 @@ $result_converted{'html_text'}->{'seeentry'} = '<div
class="top-level-extent" id
$result_converted{'latex'}->{'seeentry'} = '\\documentclass{book}
+\\usepackage{imakeidx}
\\usepackage{amsfonts}
\\usepackage{amsmath}
\\usepackage[gen]{eurosym}
@@ -804,6 +818,9 @@ $result_converted{'latex'}->{'seeentry'} =
'\\documentclass{book}
\\makeatletter
\\newcommand{\\GNUTexinfosettitle}{No Title}%
+\\makeindex[name=cp]%
+\\makeindex[name=fn]%
+
% redefine the \\mainmatter command such that it does not clear page
% as if in double page
\\renewcommand\\mainmatter{\\clearpage\\@mainmattertrue\\pagenumbering{arabic}}
@@ -835,9 +852,11 @@ $result_converted{'latex'}->{'seeentry'} =
'\\documentclass{book}
\\index[cp]{aaa|see{bbb}}%
\\index[cp]{ddd|seealso{ccc}}%
-\\index[fn]{f--aaa@\\texttt{f{-}{-}{-}aaa}|see{f---bbb}}%
-\\index[fn]{f--ddd@\\texttt{f{-}{-}{-}ddd}|seealso{f---ccc}}%
+\\index[fn]{f---aaa@\\texttt{f{-}{-}{-}aaa}|see{f---bbb}}%
+\\index[fn]{f---ddd@\\texttt{f{-}{-}{-}ddd}|seealso{f---ccc}}%
+\\printindex[cp]
+\\printindex[fn]
\\end{document}
';
diff --git a/tp/tests/layout/res_parser/formatting_docbook/formatting.xml
b/tp/tests/layout/res_parser/formatting_docbook/formatting.xml
index ce2fe6d761..cadca11fad 100644
--- a/tp/tests/layout/res_parser/formatting_docbook/formatting.xml
+++ b/tp/tests/layout/res_parser/formatting_docbook/formatting.xml
@@ -3646,8 +3646,8 @@ Various deff lines
<indexterm role="cp"><primary>aaa</primary><see>bbb</see></indexterm>
<indexterm role="cp"><primary>ddd</primary><seealso>ccc</seealso></indexterm>
-<indexterm
role="fn"><primary>f—aaa</primary><see>f—bbb</see></indexterm>
-<indexterm
role="fn"><primary>f—ddd</primary><seealso>f—ccc</seealso></indexterm>
+<indexterm role="fn"><primary>f---aaa</primary><see>f---bbb</see></indexterm>
+<indexterm
role="fn"><primary>f---ddd</primary><seealso>f---ccc</seealso></indexterm>
<indexterm
role="cp"><primary>aaa</primary><secondary>bbb</secondary></indexterm>
<indexterm
role="fn"><primary>xxx</primary><secondary>zzz</secondary></indexterm>
@@ -3664,7 +3664,7 @@ Various deff lines
<!-- File ended while scanning use of @initialx. -->
<indexterm role="cp"><primary>ddd</primary><seealso>ccc</seealso></indexterm>
-<indexterm
role="fn"><primary>f—ddd</primary><seealso>f—ccc</seealso></indexterm>
+<indexterm
role="fn"><primary>f---ddd</primary><seealso>f---ccc</seealso></indexterm>
<para>Text<footnote><para>in footnote
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
index 1650bb220a..af8f81fb36 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
@@ -9262,8 +9262,8 @@ b
\index[cp]{aaa|see{bbb}}%
\index[cp]{ddd|seealso{ccc}}%
-\index[fn]{f--aaa@\texttt{f{-}{-}{-}aaa}|see{f---bbb}}%
-\index[fn]{f--ddd@\texttt{f{-}{-}{-}ddd}|seealso{f---ccc}}%
+\index[fn]{f---aaa@\texttt{f{-}{-}{-}aaa}|see{f---bbb}}%
+\index[fn]{f---ddd@\texttt{f{-}{-}{-}ddd}|seealso{f---ccc}}%
\index[cp]{A---S@aaa!B---S1@bbb}%
@@ -9281,7 +9281,7 @@ b
\index[cp]{ddd|seealso{ccc}}%
-\index[fn]{f--ddd@\texttt{f{-}{-}{-}ddd}|seealso{f---ccc}}%
+\index[fn]{f---ddd@\texttt{f{-}{-}{-}ddd}|seealso{f---ccc}}%
Text\footnote{in footnote
diff --git a/tp/tests/layout/res_parser/formatting_xml/formatting.xml
b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
index 3d4bf66cde..1117916b97 100644
--- a/tp/tests/layout/res_parser/formatting_xml/formatting.xml
+++ b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
@@ -5809,43 +5809,43 @@ Various deff lines
<findex index="fn" spaces=" "><indexterm index="fn"
number="216">f---ddd</indexterm></findex><subentry spaces=" ">f&textmdash;eee
</subentry><subentry spaces=" ">ffff</subentry>
<cindex index="cp" spaces=" "><indexterm index="cp" number="37">aaa
<seeentry>bbb</seeentry></indexterm></cindex>
-<cindex index="cp" spaces=" "><indexterm index="cp" number="37">ddd
<seealso>ccc</seealso></indexterm></cindex>
+<cindex index="cp" spaces=" "><indexterm index="cp" number="38">ddd
<seealso>ccc</seealso></indexterm></cindex>
-<findex index="fn" spaces=" "><indexterm index="fn"
number="217">f&textmdash;aaa
<seeentry>f&textmdash;bbb</seeentry></indexterm></findex>
-<findex index="fn" spaces=" "><indexterm index="fn"
number="217">f&textmdash;ddd
<seealso>f&textmdash;ccc</seealso></indexterm></findex>
+<findex index="fn" spaces=" "><indexterm index="fn" number="217">f---aaa
<seeentry>f---bbb</seeentry></indexterm></findex>
+<findex index="fn" spaces=" "><indexterm index="fn" number="218">f---ddd
<seealso>f---ccc</seealso></indexterm></findex>
-<cindex index="cp" spaces=" "><indexterm index="cp" number="37">aaa
<sortas>A&textmdash;S</sortas></indexterm></cindex><subentry spaces="
"><sortas>B&textmdash;S1</sortas> bbb</subentry>
+<cindex index="cp" spaces=" "><indexterm index="cp" number="39">aaa
<sortas>A&textmdash;S</sortas></indexterm></cindex><subentry spaces="
"><sortas>B&textmdash;S1</sortas> bbb</subentry>
-<findex index="fn" spaces=" "><indexterm index="fn" number="217">xxx
<sortas>X---S</sortas></indexterm></findex><subentry spaces="
"><sortas>X&textmdash;S1</sortas> zzz</subentry>
+<findex index="fn" spaces=" "><indexterm index="fn" number="219">xxx
<sortas>X---S</sortas></indexterm></findex><subentry spaces="
"><sortas>X&textmdash;S1</sortas> zzz</subentry>
<cindex></cindex>
-<findex index="fn" spaces=" "><indexterm index="fn"
number="218"><w></w></indexterm></findex>
+<findex index="fn" spaces=" "><indexterm index="fn"
number="220"><w></w></indexterm></findex>
<indexcommand command="codeidxindex" index="codeidx" spaces=" "><indexterm
index="codeidx" number="1" incode="1">a <var>index---entry</var> t<accent
type="tilde" bracketed="off">e</accent> --- <accent
type="circ"><dotless>i</dotless></accent></indexterm></indexcommand>
<indexcommand command="trucindex" index="truc" spaces=" "><indexterm
index="truc" number="1" incode="0">truc</indexterm></indexcommand>
<!-- c error with texindex: Bad entry; expected 3 to 5 fields, not 6 -->
-<cindex index="cp" spaces=" "><indexterm index="cp"
number="38">g&textmdash;gg</indexterm></cindex><subentry spaces="
">h&textmdash;hh jjj </subentry><subentry spaces=" ">k&textmdash;kk
</subentry><subentry spaces=" ">l&textmdash;ll</subentry>
+<cindex index="cp" spaces=" "><indexterm index="cp"
number="40">g&textmdash;gg</indexterm></cindex><subentry spaces="
">h&textmdash;hh jjj </subentry><subentry spaces=" ">k&textmdash;kk
</subentry><subentry spaces=" ">l&textmdash;ll</subentry>
-<findex index="fn" spaces=" "><indexterm index="fn"
number="219">f---ggg</indexterm></findex><subentry spaces=" ">f&textmdash;hhh
fjjj </subentry><subentry spaces=" ">f&textmdash;kkk </subentry><subentry
spaces=" ">f&textmdash;lll</subentry>
+<findex index="fn" spaces=" "><indexterm index="fn"
number="221">f---ggg</indexterm></findex><subentry spaces=" ">f&textmdash;hhh
fjjj </subentry><subentry spaces=" ">f&textmdash;kkk </subentry><subentry
spaces=" ">f&textmdash;lll</subentry>
<!-- c incorrect order. Cryptic error in TeX -->
<!-- c File ended while scanning use of @initialx. -->
-<cindex index="cp" spaces=" "><indexterm index="cp"
number="39"><seealso>ccc</seealso> ddd</indexterm></cindex>
+<cindex index="cp" spaces=" "><indexterm index="cp"
number="41"><seealso>ccc</seealso> ddd</indexterm></cindex>
-<findex index="fn" spaces=" "><indexterm index="fn"
number="220"><seealso>f&textmdash;ccc</seealso>
f&textmdash;ddd</indexterm></findex>
+<findex index="fn" spaces=" "><indexterm index="fn"
number="222"><seealso>f---ccc</seealso> f---ddd</indexterm></findex>
<syncodeindex from="vr" to="cp" line="vr cp"></syncodeindex>
<para>Text<footnote><para>in footnote
-<cindex index="cp" spaces=" "><indexterm index="cp" number="39">index entry in
footnote</indexterm></cindex>
+<cindex index="cp" spaces=" "><indexterm index="cp" number="42">index entry in
footnote</indexterm></cindex>
</para>
<para>Blah
</para>
<para>Blih
</para>
-<cindex index="cp" spaces=" "><indexterm index="cp" number="40">counting
entry</indexterm></cindex>
+<cindex index="cp" spaces=" "><indexterm index="cp" number="43">counting
entry</indexterm></cindex>
</footnote>
</para>
<para>truc
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Gather @seealso and @seeentry index entries with other entries,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_enter_index_entry), tp/Texinfo/XS/parsetexi/api.c (build_single_index_data), tp/Texinfo/Convert/*.pm, tp/Texinfo/Common.pm, tp/Texinfo/Structuring.pm, tp/Texinfo/Transformations.pm, tp/Texinfo/Translations.pm, tp/init/chm.pm: change index structure key names to have more specific names.
- Next by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (_convert_printindex_command): pop document context when there is no output.
- Previous by thread:
branch master updated: * tp/Texinfo/ParserNonXS.pm (_enter_index_entry), tp/Texinfo/XS/parsetexi/api.c (build_single_index_data), tp/Texinfo/Convert/*.pm, tp/Texinfo/Common.pm, tp/Texinfo/Structuring.pm, tp/Texinfo/Transformations.pm, tp/Texinfo/Translations.pm, tp/init/chm.pm: change index structure key names to have more specific names.
- Next by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (_convert_printindex_command): pop document context when there is no output.
- Index(es):