texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp Texinfo/Common.pm Texinfo/Convert/Pl...


From: Patrice Dumas
Subject: texinfo/tp Texinfo/Common.pm Texinfo/Convert/Pl...
Date: Sat, 19 Mar 2011 16:20:32 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/03/19 16:20:32

Modified files:
        tp/Texinfo     : Common.pm 
        tp/Texinfo/Convert: Plaintext.pm 
        tp/t           : 02coverage.t 03coverage_braces.t 16raw.t 
                         20preformatted.t 
        tp/t/results/coverage_braces: uref_url.pl 
        tp/t/results/raw: misc_raw.pl 
Added files:
        tp/t/results/coverage: accent_and_dash.pl 
        tp/t/results/preformatted: quote_dash_in_display.pl 

Log message:
        Don't keep dash and quotes in @display and @format.
        Format second arg of uref/url when there is only this argument.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.119&r2=1.120
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/03coverage_braces.t?cvsroot=texinfo&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/16raw.t?cvsroot=texinfo&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/20preformatted.t?cvsroot=texinfo&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage/accent_and_dash.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/coverage_braces/uref_url.pl?cvsroot=texinfo&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/preformatted/quote_dash_in_display.pl?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/raw/misc_raw.pl?cvsroot=texinfo&r1=1.17&r2=1.18

Patches:
Index: Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- Texinfo/Common.pm   19 Mar 2011 00:04:27 -0000      1.22
+++ Texinfo/Common.pm   19 Mar 2011 16:20:30 -0000      1.23
@@ -395,6 +395,12 @@
   $preformatted_commands{$preformatted_command} = 1;
 }
 
+our %preformatted_code_commands;
+foreach my $preformatted_command(
+    'example', 'smallexample', 'lisp', 'smalllisp') {
+  $preformatted_code_commands{$preformatted_command} = 1;
+}
+
 our %raw_commands;
 our @out_formats = ('html', 'tex', 'xml', 'docbook');
 # macro/rmacro are special

Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -b -r1.119 -r1.120
--- Texinfo/Convert/Plaintext.pm        19 Mar 2011 14:53:08 -0000      1.119
+++ Texinfo/Convert/Plaintext.pm        19 Mar 2011 16:20:30 -0000      1.120
@@ -92,6 +92,7 @@
 my %raw_commands = %Texinfo::Common::raw_commands;
 my @out_formats = @Texinfo::Common::out_formats;
 my %code_style_commands       = %Texinfo::Common::code_style_commands;
+my %preformatted_code_commands = %Texinfo::Common::preformatted_code_commands;
 
 foreach my $def_command (keys(%def_commands)) {
   $formatting_misc_commands{$def_command} = 1 if 
($misc_commands{$def_command});
@@ -620,7 +621,7 @@
     foreach my $context (reverse(@{$self->{'context'}})) {
       if ($menu_commands{$context}) {
         last;
-      } elsif ($self->{'preformatted_context_commands'}->{$context}) {
+      } elsif ($preformatted_code_commands{$context}) {
         $formatter->{'preformatted'} = 1;
         last;
       }
@@ -1453,6 +1454,10 @@
                                         {'url' => $url});
             unshift @{$self->{'current_contents'}->[-1]}, $prepended
           }
+        } elsif (scalar(@{$root->{'extra'}->{'brace_command_contents'}}) == 2
+                 and 
defined($root->{'extra'}->{'brace_command_contents'}->[1])) {
+          unshift @{$self->{'current_contents'}->[-1]}, 
+            {'contents' => $root->{'extra'}->{'brace_command_contents'}->[1]};
         }
       }
       return '';

Index: t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- t/02coverage.t      19 Mar 2011 14:53:08 -0000      1.45
+++ t/02coverage.t      19 Mar 2011 16:20:31 -0000      1.46
@@ -16,6 +16,8 @@
 ['lettered_accent_and_spaces',
 '@ringaccent    a
 '],
+['accent_and_dash',
+'@^{a--}'],
 ['math',
 'Simple math
 @math{--{x^i}\over{\tan y}}

Index: t/03coverage_braces.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/03coverage_braces.t,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- t/03coverage_braces.t       19 Mar 2011 09:24:16 -0000      1.32
+++ t/03coverage_braces.t       19 Mar 2011 16:20:31 -0000      1.33
@@ -19,14 +19,14 @@
 '],
 ['uref_url',
 '@uref{--a,--b}
address@hidden
address@hidden,--b}
address@hidden,--b,--c}
address@hidden,--b,--c}
address@hidden,,--c}
address@hidden,,--c}
address@hidden,--b}
address@hidden,--b,--c}
address@hidden
address@hidden,--d}
address@hidden,--f,--g}
address@hidden,--h,--i}
address@hidden,,--k}
address@hidden,,--l}
address@hidden,--n}
address@hidden,--p,--q}
 '],
 ['nested', 'type the characters @kbd{l o g o u t @key{RET}}.'],
 ['nested_args', '@xref{@@ @samp{in samp}, descr @b{in b}, address@hidden, 

Index: t/16raw.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/16raw.t,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- t/16raw.t   6 Mar 2011 23:52:42 -0000       1.15
+++ t/16raw.t   19 Mar 2011 16:20:31 -0000      1.16
@@ -20,7 +20,7 @@
 @end tex
 
 @verbatim
-in verbatim
+in  v---erbatim``
 in verbatim2
 @end verbatim
 '],

Index: t/20preformatted.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/20preformatted.t,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- t/20preformatted.t  15 Mar 2011 20:29:12 -0000      1.8
+++ t/20preformatted.t  19 Mar 2011 16:20:31 -0000      1.9
@@ -17,6 +17,13 @@
 
 @end example
 '],
+['quote_dash_in_display',
+'
address@hidden
+and now -- yes---now and ``so\'\'.
+
address@hidden display
+'],
 ['text_on_command_line',
 '@example text on line
 @end example

Index: t/results/coverage_braces/uref_url.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/coverage_braces/uref_url.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- t/results/coverage_braces/uref_url.pl       6 Mar 2011 14:44:01 -0000       
1.4
+++ t/results/coverage_braces/uref_url.pl       19 Mar 2011 16:20:31 -0000      
1.5
@@ -61,7 +61,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--a'
+                  'text' => '--c'
                 }
               ],
               'parent' => {},
@@ -100,7 +100,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--b'
+                  'text' => '--d'
                 }
               ],
               'parent' => {},
