texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Convert/DocBook.pm Texi...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Convert/DocBook.pm Texi...
Date: Tue, 01 Nov 2011 00:53:27 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/11/01 00:53:26

Modified files:
        tp             : TODO 
        tp/Texinfo/Convert: DocBook.pm Plaintext.pm XML.pm 
        tp/t           : info_tests.t 
Added files:
        tp/t/include   : image_encoded.txt 
        tp/t/results/info_tests: image_text_encoded.pl 

Log message:
        Set the encoding of .txt image files in Plaintext.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.196&r2=1.197
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/DocBook.pm?cvsroot=texinfo&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.178&r2=1.179
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/XML.pm?cvsroot=texinfo&r1=1.50&r2=1.51
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/info_tests.t?cvsroot=texinfo&r1=1.34&r2=1.35
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/include/image_encoded.txt?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/image_text_encoded.pl?cvsroot=texinfo&rev=1.1

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.196
retrieving revision 1.197
diff -u -b -r1.196 -r1.197
--- TODO        31 Oct 2011 08:53:57 -0000      1.196
+++ TODO        1 Nov 2011 00:53:25 -0000       1.197
@@ -87,9 +87,6 @@
 
   put <title> in <articleinfo>?
 
-  what to do for guilsinglleft, guilsinglright? Currently &lt; &gt; since
-  there is no &lsaquo; nor &rsaquo;
-
 * to solve above issue (first issue), the definition arg formatted with
   simple_format should alo be passed down
 
@@ -98,6 +95,8 @@
   information that there is only one section to the functions formatting
   the page header and page footer.
 
+* how to handle @sc in docbook?
+
 Should more Converter ignore the last new line (with type 
 last_raw_newline) of a raw block format?
 

Index: Texinfo/Convert/DocBook.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/DocBook.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- Texinfo/Convert/DocBook.pm  31 Oct 2011 14:59:00 -0000      1.26
+++ Texinfo/Convert/DocBook.pm  1 Nov 2011 00:53:26 -0000       1.27
@@ -470,7 +470,6 @@
     } elsif ($root->{'cmdname'} eq 'today') {
       return $self->_convert(Texinfo::Common::expand_today($self));
     } elsif ($Texinfo::Common::accent_commands{$root->{'cmdname'}}) {
-      # FIXME handle in_upper_case
       return $self->convert_accents($root, \&docbook_accent);
     } elsif ($root->{'cmdname'} eq 'item' or $root->{'cmdname'} eq 'itemx'
              or $root->{'cmdname'} eq 'headitem' or $root->{'cmdname'} eq 
'tab') {

Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -b -r1.178 -r1.179
--- Texinfo/Convert/Plaintext.pm        30 Oct 2011 10:13:20 -0000      1.178
+++ Texinfo/Convert/Plaintext.pm        1 Nov 2011 00:53:26 -0000       1.179
@@ -813,7 +813,6 @@
       if ($top_section->{'level'} < $root_level);
   }
 
-  # FIXME return bytes count?
   my $result = '';
   my $lines_count = 0;
   # This is done like that because the tree may not be well formed if
