texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/Text.pm (text_heading, _text


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/Convert/Text.pm (text_heading, _text_heading): Rename with leading _ to indicate that this function is not called from outside the module any more. Fix spelling and grammar in a comment.
Date: Sat, 23 Dec 2023 16:40:38 -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 9669d21f73 * tp/Texinfo/Convert/Text.pm (text_heading, _text_heading): 
Rename with leading _ to indicate that this function is not called from outside 
the module any more.  Fix spelling and grammar in a comment.
9669d21f73 is described below

commit 9669d21f73eed068c7ffb53f9cff0412c6427e15
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Dec 23 21:40:20 2023 +0000

    * tp/Texinfo/Convert/Text.pm (text_heading, _text_heading):
    Rename with leading _ to indicate that this function is not
    called from outside the module any more.  Fix spelling and
    grammar in a comment.
---
 ChangeLog                  | 7 +++++++
 tp/Texinfo/Convert/Text.pm | 7 +++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 84a265513a..325a1449ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-12-23  Gavin Smith <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/Convert/Text.pm (text_heading, _text_heading):
+       Rename with leading _ to indicate that this function is not
+       called from outside the module any more.  Fix spelling and
+       grammar in a comment.
+
 2023-12-23  Gavin Smith <gavinsmith0123@gmail.com>
 
        Headings in Plaintext.pm
diff --git a/tp/Texinfo/Convert/Text.pm b/tp/Texinfo/Convert/Text.pm
index ad9e989368..1e20caf4c6 100644
--- a/tp/Texinfo/Convert/Text.pm
+++ b/tp/Texinfo/Convert/Text.pm
@@ -341,9 +341,8 @@ my %underline_symbol = (
   4 => '.'
 );
 
-# TODO not documented, used in other converters
 # Return the text of an underlined heading, possibly indented.
-sub text_heading($$$;$$)
+sub _text_heading($$$;$$)
 {
   my $current = shift;
   my $text = shift;
@@ -375,7 +374,7 @@ sub text_heading($$$;$$)
     $section_level = $current->{'extra'}->{'section_level'};
   }
   # $text is indented if indent_length is set, so $indent_length need to
-  # be substracted to have the width of heading only.
+  # be subtracted to have the width of the heading only.
   $result .= ($underline_symbol{$section_level}
      x (Texinfo::Convert::Unicode::string_width($text) - $indent_length))."\n";
   return $result;
@@ -712,7 +711,7 @@ sub _convert($;$)
         }
         if ($Texinfo::Commands::sectioning_heading_commands{
                                                     $element->{'cmdname'}}) {
-          $result = text_heading($element, $result, $options->{'converter'},
+          $result = _text_heading($element, $result, $options->{'converter'},
                                  $options->{'NUMBER_SECTIONS'});
         } else {
         # we always want an end of line even if is was eaten by a command



reply via email to

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