texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/main/document_types.h, tp/Texinfo


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/document_types.h, tp/Texinfo/XS/main/document.c (sorted_indices_by_index, sorted_indices_by_letter): remove F_DOCM_sorted_indices_by_*, it is not accurate and not useful.
Date: Sun, 14 Apr 2024 18:21:46 -0400

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 381a94a0ca * tp/Texinfo/XS/main/document_types.h, 
tp/Texinfo/XS/main/document.c (sorted_indices_by_index, 
sorted_indices_by_letter): remove F_DOCM_sorted_indices_by_*, it is not 
accurate and not useful.
381a94a0ca is described below

commit 381a94a0ca99c78355f747ea732d52e46029231c
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Apr 15 00:21:38 2024 +0200

    * tp/Texinfo/XS/main/document_types.h, tp/Texinfo/XS/main/document.c
    (sorted_indices_by_index, sorted_indices_by_letter): remove
    F_DOCM_sorted_indices_by_*, it is not accurate and not useful.
    
    * tp/Texinfo/XS/convert/ConvertXS.xs: add comments on caching
    built perl convert sorted_indices_by_*.
---
 ChangeLog                            |  9 +++++++++
 tp/Texinfo/XS/convert/ConvertXS.xs   | 25 +++++++++++++++++++++++++
 tp/Texinfo/XS/main/build_perl_info.c |  1 +
 tp/Texinfo/XS/main/document.c        |  4 ----
 tp/Texinfo/XS/main/document_types.h  |  2 --
 5 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e119222514..1277a3c6b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-04-14  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/document_types.h, tp/Texinfo/XS/main/document.c
+       (sorted_indices_by_index, sorted_indices_by_letter): remove
+       F_DOCM_sorted_indices_by_*, it is not accurate and not useful.
+
+       * tp/Texinfo/XS/convert/ConvertXS.xs: add comments on caching
+       built perl convert sorted_indices_by_*.
+
 2024-04-14  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/build_perl_info.c (BUILD_PERL_DOCUMENT_ITEM)
diff --git a/tp/Texinfo/XS/convert/ConvertXS.xs 
b/tp/Texinfo/XS/convert/ConvertXS.xs
index df1ab6fd67..5ac5ed495b 100644
--- a/tp/Texinfo/XS/convert/ConvertXS.xs
+++ b/tp/Texinfo/XS/convert/ConvertXS.xs
@@ -262,6 +262,16 @@ get_converter_indices_sorted_by_index (SV *converter_sv)
         RETVAL = 0;
         if (document_sv)
           {
+            /* TODO if the locale is not XS_STRXFRM_COLLATION_LOCALE
+               it could be relevant to store the output of
+               build_sorted_indices_by_index in
+                document_sv->{'sorted_indices_by_index'}->{$lang_key}
+               (as in perl) and get it from here instead of rebuilding,
+               such that the perl data is only built once and not for
+               each index/call to get_converter_indices_sorted_by_letter.
+
+               If TEXINFO_XS_CONVERT=1, this is called for Info output.
+             */
             SV *indices_information_sv
               = document_indices_information (*document_sv);
 
@@ -302,6 +312,21 @@ get_converter_indices_sorted_by_letter (SV *converter_sv)
         RETVAL = 0;
         if (document_sv)
           {
+            /* TODO if the locale is not XS_STRXFRM_COLLATION_LOCALE
+               it could be relevant to store the output of
+               build_sorted_indices_by_letter in
+                document_sv->{'sorted_indices_by_letter'}->{$lang_key}
+               (as in perl) and get it from here instead of rebuilding,
+               such that the perl data is only built once and not for
+               each index/call to get_converter_indices_sorted_by_letter.
+
+               This XS interface code is unlikely to be called, as it is
+               only for HTML and would correspond to a user calling
+               get_converter_indices_sorted_by_letter from perl, which
+               would be relevant mainly for reimplementing printindex
+               conversion, this is very improbable so there is no much
+               reason to implement something better.
+             */
             SV *indices_information_sv
               = document_indices_information (*document_sv);
 
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 3ba5d839a4..4c51d50b1e 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -2495,6 +2495,7 @@ build_sorted_indices_by_index (
           int entry_number = entry->number;
           char *message;
           SV *index_entry_sv;
+
           xasprintf (&message, "BUG: build_sorted_indices_by_index:"
                                " %s: entry %zu", idx->name, j);
           index_entry_sv
diff --git a/tp/Texinfo/XS/main/document.c b/tp/Texinfo/XS/main/document.c
index 0521023839..4e437620f5 100644
--- a/tp/Texinfo/XS/main/document.c
+++ b/tp/Texinfo/XS/main/document.c
@@ -293,8 +293,6 @@ sorted_indices_by_index (DOCUMENT *document,
         = sort_indices_by_index (document, error_messages, options,
                                  use_unicode_collation, collation_language,
                                  collation_locale);
-      /* TODO keep track of the precise sorted index that was modified */
-      document->modified_information |= F_DOCM_sorted_indices_by_index;
     }
   return collation_sorted_indices->sorted_indices;
 }
@@ -406,8 +404,6 @@ sorted_indices_by_letter (DOCUMENT *document,
         = sort_indices_by_letter (document, error_messages, options,
                                   use_unicode_collation, collation_language,
                                   collation_locale);
-      /* TODO keep track of the precise sorted index that was modified */
-      document->modified_information |= F_DOCM_sorted_indices_by_letter;
     }
   return collation_sorted_indices->sorted_indices;
 }
diff --git a/tp/Texinfo/XS/main/document_types.h 
b/tp/Texinfo/XS/main/document_types.h
index 49f05e2b1d..0dfbe7f161 100644
--- a/tp/Texinfo/XS/main/document_types.h
+++ b/tp/Texinfo/XS/main/document_types.h
@@ -44,8 +44,6 @@ struct TEXT_OPTIONS;
 #define F_DOCM_sections_list             0x0200
 #define F_DOCM_merged_indices            0x0400
 #define F_DOCM_indices_sort_strings      0x0800
-#define F_DOCM_sorted_indices_by_index   0x1000
-#define F_DOCM_sorted_indices_by_letter  0x2000
 
 enum error_type { MSG_error, MSG_warning,
                   MSG_document_error, MSG_document_warning };



reply via email to

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