@@ -135,7 +135,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--a'
+                  'text' => '--e'
                 }
               ],
               'parent' => {},
@@ -145,7 +145,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--b'
+                  'text' => '--f'
                 }
               ],
               'parent' => {},
@@ -155,7 +155,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--c'
+                  'text' => '--g'
                 }
               ],
               'parent' => {},
@@ -200,7 +200,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--b'
+                  'text' => '--h'
                 }
               ],
               'parent' => {},
@@ -210,7 +210,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--c'
+                  'text' => '--i'
                 }
               ],
               'parent' => {},
@@ -248,7 +248,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--a'
+                  'text' => '--j'
                 }
               ],
               'parent' => {},
@@ -263,7 +263,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--c'
+                  'text' => '--k'
                 }
               ],
               'parent' => {},
@@ -311,7 +311,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--c'
+                  'text' => '--l'
                 }
               ],
               'parent' => {},
@@ -347,7 +347,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--a'
+                  'text' => '--m'
                 }
               ],
               'parent' => {},
@@ -357,7 +357,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--b'
+                  'text' => '--n'
                 }
               ],
               'parent' => {},
@@ -394,7 +394,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--a'
+                  'text' => '--o'
                 }
               ],
               'parent' => {},
@@ -404,7 +404,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--b'
+                  'text' => '--p'
                 }
               ],
               'parent' => {},
@@ -414,7 +414,7 @@
               'contents' => [
                 {
                   'parent' => {},
-                  'text' => '--c'
+                  'text' => '--q'
                 }
               ],
               'parent' => {},
@@ -532,33 +532,33 @@
 $result_trees{'uref_url'}{'contents'}[0]{'parent'} = $result_trees{'uref_url'};
 
 $result_texis{'uref_url'} = '@uref{--a,--b}
address@hidden
address@hidden,--b}
address@hidden,--b,--c}
address@hidden,--b,--c}
address@hidden,,--c}
address@hidden,,--c}
address@hidden,--b}
address@hidden,--b,--c}
address@hidden
address@hidden,--d}
address@hidden,--f,--g}
address@hidden,--h,--i}
address@hidden,,--k}
address@hidden,,--l}
address@hidden,--n}
address@hidden,--p,--q}
 ';
 
 
 $result_texts{'uref_url'} = '--a
---a
+--c
 
---a
+--e
 
---a
+--j
 
---a
---a
+--m
+--o
 ';
 
 $result_errors{'uref_url'} = [];
 
 
 
-$result_converted{'plaintext'}->{'uref_url'} = '-b (--a) `--a\' -c -c -c -c -b 
(--a) -c
+$result_converted{'plaintext'}->{'uref_url'} = '-b (--a) `--c\' -d -g -i -k -l 
-n (--m) -q
 ';
 
 1;

Index: t/results/raw/misc_raw.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/raw/misc_raw.pl,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- t/results/raw/misc_raw.pl   6 Mar 2011 14:44:08 -0000       1.17
+++ t/results/raw/misc_raw.pl   19 Mar 2011 16:20:32 -0000      1.18
@@ -91,7 +91,7 @@
         },
         {
           'parent' => {},
-          'text' => 'in verbatim
+          'text' => 'in  v---erbatim``
 ',
           'type' => 'raw'
         },
@@ -143,7 +143,7 @@
 @end tex
 
 @verbatim
-in verbatim
+in  v---erbatim``
 in verbatim2
 @end verbatim
 ';
@@ -152,7 +152,7 @@
 $result_texts{'misc_raw'} = '
 
 
-in verbatim
+in  v---erbatim``
 in verbatim2
 ';
 
@@ -161,7 +161,7 @@
 
 
 $result_converted{'plaintext'}->{'misc_raw'} = '
