texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/TexinfoMarkup.pm (_format_co


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/TexinfoMarkup.pm (_format_columnfractions) (_convert): add a separate function to format columnfractions command, _format_columnfractions(). Use that function to format a bogus @columnfractions out of @multitable.
Date: Fri, 02 Dec 2022 17:32:51 -0500

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

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new e114ca3745 * tp/Texinfo/Convert/TexinfoMarkup.pm 
(_format_columnfractions) (_convert): add a separate function to format 
columnfractions command, _format_columnfractions().  Use that function to 
format a bogus @columnfractions out of @multitable.
e114ca3745 is described below

commit e114ca37459c4788261ab14037033b5a3ce25dbf
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Dec 2 23:32:35 2022 +0100

    * tp/Texinfo/Convert/TexinfoMarkup.pm (_format_columnfractions)
    (_convert): add a separate function to format columnfractions command,
    _format_columnfractions().  Use that function to format a bogus
    @columnfractions out of @multitable.
---
 ChangeLog                                          | 18 ++++++++
 tp/Texinfo/Convert/TexinfoMarkup.pm                | 50 +++++++++++++---------
 tp/t/06columnfractions.t                           |  4 +-
 tp/t/results/columnfractions/out_of_multitable.pl  |  6 +++
 tp/t/results/coverage/commands.pl                  |  2 +-
 .../results/coverage/lettered_accent_and_spaces.pl | 16 +++----
 tp/t/results/formats_encodings/accent.pl           | 18 ++++----
 tp/t/results/formats_encodings/accentenc.pl        | 18 ++++----
 util/txixml2texi.pl                                |  1 -
 9 files changed, 83 insertions(+), 50 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e7d2f57c5f..eb2b066669 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2022-12-02  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (_format_columnfractions)
+       (_convert): add a separate function to format columnfractions command,
+       _format_columnfractions().  Use that function to format a bogus
+       @columnfractions out of @multitable.
+
+2022-12-01  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert), util/txixml2texi.pl,
+       util/texinfo.dtd: use spacesaftercmd attribute for
+       spaces_after_cmd_before_arg for accent commands too.
+
+       * util/texinfo.dtd: add two-letter based index entries index commands.
+       Add microtype.  Allow formfeed and verticaltab in menuleadingtext.
+       Allow headingmark in style commands.  Add diverse space attributes in
+       associated elements, in particular in brace commands.
+
 2022-12-01  Patrice Dumas  <pertusus@free.fr>
 
        Protect spaces in space attributes in XML specific code
diff --git a/tp/Texinfo/Convert/TexinfoMarkup.pm 
b/tp/Texinfo/Convert/TexinfoMarkup.pm
index ba8852be24..c6e8f5fbc7 100644
--- a/tp/Texinfo/Convert/TexinfoMarkup.pm
+++ b/tp/Texinfo/Convert/TexinfoMarkup.pm
@@ -532,6 +532,29 @@ sub _texinfo_line($$)
   return ();
 }
 
