texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Initial @defblock, @defline in texi2any


From: Gavin D. Smith
Subject: branch master updated: Initial @defblock, @defline in texi2any
Date: Thu, 16 Feb 2023 14:40:28 -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 239d961655 Initial @defblock, @defline in texi2any
239d961655 is described below

commit 239d961655eb42862067e12910ce7fce8511bb95
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Thu Feb 16 19:40:10 2023 +0000

    Initial @defblock, @defline in texi2any
    
    * tp/Texinfo/command_data.txt (defblock, defline, deflinex): Add.
    
    * tp/Texinfo/ParserNonXS.pm
    (_close_command_cleanup): Call _gather_def_item for @defblock.
    (_process_remaining_on_line):
    Allow any def line command in @defblock, including @defline.
    (_end_line_def_line): No index entry for @defline.
    
    * tp/Texinfo/Convert/Plaintext.pm (%indented_commands): Add @defblock.
    (_convert): Do not treat "defline" as an unhandled command.  Treat
    defline similarly to deffn.
    * tp/Texinfo/Convert/HTML.pm (%default_commands_conversion):
    Use _convert_def_command for @defblock.
    
    * doc/texinfo.tex (@defline, @deftypeline):
    Define as synonymns for @deflinex, @deftypelinex.
---
 ChangeLog                             | 21 +++++++++++++++++++++
 doc/texinfo.tex                       |  4 +++-
 tp/Texinfo/Convert/HTML.pm            |  2 +-
 tp/Texinfo/Convert/Plaintext.pm       |  8 +++++---
 tp/Texinfo/ParserNonXS.pm             |  9 ++++++---
 tp/Texinfo/XS/parsetexi/command_ids.h |  3 +++
 tp/Texinfo/command_data.txt           |  5 +++++
 7 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c96e0a2122..f0fc1b82e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2023-02-16  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Initial @defblock, @defline in texi2any
+
+       * tp/Texinfo/command_data.txt (defblock, defline, deflinex): Add.
+
+       * tp/Texinfo/ParserNonXS.pm
+       (_close_command_cleanup): Call _gather_def_item for @defblock.
+       (_process_remaining_on_line):
+       Allow any def line command in @defblock, including @defline.
+       (_end_line_def_line): No index entry for @defline.
+
+       * tp/Texinfo/Convert/Plaintext.pm (%indented_commands): Add @defblock.
+       (_convert): Do not treat "defline" as an unhandled command.  Treat
+       defline similarly to deffn.
+       * tp/Texinfo/Convert/HTML.pm (%default_commands_conversion):
+       Use _convert_def_command for @defblock.
+
+       * doc/texinfo.tex (@defline, @deftypeline):
+       Define as synonymns for @deflinex, @deftypelinex.
+
 2023-02-16  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/TexinfoMarkup.pm (_convert): keep information 
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 6efbafd777..e57d08a800 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2023-02-11.13}
+\def\texinfoversion{2023-02-16.19}
 %
 % Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
 %
@@ -7595,6 +7595,8 @@ might help (with 'rm \jobname.?? \jobname.??s')%
   \doingtypefntrue
   \parseargusing\activeparens{\printdefunline\deflineheader}%
 }
+\let\defline\deflinex
+\let\deftypeline\deftypelinex
 
 % user-defined def commands
 % @newdef @COMMAND = CATEGORY INDEX
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 88cbcba768..54a96b7fa6 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -6892,7 +6892,7 @@ sub _convert_def_command($$$$$) {
   }
 }
 
-foreach my $command (keys(%def_commands)) {
+foreach my $command (keys(%def_commands), 'defblock') {
   $default_commands_conversion{$command} = \&_convert_def_command;
 }
 
diff --git a/tp/Texinfo/Convert/Plaintext.pm b/tp/Texinfo/Convert/Plaintext.pm
index 8e71af12c1..9e200eaec7 100644
--- a/tp/Texinfo/Convert/Plaintext.pm
+++ b/tp/Texinfo/Convert/Plaintext.pm
@@ -219,7 +219,7 @@ my %indented_commands;
 foreach my $indented_command (keys(%item_indent_format_length),
            keys(%preformatted_commands), 'quotation', 'smallquotation',
            'indentedblock', 'smallindentedblock',
-           keys(%def_commands)) {
+           'defblock', keys(%def_commands)) {
   $indented_commands{$indented_command} = 1
     if exists($block_commands{$indented_command});
 }
@@ -2952,7 +2952,8 @@ sub _convert($$)
         # are not considered as index entries either so they have a specific
         # condition
         and !($def_commands{$command}
-              and $command =~ /x$/)) {
+              and ($command eq 'defline'
+                    or $command =~ /x$/))) {
       warn "Unhandled $command\n";
       $result .= "!!!!!!!!! Unhandled $command !!!!!!!!!\n";
     }
