[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/Utils.pm (@month_name): use
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/Utils.pm (@month_name): use Texinfo::Common::gdt to mark strings at the same time as filling @month_name. |
Date: |
Thu, 22 Feb 2024 15:30:14 -0500 |
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 9804da7a2e * tp/Texinfo/Convert/Utils.pm (@month_name): use
Texinfo::Common::gdt to mark strings at the same time as filling @month_name.
9804da7a2e is described below
commit 9804da7a2e0b03a697bd0416f67adb214897efd7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Feb 22 21:30:08 2024 +0100
* tp/Texinfo/Convert/Utils.pm (@month_name): use Texinfo::Common::gdt
to mark strings at the same time as filling @month_name.
Update/change/remove some FIXME.
---
ChangeLog | 7 +++++
tp/TODO | 6 ++++
tp/Texinfo/Common.pm | 3 +-
tp/Texinfo/Convert/HTML.pm | 2 +-
tp/Texinfo/Convert/Utils.pm | 35 ++++++++--------------
tp/Texinfo/XS/convert/convert_html.c | 6 ++--
tp/Texinfo/XS/main/manipulate_tree.c | 3 +-
.../XS/structuring_transfo/StructuringTransfoXS.xs | 8 ++++-
8 files changed, 39 insertions(+), 31 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 33b202008b..2880f82202 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-02-22 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/Utils.pm (@month_name): use Texinfo::Common::gdt
+ to mark strings at the same time as filling @month_name.
+
+ Update/change/remove some FIXME.
+
2024-02-22 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/Utils.pm (expand_today): use cdt with converter.
diff --git a/tp/TODO b/tp/TODO
index 614b8754da..dae0059274 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -90,6 +90,12 @@ Gavin and Patrice
4) separate the structure of text elements and other elements, as text elements
should not need contents/args/extra.
+
+Maybe change build/rebuild document to only rebuild what needs to, such
+as to be able to call when needed by converters and not in specific
+places in the code.
+
+
hyphenation: should only appear in toplevel.
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index dde7b335ee..28408aeb3a 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -141,8 +141,7 @@ sub __p($$) {
#
# Return the string but do nothing else, used to mark strings to be translated
# in the Gettext framework.
-# Can be used in other modules, in particular if the modules already overwrite
-# gdt from Texinfo::Translations.
+# Can be used in other modules.
sub gdt($)
{
return $_[0];
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 5bc192e3f4..5c0d976f79 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -7171,7 +7171,7 @@ sub _convert_definfoenclose_type($$$$) {
$content = '' if (!defined($content));
# TODO add a span to mark the original command as a class?
- # Not to be done as long as the definfoenclose is deprecated.
+ # Not to be done as long as definfoenclose is deprecated.
return &{$self->formatting_function('format_protect_text')}($self,
$element->{'extra'}->{'begin'})
. $content .
diff --git a/tp/Texinfo/Convert/Utils.pm b/tp/Texinfo/Convert/Utils.pm
index 222ede4778..f4e122fc67 100644
--- a/tp/Texinfo/Convert/Utils.pm
+++ b/tp/Texinfo/Convert/Utils.pm
@@ -63,31 +63,20 @@ $VERSION = '7.1dev';
our @month_name =
(
- 'January', 'February', 'March', 'April', 'May',
- 'June', 'July', 'August', 'September', 'October',
- 'November', 'December'
+ Texinfo::Common::gdt('January'),
+ Texinfo::Common::gdt('February'),
+ Texinfo::Common::gdt('March'),
+ Texinfo::Common::gdt('April'),
+ Texinfo::Common::gdt('May'),
+ Texinfo::Common::gdt('June'),
+ Texinfo::Common::gdt('July'),
+ Texinfo::Common::gdt('August'),
+ Texinfo::Common::gdt('September'),
+ Texinfo::Common::gdt('October'),
+ Texinfo::Common::gdt('November'),
+ Texinfo::Common::gdt('December')
);
-# This is not used as code, but used to mark months as strings to be
-# translated
-if (0) {
- my $self;
- my @mark_month_for_translation = (
- $self->gdt('January'),
- $self->gdt('February'),
- $self->gdt('March'),
- $self->gdt('April'),
- $self->gdt('May'),
- $self->gdt('June'),
- $self->gdt('July'),
- $self->gdt('August'),
- $self->gdt('September'),
- $self->gdt('October'),
- $self->gdt('November'),
- $self->gdt('December')
- );
-}
-
# this method requires a converter.
sub expand_today($)
{
diff --git a/tp/Texinfo/XS/convert/convert_html.c
b/tp/Texinfo/XS/convert/convert_html.c
index 39b276b3c4..1d4c207ccc 100644
--- a/tp/Texinfo/XS/convert/convert_html.c
+++ b/tp/Texinfo/XS/convert/convert_html.c
@@ -7972,7 +7972,7 @@ word_number_more_than_level (const char *text, int level,
int *count)
*count = 1;
while (*p)
- {/* FIXME in perl unicode spaces are also matched */
+ {
int n = strspn (p, whitespace_chars);
if (n)
{
@@ -14039,7 +14039,9 @@ convert_definfoenclose_type (CONVERTER *self, const
enum element_type type,
const ELEMENT *element, const char *content,
TEXT *result)
{
- /* FIXME add a span to mark the original command as a class? */
+ /* TODO add a span to mark the original command as a class?
+ Not to be done as long as definfoenclose is deprecated. */
+
char *begin = lookup_extra_string (element, "begin");
char *end = lookup_extra_string (element, "end");
diff --git a/tp/Texinfo/XS/main/manipulate_tree.c
b/tp/Texinfo/XS/main/manipulate_tree.c
index ca92e02622..a47ae8c52c 100644
--- a/tp/Texinfo/XS/main/manipulate_tree.c
+++ b/tp/Texinfo/XS/main/manipulate_tree.c
@@ -835,8 +835,7 @@ modify_tree (ELEMENT *tree,
argument);
if (new_element)
{
- /* FIXME destroy previous element? or let (*operation)
- do it? */
+ /* *operation should take care of destroying removed element */
tree->source_mark_list.list[i]->element
= new_element->list[0];
destroy_list (new_element);
diff --git a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
index 6af6a301e9..52d1e7a7b5 100644
--- a/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
+++ b/tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
@@ -72,6 +72,8 @@ fill_gaps_in_sectioning (SV *tree_in, ...)
destroy_list (added_sections);
}
+# This is only used in tests, and not for all the tests, copy_treeNonXS is
+# more generally used because the C tree element cannot be found in general.
SV *
copy_tree (SV *tree_in)
PREINIT:
@@ -81,7 +83,11 @@ copy_tree (SV *tree_in)
if (document)
{
ELEMENT *result = copy_tree (document->tree);
- /* FIXME have a similar system but for trees only? */
+ /* document additional information, global info, labels, indices...
+ is not setup with copy_tree, so we only have the tree to store.
+ This is not different from the Perl code and, in general,
+ it is best that way.
+ */
int copy_document_descriptor = register_document (result, 0, 0, 0,
0, 0, 0, 0, 0, 0);
HV *hv = build_texinfo_tree (result, 0);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/Utils.pm (@month_name): use Texinfo::Common::gdt to mark strings at the same time as filling @month_name.,
Patrice Dumas <=