-in verbatim
+in  v---erbatim``
 in verbatim2
 ';
 

Index: t/results/coverage/accent_and_dash.pl
===================================================================
RCS file: t/results/coverage/accent_and_dash.pl
diff -N t/results/coverage/accent_and_dash.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ t/results/coverage/accent_and_dash.pl       19 Mar 2011 16:20:31 -0000      
1.1
@@ -0,0 +1,57 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors);
+
+use utf8;
+
+$result_trees{'accent_and_dash'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'parent' => {},
+                  'text' => 'a--'
+                }
+              ],
+              'parent' => {},
+              'type' => 'brace_command_arg'
+            }
+          ],
+          'cmdname' => '^',
+          'contents' => [],
+          'line_nr' => {
+            'file_name' => '',
+            'line_nr' => 1,
+            'macro' => ''
+          },
+          'parent' => {}
+        }
+      ],
+      'parent' => {},
+      'type' => 'paragraph'
+    }
+  ],
+  'type' => 'text_root'
+};
+$result_trees{'accent_and_dash'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'accent_and_dash'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'accent_and_dash'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
 = $result_trees{'accent_and_dash'}{'contents'}[0]{'contents'}[0];
+$result_trees{'accent_and_dash'}{'contents'}[0]{'contents'}[0]{'parent'} = 
$result_trees{'accent_and_dash'}{'contents'}[0];
+$result_trees{'accent_and_dash'}{'contents'}[0]{'parent'} = 
$result_trees{'accent_and_dash'};
+
+$result_texis{'accent_and_dash'} = '@^{a--}';
+
+
+$result_texts{'accent_and_dash'} = 'a--^';
+
+$result_errors{'accent_and_dash'} = [];
+
+
+
+$result_converted{'plaintext'}->{'accent_and_dash'} = 'a--^
+';
+
+1;

Index: t/results/preformatted/quote_dash_in_display.pl
===================================================================
RCS file: t/results/preformatted/quote_dash_in_display.pl
diff -N t/results/preformatted/quote_dash_in_display.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ t/results/preformatted/quote_dash_in_display.pl     19 Mar 2011 16:20:32 
-0000      1.1
@@ -0,0 +1,128 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors);
+
+use utf8;
+
+$result_trees{'quote_dash_in_display'} = {
+  'contents' => [
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'cmdname' => 'display',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line_after_command'
+        },
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'and now -- yes---now and ``so\'\'.
+'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'empty_line'
+            }
+          ],
+          'parent' => {},
+          'type' => 'preformatted'
+        },
+        {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'parent' => {},
+                  'text' => ' ',
+                  'type' => 'empty_spaces_after_command'
+                },
+                {
+                  'parent' => {},
+                  'text' => 'display'
+                },
+                {
+                  'parent' => {},
+                  'text' => '
+',
+                  'type' => 'spaces_at_end'
+                }
+              ],
+              'parent' => {},
+              'type' => 'misc_line_arg'
+            }
+          ],
+          'cmdname' => 'end',
+          'extra' => {
+            'command' => {},
+            'command_argument' => 'display',
+            'text_arg' => 'display'
+          },
+          'line_nr' => {
+            'file_name' => '',
+            'line_nr' => 5,
+            'macro' => ''
+          },
+          'parent' => {}
+        }
+      ],
+      'extra' => {
+        'end_command' => {}
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 2,
+        'macro' => ''
+      },
+      'parent' => {}
+    }
+  ],
+  'type' => 'text_root'
+};
+$result_trees{'quote_dash_in_display'}{'contents'}[0]{'parent'} = 
$result_trees{'quote_dash_in_display'};
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[0]{'parent'} 
= $result_trees{'quote_dash_in_display'}{'contents'}[1];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[1];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[1]{'contents'}[1]{'parent'}
 = $result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[1];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[1]{'parent'} 
= $result_trees{'quote_dash_in_display'}{'contents'}[1];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'args'}[0];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'args'}[0]{'contents'}[1]{'parent'}
 = 
$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'args'}[0];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'args'}[0]{'contents'}[2]{'parent'}
 = 
$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'args'}[0];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'args'}[0]{'parent'}
 = $result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'extra'}{'command'}
 = $result_trees{'quote_dash_in_display'}{'contents'}[1];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2]{'parent'} 
= $result_trees{'quote_dash_in_display'}{'contents'}[1];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'extra'}{'end_command'} 
= $result_trees{'quote_dash_in_display'}{'contents'}[1]{'contents'}[2];
+$result_trees{'quote_dash_in_display'}{'contents'}[1]{'parent'} = 
$result_trees{'quote_dash_in_display'};
+
+$result_texis{'quote_dash_in_display'} = '
address@hidden
+and now -- yes---now and ``so\'\'.
+
address@hidden display
+';
+
+
+$result_texts{'quote_dash_in_display'} = '
+and now -- yes---now and ``so\'\'.
+
+';
+
+$result_errors{'quote_dash_in_display'} = [];
+
+
+
+$result_converted{'plaintext'}->{'quote_dash_in_display'} = '
+     and now - yes--now and "so".
+
+';
+
+1;



reply via email to

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