@@ -3020,7 +3021,8 @@ sub _convert($$)
 
         my $omit_def_space = $element->{'extra'}->{'omit_def_name_space'};
 
-        if ($command eq 'deffn'
+        if ($command eq 'defline'
+            or $command eq 'deffn'
             or $command eq 'defvr'
             or $command eq 'deftp'
             or (($command eq 'deftypefn'
diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index c9c27604d6..f5a9484a09 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -1968,7 +1968,8 @@ sub _close_command_cleanup($$) {
   }
 
   # put everything after the last @def*x command in a def_item type container.
-  if ($def_commands{$current->{'cmdname'}}) {
+  if ($def_commands{$current->{'cmdname'}}
+      or $current->{'cmdname'} eq 'defblock') {
     # At this point the end command hasn't been added to the command contents.
     # so checks cannot be done at this point.
     _gather_def_item($self, $current);
@@ -3821,7 +3822,8 @@ sub _end_line_def_line($$$)
         $current->{'extra'}->{'def_command'},
         $current->{'extra'}->{'original_def_cmdname'},
         $current, $index_contents,
-        $index_contents_normalized, $source_info);
+        $index_contents_normalized, $source_info)
+           if $current->{'extra'}->{'def_command'} ne 'defline';
     } else {
       $self->_command_warn($current, $source_info,
                            __('missing name for @%s'),
@@ -5887,7 +5889,8 @@ sub _process_remaining_on_line($$$$)
               push @{$current->{'contents'}}, $misc;
             }
             if (!$current->{'cmdname'}
-                 or $current->{'cmdname'} ne $base_command
+                 or ($current->{'cmdname'} ne $base_command
+                       and $current->{'cmdname'} ne 'defblock')
                  or $after_paragraph) {
               $self->_line_error(sprintf(__(
                                    "must be after `\@%s' to use `\@%s'"),
diff --git a/tp/Texinfo/XS/parsetexi/command_ids.h 
b/tp/Texinfo/XS/parsetexi/command_ids.h
index a2c8542ad2..b36e94cf2c 100644
--- a/tp/Texinfo/XS/parsetexi/command_ids.h
+++ b/tp/Texinfo/XS/parsetexi/command_ids.h
@@ -110,6 +110,7 @@ CM_comment,
 CM_contents,
 CM_copying,
 CM_copyright,
+CM_defblock,
 CM_defcodeindex,
 CM_defcv,
 CM_defcvx,
@@ -119,6 +120,8 @@ CM_defindex,
 CM_definfoenclose,
 CM_defivar,
 CM_defivarx,
+CM_defline,
+CM_deflinex,
 CM_defmac,
 CM_defmacx,
 CM_defmethod,
diff --git a/tp/Texinfo/command_data.txt b/tp/Texinfo/command_data.txt
index 860dff878b..38c4da463e 100644
--- a/tp/Texinfo/command_data.txt
+++ b/tp/Texinfo/command_data.txt
@@ -487,6 +487,11 @@ deftypeivar             
block,def,contain_basic_inline,def_alias,close_paragraph
 defmethod               
block,def,contain_basic_inline,def_alias,close_paragraph    BLOCK_def
 deftypemethod           
block,def,contain_basic_inline,def_alias,close_paragraph    BLOCK_def
 
+# generic, no automatic index
+defblock                block,contain_basic_inline,close_paragraph       
BLOCK_def
+defline                 line,def,contain_basic_inline,close_paragraph        
LINE_line
+deflinex                line,def,contain_basic_inline,close_paragraph        
LINE_line
+
 # def*x
 deffnx                  line,def,contain_basic_inline,close_paragraph        
LINE_line
 defvrx                  line,def,contain_basic_inline,close_paragraph        
LINE_line



reply via email to

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