texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Convert/Line.pm Texinfo...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Convert/Line.pm Texinfo...
Date: Sat, 05 Nov 2011 16:36:50 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/11/05 16:36:50

Modified files:
        tp             : TODO 
        tp/Texinfo/Convert: Line.pm Paragraph.pm Plaintext.pm 
                            UnFilled.pm 
        tp/t/results/plaintext_tests: punctuation_abbr_acronym.pl 

Log message:
        If a perion follows a @abbr or @acronym it is always considerd to end a 
        sentence.
        
        The implementation is not very clean since it is achieved by prepending 
'a'
        to the current underlying_word...

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.214&r2=1.215
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Line.pm?cvsroot=texinfo&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Paragraph.pm?cvsroot=texinfo&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.185&r2=1.186
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/UnFilled.pm?cvsroot=texinfo&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/plaintext_tests/punctuation_abbr_acronym.pl?cvsroot=texinfo&r1=1.1&r2=1.2

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -b -r1.214 -r1.215
--- TODO        5 Nov 2011 09:30:10 -0000       1.214
+++ TODO        5 Nov 2011 16:36:49 -0000       1.215
@@ -9,25 +9,33 @@
 Bugs
 ====
 
-sectioning/next_in_menu_is_below there should certainly be a warning for
+(A) sectioning/next_in_menu_is_below there should certainly be a warning for
 the subsection that is both below and next the section, because it is 
 next in menu.  Bug or not?
 
-The result of
-  @abbr{AAA}. And text.
-is not right, space should be doubled after @abbr{AAA}, test in
-plaintext_tests/punctuation_abbr_acronym
+In singular manual, the first node is the Top node, it has no associated
+sectioning command.  The up_section for this node is set to the first
+sectioning element, the Preface, which is also associated with that node but
+is below, and maybe they are in the same element?  In any case it seems to
+be wrong.
 
-There should be a warning for something like
address@hidden text
-...
+
+Delayed bugs
+============
+
+Punctuation and spaces before @image do not lead to a doubling of space.
+In fact @image is completly formatted outside of usual formatting containers.
+Not sure what should be the right way?
+test in info_test/image_and_punctuation
 
 Instead of _set_global_multiple_commands and _unset_global_multiple_commands
 have a better granularity and do something per command, with the possibility
 to really revert everything, including things that are not set by set_conf.
 (There is a FIXME in the code).
 
-Punctuation and spaces before @image do not lead to a doubling of space.
+There should be a warning for something like
address@hidden text
+...
 
 Following should be an error:
 @example
@@ -43,12 +51,6 @@
 listoffloats;  Line numbers are right, though, so maybe this is not
 an issue.
 
-In singular manual, the first node is the Top node, it has no associated
-sectioning command.  The up_section for this node is set to the first
-sectioning element, the Preface, which is also associated with that node but
-is below, and maybe they are in the same element?  In any case it seems to
-be wrong.
-
 
 Missing tests
 =============

Index: Texinfo/Convert/Line.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Line.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- Texinfo/Convert/Line.pm     31 Oct 2011 14:59:01 -0000      1.24
+++ Texinfo/Convert/Line.pm     5 Nov 2011 16:36:49 -0000       1.25
@@ -214,6 +214,17 @@
   return $result;
 }
 
+sub add_underlying_text($$)
+{
+  my $line = shift;
+  my $underlying_text = shift;
+  if (defined($underlying_text)) {
+    $line->{'underlying_word'} = ''
+       if (!defined($line->{'underlying_word'}));
+    $line->{'underlying_word'} .= $underlying_text;
+  }
+}
+
 sub inhibit_end_sentence($)
 {
   my $line = shift;

Index: Texinfo/Convert/Paragraph.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Paragraph.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- Texinfo/Convert/Paragraph.pm        31 Oct 2011 14:59:01 -0000      1.25
+++ Texinfo/Convert/Paragraph.pm        5 Nov 2011 16:36:49 -0000       1.26
@@ -242,6 +242,17 @@
   return $result;
 }
 
+sub add_underlying_text($$)
+{
+  my $paragraph = shift;
+  my $underlying_text = shift;
+  if (defined($underlying_text)) {
+    $paragraph->{'underlying_word'} = ''
+       if (!defined($paragraph->{'underlying_word'}));
+    $paragraph->{'underlying_word'} .= $underlying_text;
+  }
+}
+
 sub inhibit_end_sentence($)
 {
   my $paragraph = shift;

Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -b -r1.185 -r1.186
--- Texinfo/Convert/Plaintext.pm        4 Nov 2011 19:02:30 -0000       1.185
+++ Texinfo/Convert/Plaintext.pm        5 Nov 2011 16:36:49 -0000       1.186
@@ -435,6 +435,7 @@
   my $context = shift;
   my $text = $command->{'text'};
 
+
   my $lower_case_text;
   if ($context->{'upper_case'}) {
     $lower_case_text = $text;
@@ -1101,6 +1102,8 @@
                                or $root->{'type'} eq 'last_raw_newline')) {
         $result = $self->_count_added($formatter->{'container'},
                     $formatter->{'container'}->add_next($root->{'text'}));
+      } elsif ($root->{'type'} and ($root->{'type'} eq 'underlying_text')) {
+        $formatter->{'container'}->add_underlying_text($root->{'text'});
       } else {
         my ($text, $lower_case_text) = $self->_process_text($root, $formatter);
         $result = $self->_count_added($formatter->{'container'},
@@ -1574,7 +1577,12 @@
           #print STDERR "".Data::Dumper->Dump([$prepended])."\n";
           unshift @{$self->{'current_contents'}->[-1]}, $prepended;
         } else {
-          unshift @{$self->{'current_contents'}->[-1]}, $argument;
+          # FIXME The underlying_text added is very ugly.  It leads to 'a'
+          # being prepended in the underlying word after the abbr or acronym,
+          # the intended effect being that a following period is always
+          # interpreted as ending a sentence.
+          unshift @{$self->{'current_contents'}->[-1]}, ($argument,
+                    {'type' => 'underlying_text', 'text' => 'a'});
         }
       }
       return '';

Index: Texinfo/Convert/UnFilled.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/UnFilled.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- Texinfo/Convert/UnFilled.pm 18 Oct 2011 20:13:28 -0000      1.11
+++ Texinfo/Convert/UnFilled.pm 5 Nov 2011 16:36:49 -0000       1.12
@@ -165,6 +165,12 @@
   return $result;
 }
 
+sub add_underlying_text($$)
+{
+  my $line = shift;
+  my $underlying_text = shift;
+}
+
 sub inhibit_end_sentence($)
 {
   my $line = shift;

Index: t/results/plaintext_tests/punctuation_abbr_acronym.pl
===================================================================
RCS file: 
/sources/texinfo/texinfo/tp/t/results/plaintext_tests/punctuation_abbr_acronym.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2



reply via email to

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