@@ -949,20 +948,21 @@
   if (!defined($txt_file)) {
     return undef;
   } else {
-    if (open (TXT, $txt_file)) {
-    # FIXME encoding
-    # my $in_encoding = get_conf('IN_ENCODING');
-    # binmode(TXT, ":encoding($in_encoding)");
+    my $filehandle = do { local *FH };
+    if (open ($filehandle, $txt_file)) {
+      binmode($filehandle, ":encoding($self->{'perl_encoding'})")
+                if (defined($self->{'perl_encoding'}));
       my $result = '';
-      while (<TXT>) {
+      while (<$filehandle>) {
         $result .= $_;
       }
       # remove last end of line
       chomp ($result);
-      close (TXT);
+      close ($filehandle);
       return $result;
     } else {
-      $self->line_warn(sprintf($self->__("address@hidden file `%s' unreadable: 
%s"), $txt_file, $!), $root->{'line_nr'});
+      $self->line_warn(sprintf($self->__("address@hidden file `%s' unreadable: 
%s"), 
+                               $txt_file, $!), $root->{'line_nr'});
     }
   }
   return undef;
@@ -1422,7 +1422,7 @@
         $args[0] = [{'text' => ''}] if (!defined($args[0]));
 
         # normalize node name, to get a ref with the right formatting
-        # FIXME as a consequence, the line numbers appearing in case of errors
+        # NOTE as a consequence, the line numbers appearing in case of errors
         # correspond to the node lines numbers, and not the @ref.
         my $node_content;
         if ($root->{'extra'}

Index: Texinfo/Convert/XML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/XML.pm,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -b -r1.50 -r1.51
--- Texinfo/Convert/XML.pm      31 Oct 2011 18:04:30 -0000      1.50
+++ Texinfo/Convert/XML.pm      1 Nov 2011 00:53:26 -0000       1.51
@@ -201,7 +201,6 @@
 my %ignored_types;
 foreach my $type (#'empty_line_after_command',
             'empty_spaces_after_command', 
-            #'spaces_at_end',
             'empty_spaces_before_argument', 'empty_spaces_before_paragraph',
             'empty_spaces_after_close_brace', 
             'empty_space_at_end_def_bracketed',
@@ -914,8 +913,6 @@
   }
   if ($root->{'cmdname'} 
       and exists($Texinfo::Common::block_commands{$root->{'cmdname'}})) {
-    # FIXME The end of line and comment is taken into account 
-    # but 'space_at_end' is ignored.
     my $end_command = $root->{'extra'}->{'end_command'}; 
     if ($self->{'expanded_formats_hash'}->{$root->{'cmdname'}}
         and $root->{'cmdname'} eq 'xml') {

Index: t/info_tests.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/info_tests.t,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -b -r1.34 -r1.35
--- t/info_tests.t      1 Oct 2011 15:14:22 -0000       1.34
+++ t/info_tests.t      1 Nov 2011 00:53:26 -0000       1.35
@@ -194,6 +194,11 @@
 @image{fdotext,,,,ext}
 @image{f--ile,,,,ext}
 '],
+['image_text_encoded',
+'@documentencoding utf-8
+
address@hidden
+'],
 ['image_formatting',
 '@node Top
 

Index: t/include/image_encoded.txt
===================================================================
RCS file: t/include/image_encoded.txt
diff -N t/include/image_encoded.txt
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ t/include/image_encoded.txt 1 Nov 2011 00:53:26 -0000       1.1
@@ -0,0 +1 @@
+îmage encodée

Index: t/results/info_tests/image_text_encoded.pl
===================================================================
RCS file: t/results/info_tests/image_text_encoded.pl
diff -N t/results/info_tests/image_text_encoded.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ t/results/info_tests/image_text_encoded.pl  1 Nov 2011 00:53:26 -0000       
1.1
@@ -0,0 +1,144 @@
+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 
+   %result_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'image_text_encoded'} = {
+  'contents' => [
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'extra' => {
+                'command' => {}
+              },
+              'parent' => {},
+              'text' => ' ',
+              'type' => 'empty_spaces_after_command'
+            },
+            {
+              'parent' => {},
+              'text' => 'utf-8'
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'spaces_at_end'
+            }
+          ],
+          'parent' => {},
+          'type' => 'misc_line_arg'
+        }
+      ],
+      'cmdname' => 'documentencoding',
+      'extra' => {
+        'encoding_name' => 'utf-8',
+        'perl_encoding' => 'utf-8-strict',
+        'text_arg' => 'utf-8'
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 1,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'parent' => {},
+      'text' => '
+',
+      'type' => 'empty_line'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'image_encoded'
+            }
+          ],
+          'parent' => {},
+          'type' => 'brace_command_arg'
+        }
+      ],
+      'cmdname' => 'image',
+      'contents' => [],
+      'extra' => {
+        'brace_command_contents' => [
+          [
+            {}
+          ]
+        ]
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 3,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'parent' => {},
+      'text' => '
+'
+    }
+  ],
+  'type' => 'text_root'
+};
+$result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
 = $result_trees{'image_text_encoded'}{'contents'}[0];
+$result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0];
+$result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0];
+$result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0];
+$result_trees{'image_text_encoded'}{'contents'}[0]{'args'}[0]{'parent'} = 
$result_trees{'image_text_encoded'}{'contents'}[0];
+$result_trees{'image_text_encoded'}{'contents'}[0]{'parent'} = 
$result_trees{'image_text_encoded'};
+$result_trees{'image_text_encoded'}{'contents'}[1]{'parent'} = 
$result_trees{'image_text_encoded'};
+$result_trees{'image_text_encoded'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'image_text_encoded'}{'contents'}[2]{'args'}[0];
+$result_trees{'image_text_encoded'}{'contents'}[2]{'args'}[0]{'parent'} = 
$result_trees{'image_text_encoded'}{'contents'}[2];
+$result_trees{'image_text_encoded'}{'contents'}[2]{'extra'}{'brace_command_contents'}[0][0]
 = $result_trees{'image_text_encoded'}{'contents'}[2]{'args'}[0]{'contents'}[0];
+$result_trees{'image_text_encoded'}{'contents'}[2]{'parent'} = 
$result_trees{'image_text_encoded'};
+$result_trees{'image_text_encoded'}{'contents'}[3]{'parent'} = 
$result_trees{'image_text_encoded'};
+
+$result_texis{'image_text_encoded'} = '@documentencoding utf-8
+
address@hidden
+';
+
+
+$result_texts{'image_text_encoded'} = '
+image_encoded
+';
+
+$result_errors{'image_text_encoded'} = [];
+
+
+
+$result_converted{'info'}->{'image_text_encoded'} = 'This is , produced by 
makeinfo version 4.13 from .
+
+îmage encodée
+
+Tag Table:
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
+';
+
+$result_converted_errors{'info'}->{'image_text_encoded'} = [
+  {
+    'error_line' => 'warning: Document without nodes.
+',
+    'text' => 'Document without nodes.',
+    'type' => 'warning'
+  }
+];
+
+
+1;



reply via email to

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