+sub _format_columnfractions($$)
+{
+  my $self = shift;
+  my $element = shift;
+
+  my $attribute = [_leading_spaces_arg($element),
+                   $self->_texinfo_line($element)];
+  my $result = '';
+  $result .= $self->txi_markup_open_element('columnfractions', $attribute);
+  if ($element
+      and $element->{'extra'}
+      and $element->{'extra'}->{'misc_args'}) {
+    foreach my $fraction (@{$element->{'extra'}->{'misc_args'}}) {
+      $result .= $self->txi_markup_open_element('columnfraction',
+                                    [['value', $fraction]])
+                 .$self->txi_markup_close_element('columnfraction');
+    }
+  }
+  $result .= $self->txi_markup_close_element('columnfractions');
+  $result .= $self->format_comment_or_return_end_line($element);
+  return $result;
+}
+
 sub _convert_argument_and_end_line($$)
 {
   my $self = shift;
@@ -620,11 +643,11 @@ sub _convert($$;$)
           $arg = $self->_convert($element->{'args'}->[0]);
           if ($element->{'info'}
               and $element->{'info'}->{'spaces_after_cmd_before_arg'}) {
-            push @$attributes, ['spaces',
+            push @$attributes, ['spacesaftercmd',
                     $element->{'info'}->{'spaces_after_cmd_before_arg'}];
           }
           if ($element->{'args'}->[0]->{'type'} eq 'following_arg') {
-             push @$attributes, ['bracketed', 'off'];
+            push @$attributes, ['bracketed', 'off'];
           }
         }
         return $self->_accent($arg, $element, undef, $attributes);
@@ -930,6 +953,8 @@ sub _convert($$;$)
         my $args_attributes;
         if ($line_command_numbered_arguments_attributes{$cmdname}) {
           $args_attributes = 
$line_command_numbered_arguments_attributes{$cmdname};
+        } elsif ($cmdname eq 'columnfractions') {
+          return _format_columnfractions($self, $element);
         } else {
           $args_attributes = ['value'];
         }
@@ -1402,30 +1427,15 @@ sub _convert($$;$)
                                                            ->[0]->{'cmdname'}
                                 and $element->{'args'}->[0]->{'contents'}
                                    ->[0]->{'cmdname'} eq 'columnfractions'))) {
-                my $cmd;
+                my $columnfractions_element;
                 foreach my $content (@{$element->{'args'}->[0]->{'contents'}}) 
{
                   if ($content->{'cmdname'}
                       and $content->{'cmdname'} eq 'columnfractions') {
-                    $cmd = $content;
+                    $columnfractions_element = $content;
                     last;
                   }
                 }
-                my $attribute = [_leading_spaces_arg($cmd),
-                                 $self->_texinfo_line($cmd)];
-                $result .= $self->txi_markup_open_element('columnfractions', 
$attribute);
-                if ($element->{'extra'}->{'columnfractions'}
-                    and $element->{'extra'}->{'columnfractions'}->{'extra'}
-                    and $element->{'extra'}->{'columnfractions'}
-                                                ->{'extra'}->{'misc_args'}) {
-                  foreach my $fraction 
(@{$element->{'extra'}->{'columnfractions'}
-                                               ->{'extra'}->{'misc_args'}}) {
-                    $result .= $self->txi_markup_open_element('columnfraction',
-                                                  [['value', $fraction]])
-                               
.$self->txi_markup_close_element('columnfraction');
-                  }
-                }
-                $result .= $self->txi_markup_close_element('columnfractions');
-                $result .= $self->format_comment_or_return_end_line($cmd);
+                $result .= _format_columnfractions($self, 
$columnfractions_element);
               } else { # bogus multitable
                 $result .= "\n";
               }
