[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Thu, 1 Feb 2024 17:51:30 -0500 (EST) |
branch: master
commit b7c7345b7a1351327eade3621897c37be659a157
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Feb 1 22:49:43 2024 +0100
* tp/Makefile.am (test_files),
t/input_files/formatting_customizations_input.texi, tp/Makefile.tres,
tp/t/converters_tests.t (reference_for_formatting_customizations)
(test_formatting_customizations), tp/tests/Makefile.onetst,
tp/tests/formatting/list-of-tests: add tests of customizations on
formatting. Setup a separate test in tests/formatting/list-of-tests
to be able to test rawtext too, as in t/*.t raw text does not take
into account customization.
* tp/Texinfo/Convert/Text.pm (brace_no_arg_command),
tp/Texinfo/Convert/Unicode.pm (unicode_point_decoded_in_encoding),
tp/Texinfo/XS/main/convert_to_text.c (text_brace_no_arg_command),
tp/Texinfo/XS/main/unicode.c (unicode_point_decoded_in_encoding):
consider that encoding is the default, UTF-8 in
unicode_point_decoded_in_encoding if undef. Check that encoding is
defined in text brace_no_arg_command and do not call unicode
brace_no_arg_command if not.
* tp/Texinfo/Translations.pm (import),
tp/Texinfo/XS/main/DocumentXS.xs
(configure_output_strings_translations),
tp/Texinfo/XS/main/translations.c
(configure_output_strings_translations): rename
translations_configure as configure_output_strings_translations.
* tp/Texinfo/XS/main/translations.c
(configure_output_strings_translations): add error message if
bindtextdomain failed.
* tp/Texinfo/XS/convert/convert_html.c (html_translate_names): add
document to html_gdt_tree call.
---
ChangeLog | 34 ++
tp/Makefile.am | 1 +
tp/Makefile.tres | 2 +
tp/TODO | 2 +-
tp/Texinfo/Convert/Text.pm | 8 +-
tp/Texinfo/Convert/Unicode.pm | 4 +-
tp/Texinfo/Translations.pm | 7 +-
tp/Texinfo/XS/convert/convert_html.c | 7 +-
tp/Texinfo/XS/convert/get_html_perl_info.c | 8 -
tp/Texinfo/XS/main/DocumentXS.xs | 4 +-
tp/Texinfo/XS/main/convert_to_text.c | 5 +-
tp/Texinfo/XS/main/get_perl_info.c | 5 +-
tp/Texinfo/XS/main/translations.c | 14 +-
tp/Texinfo/XS/main/translations.h | 3 +-
tp/Texinfo/XS/main/unicode.c | 4 +
tp/t/converters_tests.t | 8 +
.../formatting_customizations_input.texi | 8 +
.../reference_for_formatting_customizations.pl | 409 +++++++++++++++++++++
.../test_formatting_customizations.pl | 409 +++++++++++++++++++++
tp/tests/Makefile.onetst | 1 +
tp/tests/formatting/list-of-tests | 4 +
.../formatting_customizations_input.1 | 0
.../formatting_customizations_input.2 | 0
.../formatting_customizations_input.txt | 8 +
...ing_formatting_customizations_input_raw_text.sh | 19 +
25 files changed, 943 insertions(+), 31 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ae5fd49fd2..3237517fd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+2024-02-01 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Makefile.am (test_files),
+ t/input_files/formatting_customizations_input.texi, tp/Makefile.tres,
+ tp/t/converters_tests.t (reference_for_formatting_customizations)
+ (test_formatting_customizations), tp/tests/Makefile.onetst,
+ tp/tests/formatting/list-of-tests: add tests of customizations on
+ formatting. Setup a separate test in tests/formatting/list-of-tests
+ to be able to test rawtext too, as in t/*.t raw text does not take
+ into account customization.
+
+ * tp/Texinfo/Convert/Text.pm (brace_no_arg_command),
+ tp/Texinfo/Convert/Unicode.pm (unicode_point_decoded_in_encoding),
+ tp/Texinfo/XS/main/convert_to_text.c (text_brace_no_arg_command),
+ tp/Texinfo/XS/main/unicode.c (unicode_point_decoded_in_encoding):
+ consider that encoding is the default, UTF-8 in
+ unicode_point_decoded_in_encoding if undef. Check that encoding is
+ defined in text brace_no_arg_command and do not call unicode
+ brace_no_arg_command if not.
+
+ * tp/Texinfo/Translations.pm (import),
+ tp/Texinfo/XS/main/DocumentXS.xs
+ (configure_output_strings_translations),
+ tp/Texinfo/XS/main/translations.c
+ (configure_output_strings_translations): rename
+ translations_configure as configure_output_strings_translations.
+
+ * tp/Texinfo/XS/main/translations.c
+ (configure_output_strings_translations): add error message if
+ bindtextdomain failed.
+
+ * tp/Texinfo/XS/convert/convert_html.c (html_translate_names): add
+ document to html_gdt_tree call.
+
2024-02-01 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/call_html_perl_function.c,
diff --git a/tp/Makefile.am b/tp/Makefile.am
index 4a189e704b..53f538cff0 100644
--- a/tp/Makefile.am
+++ b/tp/Makefile.am
@@ -231,6 +231,7 @@ test_files = \
t/input_files/encoding_index_utf8.texi \
t/input_files/end_of_lines_protected_non_ascii.texi \
t/input_files/float_copying.texi \
+ t/input_files/formatting_customizations_input.texi \
t/input_files/glossary.texi \
t/input_files/in_menu_only_special_spaces_node.texi \
t/input_files/in_menu_only_special_ascii_spaces_node.texi \
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index d8171884a7..1d8f441f90 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -241,6 +241,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/converters_tests/raw_block_commands_expand_tex.pl \
t/results/converters_tests/ref_error_formatting.pl \
t/results/converters_tests/ref_in_sectioning.pl \
+ t/results/converters_tests/reference_for_formatting_customizations.pl \
t/results/converters_tests/references_to_top_no_top_output.pl \
t/results/converters_tests/references_to_top_no_top_output/res_html \
t/results/converters_tests/references_to_top_no_top_output/res_latex \
@@ -270,6 +271,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/converters_tests/table_in_display_in_example.pl \
t/results/converters_tests/table_in_example_in_display.pl \
t/results/converters_tests/test_deftypefnnewline.pl \
+ t/results/converters_tests/test_formatting_customizations.pl \
t/results/converters_tests/test_sp.pl \
t/results/converters_tests/things_before_setfilename.pl \
t/results/converters_tests/things_before_setfilename_no_element.pl \
diff --git a/tp/TODO b/tp/TODO
index 110c654bf9..431eb0fb3f 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -57,7 +57,7 @@
$main_configuration->register_XS_document_main_configuration($document);
However, there is, somewhat on purpose, no documentation at all for
MainConfig given that it is considered as some internal implementation
detail, not to be used in external code. So probably would need first to
-docuent MainConfig.
+document MainConfig.
Document *XS_EXTERNAL_FORMATTING *XS_EXTERNAL_CONVERSION?
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index 748854a3b4..1650e6a635 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -208,7 +208,8 @@ foreach my $type ('ignorable_spaces_after_command',
}
-my @text_indicator_converter_options = ('NUMBER_SECTIONS', 'ASCII_GLYPH',
'TEST');
+my @text_indicator_converter_options
+ = ('NUMBER_SECTIONS', 'ASCII_GLYPH', 'TEST');
sub _initialize_options_encoding($$)
{
@@ -410,8 +411,9 @@ sub brace_no_arg_command($;$)
and defined($text_brace_no_arg_commands{
$element->{'extra'}->{'clickstyle'}}));
my $result;
- if (!($options and $options->{'ASCII_GLYPH'})
- or !exists($Texinfo::Convert::Unicode::extra_unicode_map{$command})) {
+ if (defined($encoding) and
+ (!($options and $options->{'ASCII_GLYPH'})
+ or !exists($Texinfo::Convert::Unicode::extra_unicode_map{$command}))) {
$result
= Texinfo::Convert::Unicode::brace_no_arg_command($command, $encoding);
}
diff --git a/tp/Texinfo/Convert/Unicode.pm b/tp/Texinfo/Convert/Unicode.pm
index b435452a0e..0a1bd1e13f 100644
--- a/tp/Texinfo/Convert/Unicode.pm
+++ b/tp/Texinfo/Convert/Unicode.pm
@@ -1586,13 +1586,13 @@ sub unicode_point_decoded_in_encoding($$) {
# to lower case to match the encoding names used here. In the code
# encoding names are lower cased early.
$encoding = lc($encoding);
+ }
- return 1 if ($encoding eq 'utf-8'
+ return 1 if ((!defined($encoding) or $encoding eq 'utf-8')
or ($unicode_to_eight_bit{$encoding}
and ($unicode_to_eight_bit{$encoding}->{$unicode_point}
# excludes 127 \x{7F} DEL
or hex($unicode_point) < 127)));
- }
return 0;
}
diff --git a/tp/Texinfo/Translations.pm b/tp/Texinfo/Translations.pm
index b370b54efe..cda40c1d60 100644
--- a/tp/Texinfo/Translations.pm
+++ b/tp/Texinfo/Translations.pm
@@ -1,4 +1,4 @@
-# Translations.pm: translate strings.
+# Translations.pm: translate strings in output.
#
# Copyright 2010-2023 Free Software Foundation, Inc.
#
@@ -17,6 +17,9 @@
#
# Original author: Patrice Dumas <pertusus@free.fr>
+# This code is used for output documents strings translations, not for
+# error messages translations.
+
package Texinfo::Translations;
use 5.00405;
@@ -53,7 +56,7 @@ sub import {
if (!$module_loaded) {
Texinfo::XSLoader::override(
"Texinfo::Translations::_XS_configure",
- "Texinfo::DocumentXS::translations_configure");
+ "Texinfo::DocumentXS::configure_output_strings_translations");
# Example of how gdt could be overriden. Not used because
# the approach is flawed as there won't be any substitution if the trees in
# $replaced_substrings are not registered in C data, as is the case in
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 082f36f47a..21c3d5710c 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -6909,7 +6909,7 @@ file_header_information (CONVERTER *self, const ELEMENT
*command,
/* TRANSLATORS: sectioning element title for the page header */
title_tree
= html_gdt_tree ("{element_text} ({title})",
- self->document, self, substrings, 0, 0);
+ self->document, self, substrings, 0, 0);
destroy_named_string_element_list (substrings);
@@ -17137,10 +17137,11 @@ html_translate_names (CONVERTER *self)
{
ELEMENT *translated_tree = 0;
if (format_spec->translated_to_convert)
- {/* FIXME use document associated to converter? */
+ {/* it is very unlikely to have small strings to add,
+ but in case there are is should be ok */
translated_tree =
html_gdt_tree (format_spec->translated_to_convert,
- 0, self, 0, 0, 0);
+ self->document, self, 0, 0, 0);
}
else
translated_tree = translated_command_tree (self, cmd);
diff --git a/tp/Texinfo/XS/convert/get_html_perl_info.c
b/tp/Texinfo/XS/convert/get_html_perl_info.c
index bae600d7f0..9ded747443 100644
--- a/tp/Texinfo/XS/convert/get_html_perl_info.c
+++ b/tp/Texinfo/XS/convert/get_html_perl_info.c
@@ -30,14 +30,6 @@
#undef context
-/*
-FIXME add an initialization of translations?
-
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#endif
-*/
-
#include "command_ids.h"
#include "converter_types.h"
#include "utils.h"
diff --git a/tp/Texinfo/XS/main/DocumentXS.xs b/tp/Texinfo/XS/main/DocumentXS.xs
index 0f9e62f9d0..4e8a766414 100644
--- a/tp/Texinfo/XS/main/DocumentXS.xs
+++ b/tp/Texinfo/XS/main/DocumentXS.xs
@@ -45,11 +45,11 @@ MODULE = Texinfo::DocumentXS PACKAGE =
Texinfo::DocumentXS
PROTOTYPES: ENABLE
void
-translations_configure (localesdir, strings_textdomain="texinfo_document")
+configure_output_strings_translations (localesdir,
strings_textdomain="texinfo_document")
char *localesdir = (char *)SvPVbyte_nolen($arg);
char *strings_textdomain;
CODE:
- translations_configure (localesdir, strings_textdomain);
+ configure_output_strings_translations (localesdir, strings_textdomain);
SV *
rebuild_document (SV *document_in, ...)
diff --git a/tp/Texinfo/XS/main/convert_to_text.c
b/tp/Texinfo/XS/main/convert_to_text.c
index bc11f2ac1e..c7f6b5de55 100644
--- a/tp/Texinfo/XS/main/convert_to_text.c
+++ b/tp/Texinfo/XS/main/convert_to_text.c
@@ -324,8 +324,9 @@ text_brace_no_arg_command (const ELEMENT *e, TEXT_OPTIONS
*options)
}
}
- if (!(options->ASCII_GLYPH)
- || !(unicode_character_brace_no_arg_commands[cmd].is_extra > 0))
+ if (encoding
+ && (!(options->ASCII_GLYPH)
+ || !(unicode_character_brace_no_arg_commands[cmd].is_extra > 0)))
{
char *brace_no_arg_unicode = unicode_brace_no_arg_command (cmd,
encoding);
if (brace_no_arg_unicode)
diff --git a/tp/Texinfo/XS/main/get_perl_info.c
b/tp/Texinfo/XS/main/get_perl_info.c
index 9044b3b912..1f4cb6ae8c 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -1039,7 +1039,10 @@ html_get_button_specification_list (CONVERTER
*converter, SV *buttons_sv)
malloc (sizeof (BUTTON_SPECIFICATION_LIST));
buttons_av = (AV *)SvRV (buttons_sv);
- /* TODO increase ref count of result->av? */
+ /* In contrast with other cases, we do not add a reference to the array
+ associated to result->av to make sure that the av is not destroyed
+ while still needed, as we assume that the Perl converter will hold
+ a reference longer than we need the av for */
result->av = buttons_av;
buttons_nr = av_top_index (buttons_av) +1;
diff --git a/tp/Texinfo/XS/main/translations.c
b/tp/Texinfo/XS/main/translations.c
index 8eecea96a8..ccda036b8f 100644
--- a/tp/Texinfo/XS/main/translations.c
+++ b/tp/Texinfo/XS/main/translations.c
@@ -44,9 +44,6 @@
/*
my $DEFAULT_ENCODING = 'utf-8';
-my $DEFAULT_PERL_ENCODING = 'utf-8';
-
-my $messages_textdomain = 'texinfo';
*/
static char *working_locale = 0;
@@ -55,16 +52,21 @@ static char *locale_command = 0;
static char *strings_textdomain = "texinfo_document";
void
-translations_configure (char *localesdir, char *strings_textdomain_in)
+configure_output_strings_translations (char *localesdir,
+ char *strings_textdomain_in)
{
char *textdomain_directory;
if (strings_textdomain_in)
strings_textdomain = strings_textdomain_in;
#ifdef ENABLE_NLS
- /* FIXME error out if failure?
- if failure bindtextdomain sets errno to ENOMEM and returns NULL */
textdomain_directory = bindtextdomain (strings_textdomain, localesdir);
+
+ if (!textdomain_directory)
+ {
+ fprintf (stderr, "bindtextdomain: error setting %s to `%s': %s\n",
+ strings_textdomain, localesdir, strerror(errno));
+ }
#endif
}
diff --git a/tp/Texinfo/XS/main/translations.h
b/tp/Texinfo/XS/main/translations.h
index 9a688e1863..bc2a5a5f7c 100644
--- a/tp/Texinfo/XS/main/translations.h
+++ b/tp/Texinfo/XS/main/translations.h
@@ -21,7 +21,8 @@ typedef struct NAMED_STRING_ELEMENT_LIST {
NAMED_STRING_ELEMENT *list;
} NAMED_STRING_ELEMENT_LIST;
-void translations_configure (char *localesdir, char *strings_textdomain_in);
+void configure_output_strings_translations (char *localesdir,
+ char *strings_textdomain_in);
char *translate_string (OPTIONS *options, const char * string,
const char *translation_context, const char *in_lang);
diff --git a/tp/Texinfo/XS/main/unicode.c b/tp/Texinfo/XS/main/unicode.c
index 4b669e7820..5198605672 100644
--- a/tp/Texinfo/XS/main/unicode.c
+++ b/tp/Texinfo/XS/main/unicode.c
@@ -448,6 +448,10 @@ int unicode_point_decoded_in_encoding (const char
*encoding, char *codepoint)
}
free (normalized_encoding);
}
+ else
+ /* if encoding is undef, consider that it is the default, utf-8 */
+ return -1;
+
return 0;
}
diff --git a/tp/t/converters_tests.t b/tp/t/converters_tests.t
index 14dcf230a7..cb209570ce 100644
--- a/tp/t/converters_tests.t
+++ b/tp/t/converters_tests.t
@@ -1150,6 +1150,14 @@ defop n
@var{'.$string_for_upper_case.'}',
{'EXPANDED_FORMATS' => ['docbook', 'html', 'xml', 'plaintext']}],
+# reference to be able to compare the customizations effects
+['reference_for_formatting_customizations',
+undef, {'test_file' => 'formatting_customizations_input.texi'},],
+# the customization variables tested have effect in raw text output,
+# other could be tested too.
+['test_formatting_customizations',
+undef, {'test_file' => 'formatting_customizations_input.texi'},
+ {'NUMBER_SECTIONS' => 0, 'ASCII_GLYPH' => 1}],
# the big rule is set to be different from the normal rule to check the type
# of rule output
['contents_at_document_begin',
diff --git a/tp/t/input_files/formatting_customizations_input.texi
b/tp/t/input_files/formatting_customizations_input.texi
new file mode 100644
index 0000000000..32c5442ca8
--- /dev/null
+++ b/tp/t/input_files/formatting_customizations_input.texi
@@ -0,0 +1,8 @@
+@node Top
+@top top
+
+@node chapt
+@chapter Chap
+
+@AA{} @equiv{} @@ @copyright{}
+
diff --git
a/tp/t/results/converters_tests/reference_for_formatting_customizations.pl
b/tp/t/results/converters_tests/reference_for_formatting_customizations.pl
new file mode 100644
index 0000000000..1c35f0522e
--- /dev/null
+++ b/tp/t/results/converters_tests/reference_for_formatting_customizations.pl
@@ -0,0 +1,409 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'reference_for_formatting_customizations'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 1
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 2
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chapt'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chapt'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'AA',
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'text' => ' '
+ },
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'equiv',
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'text' => ' '
+ },
+ {
+ 'cmdname' => '@'
+ },
+ {
+ 'text' => ' '
+ },
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'copyright',
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 5
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'reference_for_formatting_customizations'} = '@node Top
+@top top
+
+@node chapt
+@chapter Chap
+
+@AA{} @equiv{} @@ @copyright{}
+
+';
+
+
+$result_texts{'reference_for_formatting_customizations'} = 'top
+***
+
+1 Chap
+******
+
+AA == @ (C)
+
+';
+
+$result_sectioning{'reference_for_formatting_customizations'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chapt'
+ }
+ },
+ 'section_directions' => {
+ 'up' => {}
+ },
+ 'section_level' => 1,
+ 'section_number' => '1',
+ 'toplevel_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ }
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'sectioning_root' => {},
+ 'toplevel_directions' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'reference_for_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'reference_for_formatting_customizations'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'reference_for_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'prev'}
=
$result_sectioning{'reference_for_formatting_customizations'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'reference_for_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'up'}
=
$result_sectioning{'reference_for_formatting_customizations'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'reference_for_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'reference_for_formatting_customizations'};
+
+$result_nodes{'reference_for_formatting_customizations'} = [
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {}
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '1'
+ }
+ },
+ 'node_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'chapt'
+ }
+ }
+ },
+ 'normalized' => 'Top'
+ }
+ },
+ {}
+];
+$result_nodes{'reference_for_formatting_customizations'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'reference_for_formatting_customizations'}[0];
+$result_nodes{'reference_for_formatting_customizations'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'reference_for_formatting_customizations'}[0];
+$result_nodes{'reference_for_formatting_customizations'}[1] =
$result_nodes{'reference_for_formatting_customizations'}[0]{'extra'}{'node_directions'}{'next'};
+
+$result_menus{'reference_for_formatting_customizations'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'chapt'
+ }
+ }
+];
+
+$result_errors{'reference_for_formatting_customizations'} = [];
+
+
+$result_floats{'reference_for_formatting_customizations'} = {};
+
+
+
+$result_converted{'plaintext'}->{'reference_for_formatting_customizations'} =
'top
+***
+
+1 Chap
+******
+
+Å ≡ @ ©
+
+';
+
+
+$result_converted{'html_text'}->{'reference_for_formatting_customizations'} =
'<div class="top-level-extent" id="Top">
+<div class="nav-panel">
+</div>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<ul class="mini-toc">
+<li><a href="#chapt" accesskey="1">Chap</a></li>
+</ul>
+<hr>
+<div class="chapter-level-extent" id="chapt">
+<div class="nav-panel">
+</div>
+<h2 class="chapter" id="Chap"><span>1 Chap<a class="copiable-link"
href="#Chap"> ¶</a></span></h2>
+
+<p>Å ≡ @ ©
+</p>
+</div>
+</div>
+';
+
+
+$result_converted{'xml'}->{'reference_for_formatting_customizations'} = '<node
name="Top" spaces=" "><nodename>Top</nodename><nodenext
automatic="on">chapt</nodenext></node>
+<top spaces=" "><sectiontitle>top</sectiontitle>
+
+</top>
+<node name="chapt" spaces=" "><nodename>chapt</nodename><nodeprev
automatic="on">Top</nodeprev><nodeup automatic="on">Top</nodeup></node>
+<chapter spaces=" "><sectiontitle>Chap</sectiontitle>
+
+<para>Å ≡ &arobase; ©right;
+</para>
+</chapter>
+';
+
+
+$result_converted{'docbook'}->{'reference_for_formatting_customizations'} =
'<chapter label="1" id="chapt">
+<title>Chap</title>
+
+<para>Å ≡ @ ©
+</para>
+</chapter>
+';
+
+
+$result_converted{'latex_text'}->{'reference_for_formatting_customizations'} =
'\\begin{document}
+\\label{anchor:Top}%
+\\chapter{{Chap}}
+\\label{anchor:chapt}%
+
+\\AA{} $\\equiv{}$ @ \\copyright{}
+
+';
+
+1;
diff --git a/tp/t/results/converters_tests/test_formatting_customizations.pl
b/tp/t/results/converters_tests/test_formatting_customizations.pl
new file mode 100644
index 0000000000..719b0f12da
--- /dev/null
+++ b/tp/t/results/converters_tests/test_formatting_customizations.pl
@@ -0,0 +1,409 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'test_formatting_customizations'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'type' => 'preamble_before_content'
+ }
+ ],
+ 'type' => 'before_node_section'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'Top'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 1
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'top'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'top',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {},
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 2
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'chapt'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'is_target' => 1,
+ 'normalized' => 'chapt'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 4
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Chap'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => {
+ 'text' => '
+'
+ }
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'chapter',
+ 'contents' => [
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'AA',
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'text' => ' '
+ },
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'equiv',
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'text' => ' '
+ },
+ {
+ 'cmdname' => '@'
+ },
+ {
+ 'text' => ' '
+ },
+ {
+ 'args' => [
+ {
+ 'type' => 'brace_command_arg'
+ }
+ ],
+ 'cmdname' => 'copyright',
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 7
+ }
+ },
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'paragraph'
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'extra' => {
+ 'section_number' => '1'
+ },
+ 'info' => {
+ 'spaces_before_argument' => {
+ 'text' => ' '
+ }
+ },
+ 'source_info' => {
+ 'file_name' => 'formatting_customizations_input.texi',
+ 'line_nr' => 5
+ }
+ }
+ ],
+ 'type' => 'document_root'
+};
+
+$result_texis{'test_formatting_customizations'} = '@node Top
+@top top
+
+@node chapt
+@chapter Chap
+
+@AA{} @equiv{} @@ @copyright{}
+
+';
+
+
+$result_texts{'test_formatting_customizations'} = 'top
+***
+
+1 Chap
+******
+
+AA == @ (C)
+
+';
+
+$result_sectioning{'test_formatting_customizations'} = {
+ 'extra' => {
+ 'section_childs' => [
+ {
+ 'cmdname' => 'top',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ 'section_childs' => [
+ {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'associated_node' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'normalized' => 'chapt'
+ }
+ },
+ 'section_directions' => {
+ 'up' => {}
+ },
+ 'section_level' => 1,
+ 'section_number' => '1',
+ 'toplevel_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ }
+ }
+ }
+ ],
+ 'section_level' => 0,
+ 'sectioning_root' => {},
+ 'toplevel_directions' => {}
+ }
+ }
+ ],
+ 'section_level' => -1
+ }
+};
+$result_sectioning{'test_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'section_directions'}{'up'}
=
$result_sectioning{'test_formatting_customizations'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'test_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'prev'}
=
$result_sectioning{'test_formatting_customizations'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'test_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'section_childs'}[0]{'extra'}{'toplevel_directions'}{'up'}
=
$result_sectioning{'test_formatting_customizations'}{'extra'}{'section_childs'}[0];
+$result_sectioning{'test_formatting_customizations'}{'extra'}{'section_childs'}[0]{'extra'}{'sectioning_root'}
= $result_sectioning{'test_formatting_customizations'};
+
+$result_nodes{'test_formatting_customizations'} = [
+ {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'top',
+ 'extra' => {}
+ },
+ 'node_directions' => {
+ 'next' => {
+ 'cmdname' => 'node',
+ 'extra' => {
+ 'associated_section' => {
+ 'cmdname' => 'chapter',
+ 'extra' => {
+ 'section_number' => '1'
+ }
+ },
+ 'node_directions' => {
+ 'prev' => {},
+ 'up' => {}
+ },
+ 'normalized' => 'chapt'
+ }
+ }
+ },
+ 'normalized' => 'Top'
+ }
+ },
+ {}
+];
+$result_nodes{'test_formatting_customizations'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'prev'}
= $result_nodes{'test_formatting_customizations'}[0];
+$result_nodes{'test_formatting_customizations'}[0]{'extra'}{'node_directions'}{'next'}{'extra'}{'node_directions'}{'up'}
= $result_nodes{'test_formatting_customizations'}[0];
+$result_nodes{'test_formatting_customizations'}[1] =
$result_nodes{'test_formatting_customizations'}[0]{'extra'}{'node_directions'}{'next'};
+
+$result_menus{'test_formatting_customizations'} = [
+ {
+ 'extra' => {
+ 'normalized' => 'Top'
+ }
+ },
+ {
+ 'extra' => {
+ 'normalized' => 'chapt'
+ }
+ }
+];
+
+$result_errors{'test_formatting_customizations'} = [];
+
+
+$result_floats{'test_formatting_customizations'} = {};
+
+
+
+$result_converted{'plaintext'}->{'test_formatting_customizations'} = 'top
+***
+
+Chap
+****
+
+Å == @ (C)
+
+';
+
+
+$result_converted{'html_text'}->{'test_formatting_customizations'} = '<div
class="top-level-extent" id="Top">
+<div class="nav-panel">
+</div>
+<h1 class="top" id="top"><span>top<a class="copiable-link" href="#top">
¶</a></span></h1>
+
+<ul class="mini-toc">
+<li><a href="#chapt" accesskey="1">Chap</a></li>
+</ul>
+<hr>
+<div class="chapter-level-extent" id="chapt">
+<div class="nav-panel">
+</div>
+<h2 class="chapter" id="Chap"><span>Chap<a class="copiable-link" href="#Chap">
¶</a></span></h2>
+
+<p>Å ≡ @ ©
+</p>
+</div>
+</div>
+';
+
+
+$result_converted{'xml'}->{'test_formatting_customizations'} = '<node
name="Top" spaces=" "><nodename>Top</nodename><nodenext
automatic="on">chapt</nodenext></node>
+<top spaces=" "><sectiontitle>top</sectiontitle>
+
+</top>
+<node name="chapt" spaces=" "><nodename>chapt</nodename><nodeprev
automatic="on">Top</nodeprev><nodeup automatic="on">Top</nodeup></node>
+<chapter spaces=" "><sectiontitle>Chap</sectiontitle>
+
+<para>Å ≡ &arobase; ©right;
+</para>
+</chapter>
+';
+
+
+$result_converted{'docbook'}->{'test_formatting_customizations'} = '<chapter
label="" id="chapt">
+<title>Chap</title>
+
+<para>Å ≡ @ ©
+</para>
+</chapter>
+';
+
+
+$result_converted{'latex_text'}->{'test_formatting_customizations'} =
'\\begin{document}
+\\label{anchor:Top}%
+\\chapter{{Chap}}
+\\label{anchor:chapt}%
+
+\\AA{} $\\equiv{}$ @ \\copyright{}
+
+';
+
+1;
diff --git a/tp/tests/Makefile.onetst b/tp/tests/Makefile.onetst
index ff7476021f..fa6bf081ac 100644
--- a/tp/tests/Makefile.onetst
+++ b/tp/tests/Makefile.onetst
@@ -34,6 +34,7 @@ type_base_one_test_files_generated_list = \
test_scripts/formatting_no_content_do_contents_inline.sh \
test_scripts/formatting_indices_in_begin_tables_lists.sh \
test_scripts/formatting_indices_in_begin_tables_lists_latex.sh \
+ test_scripts/formatting_formatting_customizations_input_raw_text.sh \
test_scripts/formatting_index_entries_relate_to_item.sh \
test_scripts/formatting_info_extension_warning.sh \
test_scripts/encoded_non_ascii_command_line.sh \
diff --git a/tp/tests/formatting/list-of-tests
b/tp/tests/formatting/list-of-tests
index 8a6d40cbd4..fc5dbde4ce 100644
--- a/tp/tests/formatting/list-of-tests
+++ b/tp/tests/formatting/list-of-tests
@@ -27,6 +27,10 @@ no_content_do_contents_inline no_content.texi --html
--no-split -c 'BIG_RULE <hr
indices_in_begin_tables_lists indices_in_begin_tables_lists.texi --html
--no-split -c 'USE_NODES 0'
indices_in_begin_tables_lists_latex indices_in_begin_tables_lists.texi --latex
+# Same file also tested in t/converters_tests.t. Here we test customization
+# of raw text output, as this output is not customized in t/*.t tests.
+formatting_customizations_input_raw_text
../../t/input_files/formatting_customizations_input.texi -c
TEXINFO_OUTPUT_FORMAT=rawtext -c NUMBER_SECTIONS=0 -c ASCII_GLYPH=1
--enable-encoding
+
# tests of the tree using the same input file are also in t/transformations.t
# but it is interesting to have automatic tree transformations tested here too.
index_entries_relate_to_item index_entries_relate_to_item.texi --html
--no-split
diff --git
a/tp/tests/formatting/res_parser/formatting_customizations_input_raw_text/formatting_customizations_input.1
b/tp/tests/formatting/res_parser/formatting_customizations_input_raw_text/formatting_customizations_input.1
new file mode 100644
index 0000000000..e69de29bb2
diff --git
a/tp/tests/formatting/res_parser/formatting_customizations_input_raw_text/formatting_customizations_input.2
b/tp/tests/formatting/res_parser/formatting_customizations_input_raw_text/formatting_customizations_input.2
new file mode 100644
index 0000000000..e69de29bb2
diff --git
a/tp/tests/formatting/res_parser/formatting_customizations_input_raw_text/formatting_customizations_input.txt
b/tp/tests/formatting/res_parser/formatting_customizations_input_raw_text/formatting_customizations_input.txt
new file mode 100644
index 0000000000..3a119b2de1
--- /dev/null
+++
b/tp/tests/formatting/res_parser/formatting_customizations_input_raw_text/formatting_customizations_input.txt
@@ -0,0 +1,8 @@
+top
+***
+
+Chap
+****
+
+Å == @ (C)
+
diff --git
a/tp/tests/test_scripts/formatting_formatting_customizations_input_raw_text.sh
b/tp/tests/test_scripts/formatting_formatting_customizations_input_raw_text.sh
new file mode 100755
index 0000000000..714a025c59
--- /dev/null
+++
b/tp/tests/test_scripts/formatting_formatting_customizations_input_raw_text.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+# This file generated by maintain/regenerate_cmd_tests.sh
+
+if test z"$srcdir" = "z"; then
+ srcdir=.
+fi
+
+one_test_logs_dir=test_log
+
+
+dir=formatting
+name='formatting_customizations_input_raw_text'
+mkdir -p $dir
+
+"$srcdir"/run_parser_all.sh -dir $dir $name
+exit_status=$?
+cat $dir/$one_test_logs_dir/$name.log
+exit $exit_status
+