texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/Common.pm (add_valid_customization_o


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Common.pm (add_valid_customization_option), tp/Texinfo/Config.pm (texinfo_add_valid_customization_option), tp/init/highlight_syntax.pm (texinfo_add_valid_customization_option): Rename Texinfo::Common add_valid_option() as add_valid_customization_option() and Texinfo::Config texinfo_add_valid_option() as texinfo_add_valid_customization_option().
Date: Sat, 18 Dec 2021 06:31:44 -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 755c790  * tp/Texinfo/Common.pm (add_valid_customization_option), 
tp/Texinfo/Config.pm (texinfo_add_valid_customization_option), 
tp/init/highlight_syntax.pm (texinfo_add_valid_customization_option): Rename 
Texinfo::Common add_valid_option() as add_valid_customization_option() and 
Texinfo::Config texinfo_add_valid_option() as 
texinfo_add_valid_customization_option().
755c790 is described below

commit 755c79016a8eb5ff96ce929d987406d6e49f2bae
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Dec 18 12:31:30 2021 +0100

    * tp/Texinfo/Common.pm (add_valid_customization_option),
    tp/Texinfo/Config.pm (texinfo_add_valid_customization_option),
    tp/init/highlight_syntax.pm (texinfo_add_valid_customization_option):
    Rename Texinfo::Common add_valid_option() as
    add_valid_customization_option() and Texinfo::Config
    texinfo_add_valid_option() as
    texinfo_add_valid_customization_option().
    
    * tp/Texinfo/Config.pm: improve comments.
---
 ChangeLog                   | 13 +++++++++++
 tp/Texinfo/Common.pm        |  2 +-
 tp/Texinfo/Config.pm        | 54 +++++++++++++++++++++++++--------------------
 tp/init/highlight_syntax.pm |  2 +-
 4 files changed, 45 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 28221fd..e9610bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2021-12-17  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Common.pm (add_valid_customization_option),
+       tp/Texinfo/Config.pm (texinfo_add_valid_customization_option),
+       tp/init/highlight_syntax.pm (texinfo_add_valid_customization_option):
+       Rename Texinfo::Common add_valid_option() as
+       add_valid_customization_option() and Texinfo::Config
+       texinfo_add_valid_option() as
+       texinfo_add_valid_customization_option().
+
+       * tp/Texinfo/Config.pm: improve comments.
+
+
 2021-12-16  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (%defaults, _convert_xref_commands),
diff --git a/tp/Texinfo/Common.pm b/tp/Texinfo/Common.pm
index 2eb67dd..0ca2f04 100644
--- a/tp/Texinfo/Common.pm
+++ b/tp/Texinfo/Common.pm
@@ -399,7 +399,7 @@ sub valid_option($)
 
 # not documented on purpose, should not be called in user-defined
 # codes
-sub add_valid_option($)
+sub add_valid_customization_option($)
 {
   my $option = shift;
   if ($option =~ /^[A-Z][A-Z_]{2,}$/) {
diff --git a/tp/Texinfo/Config.pm b/tp/Texinfo/Config.pm
index f8a78ba..424785b 100644
--- a/tp/Texinfo/Config.pm
+++ b/tp/Texinfo/Config.pm
@@ -21,8 +21,8 @@
 # prefixed by GNUT_ while functions that can be called by user init
 # files codes are prefixed by texinfo_.
 # 
-# TODO document all texinfo_ in a pod section, but wait for stabilization
-# document that GNUT_, _GNUT_ and texinfo_ are reserved prefixes.
+# TODO document all texinfo_ in a pod section, but wait for stabilization.
+# Document that GNUT_, _GNUT_ and texinfo_ are reserved prefixes.
 
 package Texinfo::Config;
 
@@ -43,13 +43,14 @@ my $cmdline_options;
 my $main_program_default_options;
 my $init_files_options = {};
 
-# list options that can be set from main program are not
-# handled like string options.  Indeed, the lists need
-# to be defined in the main program, therefore the main
+# List options that can be set from main program are not
+# handled in the same way than string options.  Indeed, the
+# lists need to be defined in the main program, therefore the main
 # program list options would always take precedence
 # if there is a precedence, and the list options set from
-# init file would not have any effect. For list options, items
-# are added and removed by calls to texinfo_add_to_option_list
+# init file would never have any effect.
+# Therefore, for list options, items are added and removed by
+# calls to texinfo_add_to_option_list
 # and texinfo_remove_from_option_list, be it from command line
 # or init files, there is no precedence, but the order of calls
 # matter.
@@ -128,8 +129,8 @@ sub texinfo_set_from_init_file($$) {
     return 1;
   }
   if (!Texinfo::Common::valid_option($var)) {
-    # carp may be better, but infortunately, it points to the routine that 
-    # loads the file, and not to the init file.
+    # carp may be better, but infortunately, it points to the routine
+    # that loads the file, and not to the init file.
     _GNUT_document_warn(sprintf(__("%s: unknown variable %s"),
                                 'texinfo_set_from_init_file', $var));
     return 0;
@@ -229,17 +230,18 @@ sub texinfo_get_conf($)
 }
 
 # to dynamically add customization options from init files
-sub texinfo_add_valid_option($)
+sub texinfo_add_valid_customization_option($)
 {
   my $option = shift;
-  return Texinfo::Common::add_valid_option($option);
+  return Texinfo::Common::add_valid_customization_option($option);
 }
 
 
-#####################################################################
-# format API.  Handled differently from customization option because
-# a function from main program need to be called on formats, so
-# there is a function to get the value from main program.
+########################################################################
+# Output format API.  Handled differently from customization option
+# because a function from main program need to be called on formats, so
+# there is a function called from the main program to get the format set
+# by in the init file.
 
 my $init_file_format;
 sub texinfo_set_format_from_init_file($)
@@ -425,17 +427,21 @@ sub GNUT_get_style_command_formatting($;$)
 
 #####################################################################
 # the objective of this small package is to be in another
-# scope than init files, still have access to configuration
-# options, and setup blessed object that can call a
-# get_conf() and set_conf() method like parser or converter
-# that return the same as Texinfo::Config::texinfo_get_conf
-package Texinfo::MainConfig;
-
-# this is used in tests too.  In the tests nothing from
-# Texinfo::Config is used, and it is assumed that the
+# scope than init files and setup blessed objects that can call
+# get_conf() and set_conf() methods like a parser or a converter.
+#
+# For the main program, there is also the need to have
+# access to configuration options in order to have get_conf()
+# return the same as Texinfo::Config::texinfo_get_conf().
+# This is obtained by calling new() without argument.
+#
+# In tests the situation is different as nothing from the
+# Texinfo::Config space is used, it is assumed that the
 # configuration is available as a hash reference key
-# value, which is the case if new is called with an hash
+# value.  This is obtained by calling new() with an hash
 # reference argument.
+package Texinfo::MainConfig;
+
 
 my $additional_conf = {};
 
diff --git a/tp/init/highlight_syntax.pm b/tp/init/highlight_syntax.pm
index 6935be4..08630d7 100644
--- a/tp/init/highlight_syntax.pm
+++ b/tp/init/highlight_syntax.pm
@@ -33,7 +33,7 @@ my %languages_extensions = (
   'texinfo' => 'texi',
 );
 
-texinfo_add_valid_option('HIGHLIGHT_SYNTAX_DEFAULT');
+texinfo_add_valid_customization_option('HIGHLIGHT_SYNTAX_DEFAULT');
 
 texinfo_register_handler('structure', \&highlight_process);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]