diff --git a/tp/t/06columnfractions.t b/tp/t/06columnfractions.t
index e8b7471fb3..c51a144931 100644
--- a/tp/t/06columnfractions.t
+++ b/tp/t/06columnfractions.t
@@ -10,7 +10,6 @@ my @test_tree = (
 @end multitable' ],
 [ 'invalid','@multitable @columnfractions 2x.2 2.23x
 @end multitable' ],
-[ 'out_of_multitable', '@columnfractions 0.6 0.4 aaa' ],
 );
 
 my @test_cases = (
@@ -27,7 +26,8 @@ my @test_cases = (
 [ 'wrong_command', '@multitable @columnfractions @b{3.4} 
 @end multitable' ],
 [ 'something_before_columnfractions', '@multitable aaa @columnfractions 0.3 0.7
-@end multitable' ]
+@end multitable' ],
+[ 'out_of_multitable', '@columnfractions 0.6 0.4 aaa' ],
 );
 
 foreach my $test (@test_cases) {
diff --git a/tp/t/results/columnfractions/out_of_multitable.pl 
b/tp/t/results/columnfractions/out_of_multitable.pl
index 214f4aaf98..02d1b5aa56 100644
--- a/tp/t/results/columnfractions/out_of_multitable.pl
+++ b/tp/t/results/columnfractions/out_of_multitable.pl
@@ -73,4 +73,10 @@ $result_errors{'out_of_multitable'} = [
 $result_floats{'out_of_multitable'} = {};
 
 
+
+$result_converted{'xml'}->{'out_of_multitable'} = '<columnfractions spaces=" " 
line="0.6 0.4 aaa"><columnfraction value="0.6"></columnfraction><columnfraction 
value="0.4"></columnfraction></columnfractions>';
+
+
+$result_converted{'latex_text'}->{'out_of_multitable'} = '';
+
 1;
diff --git a/tp/t/results/coverage/commands.pl 
b/tp/t/results/coverage/commands.pl
index 76d999f38c..cfaba014fe 100644
--- a/tp/t/results/coverage/commands.pl
+++ b/tp/t/results/coverage/commands.pl
@@ -462,7 +462,7 @@ $result_converted{'html_text'}->{'commands'} = '<p>@ TeX 
&nbsp;&euml; &icirc; &a
 ';
 
 
-$result_converted{'xml'}->{'commands'} = '<para>&arobase; &tex; <spacecmd 
type="nl"/><accent type="uml" bracketed="off">e</accent> <accent 
type="circ"><dotless>i</dotless></accent> <accent type="tilde">a</accent> 
<accent type="ring" spaces=" " bracketed="off">a</accent>
+$result_converted{'xml'}->{'commands'} = '<para>&arobase; &tex; <spacecmd 
type="nl"/><accent type="uml" bracketed="off">e</accent> <accent 
type="circ"><dotless>i</dotless></accent> <accent type="tilde">a</accent> 
<accent type="ring" spacesaftercmd=" " bracketed="off">a</accent>
 </para>
 <para><clicksequence>File <click command="arrow"/> 
Open</clicksequence>&eosperiod;
 <email><emailaddress>a</emailaddress><emailname spaces=" 
">b</emailname></email> <code>code --- -- \'\' ``</code>
diff --git a/tp/t/results/coverage/lettered_accent_and_spaces.pl 
b/tp/t/results/coverage/lettered_accent_and_spaces.pl
index 9b207c838b..f727d9c003 100644
--- a/tp/t/results/coverage/lettered_accent_and_spaces.pl
+++ b/tp/t/results/coverage/lettered_accent_and_spaces.pl
@@ -438,21 +438,21 @@ circ;
 ';
 
 
-$result_converted{'xml'}->{'lettered_accent_and_spaces'} = '<para><accent 
type="ring" spaces="    " bracketed="off">a</accent>
+$result_converted{'xml'}->{'lettered_accent_and_spaces'} = '<para><accent 
type="ring" spacesaftercmd="    " bracketed="off">a</accent>
 </para>
-<para><accent type="ring" spaces="\\n">a</accent>
+<para><accent type="ring" spacesaftercmd="\\n">a</accent>
 </para>
-<para><accent type="ring" spaces="\\n" bracketed="off">a</accent>
+<para><accent type="ring" spacesaftercmd="\\n" bracketed="off">a</accent>
 </para>
-<para><accent type="ring" spaces="\\n  " bracketed="off">a</accent>
+<para><accent type="ring" spacesaftercmd="\\n  " bracketed="off">a</accent>
 </para>
-<para><accent type="circ" spaces=" " bracketed="off">a</accent>
+<para><accent type="circ" spacesaftercmd=" " bracketed="off">a</accent>
 </para>
-<para><accent type="circ" spaces="\\n" bracketed="off">a</accent>
+<para><accent type="circ" spacesaftercmd="\\n" bracketed="off">a</accent>
 </para>
-<para><accent type="circ" spaces="\\n " bracketed="off">a</accent>
+<para><accent type="circ" spacesaftercmd="\\n " bracketed="off">a</accent>
 </para>
-<para><accent type="circ" spaces=" ">a
+<para><accent type="circ" spacesaftercmd=" ">a
 </accent>
 </para>
 ';
diff --git a/tp/t/results/formats_encodings/accent.pl 
b/tp/t/results/formats_encodings/accent.pl
index dd288b44b3..11c2412f49 100644
--- a/tp/t/results/formats_encodings/accent.pl
+++ b/tp/t/results/formats_encodings/accent.pl
@@ -2500,25 +2500,25 @@ $result_converted{'xml'}->{'accent'} = '<node 
name="Top-node" spaces=" "><nodena
 </para>
 <para>should be e=: <accent type="macr">e</accent> <accent type="macr" 
bracketed="off">e</accent>
 </para>
-<para>should be e<w>&textrsquo;</w>&textrsquo;: <accent 
type="doubleacute">e</accent> <accent type="doubleacute" spaces=" " 
bracketed="off">e</accent>
+<para>should be e<w>&textrsquo;</w>&textrsquo;: <accent 
type="doubleacute">e</accent> <accent type="doubleacute" spacesaftercmd=" " 
bracketed="off">e</accent>
 </para>
-<para>should be e.: <accent type="dotaccent">e</accent> <accent 
type="dotaccent" spaces=" " bracketed="off">e</accent>
+<para>should be e.: <accent type="dotaccent">e</accent> <accent 
type="dotaccent" spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be e*: <accent type="ring">e</accent> <accent type="ring" 
spaces=" " bracketed="off">e</accent>
+<para>should be e*: <accent type="ring">e</accent> <accent type="ring" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
 <para>should be ee[: <accent type="tieaccent">ee</accent>
 </para>
-<para>should be e(: <accent type="breve">e</accent> <accent type="breve" 
spaces=" " bracketed="off">e</accent>
+<para>should be e(: <accent type="breve">e</accent> <accent type="breve" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be e_: <accent type="ubaraccent">e</accent> <accent 
type="ubaraccent" spaces=" " bracketed="off">e</accent>
+<para>should be e_: <accent type="ubaraccent">e</accent> <accent 
type="ubaraccent" spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be .e: <accent type="udotaccent">e</accent> <accent 
type="udotaccent" spaces=" " bracketed="off">e</accent>
+<para>should be .e: <accent type="udotaccent">e</accent> <accent 
type="udotaccent" spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be e&lt;: <accent type="caron">e</accent> <accent type="caron" 
spaces=" " bracketed="off">e</accent>
+<para>should be e&lt;: <accent type="caron">e</accent> <accent type="caron" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be a; : <accent type="ogon">a</accent> <accent type="ogon" 
spaces=" " bracketed="off">a</accent>
+<para>should be a; : <accent type="ogon">a</accent> <accent type="ogon" 
spacesaftercmd=" " bracketed="off">a</accent>
 </para>
-<para>should be e; : <accent type="ogon">e</accent> <accent type="ogon" 
spaces=" " bracketed="off">e</accent>
+<para>should be e; : <accent type="ogon">e</accent> <accent type="ogon" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
 <para>upside down: &iquest; &iexcl;
 </para>
diff --git a/tp/t/results/formats_encodings/accentenc.pl 
b/tp/t/results/formats_encodings/accentenc.pl
index 6ffaac7904..caef94f02c 100644
--- a/tp/t/results/formats_encodings/accentenc.pl
+++ b/tp/t/results/formats_encodings/accentenc.pl
@@ -2542,25 +2542,25 @@ $result_converted{'xml'}->{'accentenc'} = 
'<documentencoding encoding="ISO-8859-
 </para>
 <para>should be e=: <accent type="macr">e</accent> <accent type="macr" 
bracketed="off">e</accent>
 </para>
-<para>should be e<w>&textrsquo;</w>&textrsquo;: <accent 
type="doubleacute">e</accent> <accent type="doubleacute" spaces=" " 
bracketed="off">e</accent>
+<para>should be e<w>&textrsquo;</w>&textrsquo;: <accent 
type="doubleacute">e</accent> <accent type="doubleacute" spacesaftercmd=" " 
bracketed="off">e</accent>
 </para>
-<para>should be e.: <accent type="dotaccent">e</accent> <accent 
type="dotaccent" spaces=" " bracketed="off">e</accent>
+<para>should be e.: <accent type="dotaccent">e</accent> <accent 
type="dotaccent" spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be e*: <accent type="ring">e</accent> <accent type="ring" 
spaces=" " bracketed="off">e</accent>
+<para>should be e*: <accent type="ring">e</accent> <accent type="ring" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
 <para>should be ee[: <accent type="tieaccent">ee</accent>
 </para>
-<para>should be e(: <accent type="breve">e</accent> <accent type="breve" 
spaces=" " bracketed="off">e</accent>
+<para>should be e(: <accent type="breve">e</accent> <accent type="breve" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be e_: <accent type="ubaraccent">e</accent> <accent 
type="ubaraccent" spaces=" " bracketed="off">e</accent>
+<para>should be e_: <accent type="ubaraccent">e</accent> <accent 
type="ubaraccent" spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be .e: <accent type="udotaccent">e</accent> <accent 
type="udotaccent" spaces=" " bracketed="off">e</accent>
+<para>should be .e: <accent type="udotaccent">e</accent> <accent 
type="udotaccent" spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be e&lt;: <accent type="caron">e</accent> <accent type="caron" 
spaces=" " bracketed="off">e</accent>
+<para>should be e&lt;: <accent type="caron">e</accent> <accent type="caron" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
-<para>should be a; : <accent type="ogon">a</accent> <accent type="ogon" 
spaces=" " bracketed="off">a</accent>
+<para>should be a; : <accent type="ogon">a</accent> <accent type="ogon" 
spacesaftercmd=" " bracketed="off">a</accent>
 </para>
-<para>should be e; : <accent type="ogon">e</accent> <accent type="ogon" 
spaces=" " bracketed="off">e</accent>
+<para>should be e; : <accent type="ogon">e</accent> <accent type="ogon" 
spacesaftercmd=" " bracketed="off">e</accent>
 </para>
 <para>upside down: &iquest; &iexcl;
 </para>
diff --git a/util/txixml2texi.pl b/util/txixml2texi.pl
index e7671f6835..a1cd1ba323 100755
--- a/util/txixml2texi.pl
+++ b/util/txixml2texi.pl
@@ -312,7 +312,6 @@ while ($reader->read) {
           print "\@${command}${spaces_after_command}"
             if (defined($command));
         }
-        print "$spaces";
         if (!(defined($reader->getAttribute('bracketed'))
               and $reader->getAttribute('bracketed') eq 'off')) {
           print '{';



reply via email to

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