texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/texi2any.c (long_options, main):


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/texi2any.c (long_options, main): change the mimick option to only reset the program_file name, and have it change it as soon as the option is encountered.
Date: Wed, 01 Jan 2025 19:00:25 -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 b29527ade2 * tp/Texinfo/XS/texi2any.c (long_options, main): change the 
mimick option to only reset the program_file name, and have it change it as 
soon as the option is encountered.
b29527ade2 is described below

commit b29527ade29026307e05dcb83332d8df466f1745
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Jan 2 01:00:27 2025 +0100

    * tp/Texinfo/XS/texi2any.c (long_options, main): change the mimick
    option to only reset the program_file name, and have it change it as
    soon as the option is encountered.
    
    * tp/ctexi2any.pl: set the --mimick option to get texi2any in early
    messages.
---
 ChangeLog                |  9 +++++++++
 tp/Texinfo/XS/texi2any.c | 29 ++++++-----------------------
 tp/ctexi2any.pl          |  2 +-
 3 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 16ad2b9283..a620c6f332 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-01-01  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/texi2any.c (long_options, main): change the mimick
+       option to only reset the program_file name, and have it change it as
+       soon as the option is encountered.
+
+       * tp/ctexi2any.pl: set the --mimick option to get texi2any in early
+       messages.
+
 2025-01-01  Gavin Smith <gavinsmith0123@gmail.com>
 
        Index initials in PDF outline
diff --git a/tp/Texinfo/XS/texi2any.c b/tp/Texinfo/XS/texi2any.c
index 417cde6b15..c62eb21795 100644
--- a/tp/Texinfo/XS/texi2any.c
+++ b/tp/Texinfo/XS/texi2any.c
@@ -699,9 +699,6 @@ const char *input_file_suffixes[] = {
 /* Non-zero means demonstration mode */
 static int demonstration_p;
 
-/* Non-zero means mimick texi2any mode */
-static int mimick_p;
-
 /* If non-zero, show help and exit */
 static int print_help_p;
 
@@ -731,6 +728,7 @@ static int embed_interpreter_p;
 #define _FORMAT_OPT 21
 #define XML_OPT 22
 #define INTERNAL_LINKS_OPT 23
+#define MIMICK_OPT 24
 /* can add here */
 #define TRACE_INCLUDES_OPT 33
 #define NO_VERBOSE_OPT 34
@@ -761,7 +759,7 @@ static int embed_interpreter_p;
 static struct option long_options[] = {
   /* next not in texi2any */
   {"demonstration", 0, &demonstration_p, 1},
-  {"mimick", 0, &mimick_p, 1},
+  {"mimick", 0, 0, MIMICK_OPT},
   {"embed-interpreter", 0, &embed_interpreter_p, 1},
   {"no-embed-interpreter", 0, &embed_interpreter_p, -1},
 
@@ -1065,6 +1063,10 @@ main (int argc, char *argv[], char *env[])
         case XML_OPT:
           set_cmdline_format ("texinfoxml");
           break;
+        case MIMICK_OPT:
+          free (program_file);
+          program_file = strdup ("texi2any");
+          break;
         case 'c':
           get_cmdline_customization_option (&cmdline_options, optarg);
           break;
@@ -1978,25 +1980,6 @@ main (int argc, char *argv[], char *env[])
       add_option_value (&program_options, "PROGRAM_NAME_IN_FOOTER", 1, 0);
     }
 
-  if (mimick_p)
-    {
-      /* mimick texi2any.pl, under the assumption that
-         teximakehtml output will be compared to calls of in-source
-         texi2any.pl */
-      const char *configured_version = PACKAGE_VERSION_CONFIG "+dev";
-      const char *configured_name_version
-         = PACKAGE_NAME_CONFIG " " PACKAGE_VERSION_CONFIG "+dev";
-
-      free (program_file);
-      program_file = strdup ("texi2any");
-
-      add_option_value (&program_options, "PROGRAM", 0, program_file);
-      add_option_value (&program_options, "PACKAGE_VERSION", 0,
-                        configured_version);
-      add_option_value (&program_options, "PACKAGE_AND_VERSION", 0,
-                        configured_name_version);
-    }
-
   message_encoding_option
     = GNUT_get_conf (program_options.options->MESSAGE_ENCODING.number);
   if (message_encoding_option && message_encoding_option->o.string)
diff --git a/tp/ctexi2any.pl b/tp/ctexi2any.pl
index 51b11a4f37..a590cb92db 100755
--- a/tp/ctexi2any.pl
+++ b/tp/ctexi2any.pl
@@ -14,5 +14,5 @@ if (defined($top_srcdir)) {
   $command_dir = $command_directory;
   $ENV{'top_srcdir'} = "$command_dir/..";
 }
-exec("${command_dir}/Texinfo/XS/ctexi2any", @ARGV);
+exec("${command_dir}/Texinfo/XS/ctexi2any", '--mimick', @ARGV);
 



reply via email to

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