[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Tue, 16 Apr 2024 09:49:11 -0400 (EDT) |
branch: master
commit c9aa2ed54ed0ff502b6f9ae31f6d0213a12d496e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Tue Apr 16 13:57:16 2024 +0200
* tp/Texinfo/Document.pm (get_conf): remove warning if options are
initialized in get_conf call. Add a TODO and a comment.
---
ChangeLog | 5 +++++
Pod-Simple-Texinfo/TODO | 18 ++++++++++++++++++
tp/Texinfo/Document.pm | 24 ++++++++++++++++++++++--
3 files changed, 45 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 94cfa6587c..8a7a101a9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-04-16 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Document.pm (get_conf): remove warning if options are
+ initialized in get_conf call. Add a TODO and a comment.
+
2024-04-16 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/structuring_transfo/StructuringTransfoXS.xs
diff --git a/Pod-Simple-Texinfo/TODO b/Pod-Simple-Texinfo/TODO
new file mode 100644
index 0000000000..aa7fe9cef2
--- /dev/null
+++ b/Pod-Simple-Texinfo/TODO
@@ -0,0 +1,18 @@
+This is the todo list for Pod-Simple-Texinfo
+
+ Copyright 2012-2024 Free Software Foundation.
+
+ Copying and distribution of this file, with or without modification,
+ are permitted in any medium without royalty provided the copyright
+ notice and this notice are preserved.
+
+
+Add tests of pod2texi.pl. The tests of the module are fine, but in
+pod2texi.pl the Texinfo output is completed with menus and modified to
+be valid Texinfo, which mobilize code that is not tested in that
+configuration.
+
+It is not clear how this can be done in Perl modules infrastructure,
+but it could be done with automake infrastructure.
+
+Tests in manual_tests/ should be in the test suite.
diff --git a/tp/Texinfo/Document.pm b/tp/Texinfo/Document.pm
index 9279d4b90d..258965972a 100644
--- a/tp/Texinfo/Document.pm
+++ b/tp/Texinfo/Document.pm
@@ -26,6 +26,8 @@ use warnings;
# To check if there is no erroneous autovivification
#no autovivification qw(fetch delete exists store strict);
+use Carp qw(cluck);
+
use Texinfo::DocumentXS;
use Texinfo::XSLoader;
@@ -219,7 +221,7 @@ sub registrar($)
return $self->{'registrar'};
}
-# Should be for options used in structuring.
+# Useful for options used in structuring/tree transformations.
sub register_document_options($$)
{
my $self = shift;
@@ -234,7 +236,25 @@ sub get_conf($$)
my $var = shift;
if (!$self->{'options'}) {
- print STDERR "WARNING: $var: Document get_conf uninitialized options\n";
+ # This may happen if a tree/document is manipulated without having
+ # any configuration set. This is or was the case for pod2texi.
+ # TODO it is not clear yet whether allowing document options not to be set
+ # at all is right or wrong:
+ # In favor
+ # * it would be a good thing if the output was correct with undef set
+ # for each of the structuring options.
+ # * not having to worry about setting customization information
+ # at all allows writing simpler code.
+ # Against
+ # * it guards against having forgotten to setup customization
+ # variables
+ # * it forces writers of code using a document object to think about
+ # which customization should be set or not
+ # * it is very easy to setup options as an empty hash, which removes
+ # the warning but has not other effect, once one is confident that
+ # the result obtained with all the customization variables unset is ok
+ #print STDERR "DEBUG: $var: Document get_conf uninitialized options\n";
+ #cluck();
return undef;
}
return $self->{'options'}->{$var};