texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/ParagraphNonXS.pm (set_space


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Convert/ParagraphNonXS.pm (set_space_protection, add_text): Rename 'space_protection' flag 'no_break' to reflect its function.
Date: Wed, 14 Dec 2022 14:00:41 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 3f1d2a0594 * tp/Texinfo/Convert/ParagraphNonXS.pm 
(set_space_protection, add_text): Rename 'space_protection' flag 'no_break' to 
reflect its function.
3f1d2a0594 is described below

commit 3f1d2a05947c49489d07401d02745ba1c9febdd6
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Wed Dec 14 19:00:30 2022 +0000

    * tp/Texinfo/Convert/ParagraphNonXS.pm
    (set_space_protection, add_text): Rename 'space_protection' flag
    'no_break' to reflect its function.
---
 ChangeLog                            |  6 ++++++
 tp/Texinfo/Convert/ParagraphNonXS.pm | 14 ++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index de4582df63..0facf7c7c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-12-14  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/ParagraphNonXS.pm
+       (set_space_protection, add_text): Rename 'space_protection' flag
+       'no_break' to reflect its function.
+
 2022-12-14  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * tp/texi2any.pl <.info filename check>: Do not use /r flag
diff --git a/tp/Texinfo/Convert/ParagraphNonXS.pm 
b/tp/Texinfo/Convert/ParagraphNonXS.pm
index 49e18a10f2..8f772cd6b7 100644
--- a/tp/Texinfo/Convert/ParagraphNonXS.pm
+++ b/tp/Texinfo/Convert/ParagraphNonXS.pm
@@ -269,13 +269,13 @@ sub allow_end_sentence($)
 sub set_space_protection($$;$$$$)
 {
   my $paragraph = shift;
-  my $space_protection = shift;
+  my $no_break = shift;
   my $ignore_columns = shift;
   my $keep_end_lines = shift;
   my $frenchspacing = shift;
   my $double_width_no_break = shift;
-  $paragraph->{'protect_spaces'} = $space_protection 
-    if defined($space_protection);
+  $paragraph->{'no_break'} = $no_break
+    if defined($no_break);
   $paragraph->{'ignore_columns'} = $ignore_columns
     if defined($ignore_columns);
   $paragraph->{'keep_end_lines'} = $keep_end_lines
@@ -285,7 +285,7 @@ sub set_space_protection($$;$$$$)
   $paragraph->{'double_width_no_break'} = $double_width_no_break
     if defined($double_width_no_break);
   # begin a word, to have something even if empty
-  if ($space_protection) {
+  if ($no_break) {
     _add_next($paragraph, '');
   }
 }
@@ -301,8 +301,6 @@ sub add_text($$)
   $paragraph->{'end_line_count'} = 0;
   my $result = '';
 
-  my $protect_spaces_flag = $paragraph->{'protect_spaces'};
-
   my @segments = split
     /(\s+)|(\p{InFullwidth})|((?:[^\s\p{InFullwidth}])+)/,
     $text;
@@ -341,7 +339,7 @@ sub add_text($$)
         $at_end_sentence = 1 if ($paragraph->{'end_sentence'} 
                                    and $paragraph->{'end_sentence'} > 0
                                    and !$paragraph->{'frenchspacing'});
-        if ($protect_spaces_flag) {
+        if ($paragraph->{'no_break'}) {
           if (substr($paragraph->{'word'}, -1) ne ' ') {
             my $new_spaces = $at_end_sentence ? '  ' : ' ';
             $paragraph->{'word'} .= $new_spaces;
@@ -432,7 +430,7 @@ sub add_text($$)
                                > $paragraph->{'max'}) {
         $result .= _cut_line($paragraph);
       }
-      if (!$paragraph->{'protect_spaces'}
+      if (!$paragraph->{'no_break'}
           and !$paragraph->{'double_width_no_break'}) {
         $result .= _add_pending_word($paragraph);
         $paragraph->{'space'} = '';



reply via email to

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