texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: No code environment for @var on @def lines


From: Patrice Dumas
Subject: branch master updated: No code environment for @var on @def lines
Date: Wed, 10 Aug 2022 11:38:00 -0400

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 0abb24e1c7 No code environment for @var on @def lines
0abb24e1c7 is described below

commit 0abb24e1c76edfc7ebfc9ba6f47cb2172777efa6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Aug 10 17:37:49 2022 +0200

    No code environment for @var on @def lines
    
    * tp/Texinfo/Convert/LaTeX.pm (_convert) <style commands>:
    if in var_slant context, @var stops code context.
---
 ChangeLog                                          |  7 ++++
 tp/Texinfo/Convert/LaTeX.pm                        |  9 ++++-
 .../res_latex/definition_commands.tex              | 46 +++++++++++-----------
 3 files changed, 37 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2498a36288..1d49232955 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-08-10  Patrice Dumas  <pertusus@free.fr>
+
+       No code environment for @var on @def lines
+
+       * tp/Texinfo/Convert/LaTeX.pm (_convert) <style commands>:
+       if in var_slant context, @var stops code context.
+
 2022-08-09  Gavin Smith  <gavinsmith0123@gmail.com>
 
        Special output for @var, @code, @t in def args
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index ee498bb0dc..323cd73c07 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -2450,9 +2450,14 @@ sub _convert($$)
       if ($self->{'quotes_map'}->{$cmdname}) {
         $result .= $self->{'quotes_map'}->{$cmdname}->[0];
       }
+      my $remove_code_context;
       if ($code_style_commands{$cmdname}) {
         $self->{'formatting_context'}->[-1]->{'code'}->[-1] += 1;
-      } elsif ($cmdname eq 'r') {
+      } elsif ($cmdname eq 'r'
+               or ($cmdname eq 'var'
+                   and $self->{'formatting_context'}->[-1]->{'var_slant'}
+                   and 
$self->{'formatting_context'}->[-1]->{'var_slant'}->[-1])) {
+        $remove_code_context = 1;
         push @{$self->{'formatting_context'}->[-1]->{'code'}}, 0;
       }
       # specific macro for typewriter + other style
@@ -2497,7 +2502,7 @@ sub _convert($$)
       }
       if ($code_style_commands{$cmdname}) {
         $self->{'formatting_context'}->[-1]->{'code'}->[-1] -= 1;
-      } elsif ($cmdname eq 'r') {
+      } elsif ($remove_code_context) {
         pop @{$self->{'formatting_context'}->[-1]->{'code'}};
       }
       if ($self->{'quotes_map'}->{$cmdname}) {
diff --git 
a/tp/t/results/converters_tests/definition_commands/res_latex/definition_commands.tex
 
b/tp/t/results/converters_tests/definition_commands/res_latex/definition_commands.tex
index 6182f3f5e5..d31afa207c 100644
--- 
a/tp/t/results/converters_tests/definition_commands/res_latex/definition_commands.tex
+++ 
b/tp/t/results/converters_tests/definition_commands/res_latex/definition_commands.tex
@@ -291,7 +291,7 @@ to \textsl{font} (one-character name\hbox{}\textsl{f}, 
two-character name
 test formatting of separators
 \end{quote}
 
-\noindent\texttt{int foobar (int {\rmfamily \slshape f{-}{-}{-}oo}, float 
{\rmfamily \slshape b{-}{-}ar})}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}, float {\rmfamily 
\slshape b--ar})}\hfill[Library Function]
 
 
 
@@ -376,57 +376,57 @@ explicit keyword marking, no var \textsl{function} with 
\textsl{arguments}
 In deffn with code and var used
 \end{quote}
 
-\noindent\texttt{int foobar (int {\rmfamily \slshape f{-}{-}{-}oo}[, float 
{\rmfamily \slshape b{-}{-}ar}]) default}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}[, float 
{\rmfamily \slshape b--ar}]) default}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape 
f{-}{-}{-}oo}\textnormal{[}, float {\rmfamily \slshape 
b{-}{-}ar}\textnormal{]}) r}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}\textnormal{[}, 
float {\rmfamily \slshape b--ar}\textnormal{]}) r}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape f{-}{-}{-}oo}{\rmfamily 
\slshape [}, float {\rmfamily \slshape b{-}{-}ar}{\rmfamily \slshape ]}) 
var}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}{\rmfamily 
\slshape [}, float {\rmfamily \slshape b--ar}{\rmfamily \slshape ]}) 
var}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape f{-}{-}{-}oo}\textsl{[}, 
float {\rmfamily \slshape b{-}{-}ar}\textsl{]}) slanted}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}\textsl{[}, float 
{\rmfamily \slshape b--ar}\textsl{]}) slanted}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape f{-}{-}{-}oo}{\upshape 
\ttfamily [}, float {\rmfamily \slshape b{-}{-}ar}{\upshape \ttfamily ]}) 
code}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}{\upshape 
\ttfamily [}, float {\rmfamily \slshape b--ar}{\upshape \ttfamily ]}) 
code}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape f{-}{-}{-}oo}{\upshape 
\ttfamily [}, float {\rmfamily \slshape b{-}{-}ar}{\upshape \ttfamily ]}) 
t}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}{\upshape 
\ttfamily [}, float {\rmfamily \slshape b--ar}{\upshape \ttfamily ]}) 
t}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape f{-}{-}{-}oo}{\upshape 
\ttfamily \textbf{[}}, float {\rmfamily \slshape b{-}{-}ar}{\upshape \ttfamily 
\textbf{]}}) t:b}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape f---oo}{\upshape 
\ttfamily \textbf{[}}, float {\rmfamily \slshape b--ar}{\upshape \ttfamily 
\textbf{]}}) t:b}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape 
f{-}{-}{-}oo}\textnormal{{\rmfamily \slshape [}}, float {\rmfamily \slshape 
b{-}{-}ar}\textnormal{{\rmfamily \slshape ]}}) r:var}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape 
f---oo}\textnormal{{\rmfamily \slshape [}}, float {\rmfamily \slshape 
b--ar}\textnormal{{\rmfamily \slshape ]}}) r:var}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape 
f{-}{-}{-}oo}\textnormal{\textsl{[}}, float {\rmfamily \slshape 
b{-}{-}ar}\textnormal{\textsl{]}}) r:slanted}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape 
f---oo}\textnormal{\textsl{[}}, float {\rmfamily \slshape 
b--ar}\textnormal{\textsl{]}}) r:slanted}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape 
f{-}{-}{-}oo}\textnormal{{\upshape \ttfamily [}}, float {\rmfamily \slshape 
b{-}{-}ar}\textnormal{{\upshape \ttfamily ]}}) r:code}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape 
f---oo}\textnormal{{\upshape \ttfamily [}}, float {\rmfamily \slshape 
b--ar}\textnormal{{\upshape \ttfamily ]}}) r:code}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (int {\rmfamily \slshape 
f{-}{-}{-}oo}\textnormal{{\upshape \ttfamily [}}, float {\rmfamily \slshape 
b{-}{-}ar}\textnormal{{\upshape \ttfamily ]}}) r:t}\hfill[Library Function]
+\noindent\texttt{int foobar (int {\rmfamily \slshape 
f---oo}\textnormal{{\upshape \ttfamily [}}, float {\rmfamily \slshape 
b--ar}\textnormal{{\upshape \ttfamily ]}}) r:t}\hfill[Library Function]
 
 
 
@@ -436,57 +436,57 @@ In deffn with code and var used
 separators
 \end{quote}
 
-\noindent\texttt{int foobar (i{-}{-}nt {\rmfamily \slshape f{-}{-}{-}oo}[, 
float {\rmfamily \slshape b{-}{-}ar}]) default}\hfill[Library Function]
+\noindent\texttt{int foobar (i{-}{-}nt {\rmfamily \slshape f---oo}[, float 
{\rmfamily \slshape b--ar}]) default}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (\textnormal{i--nt} {\rmfamily \slshape 
f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) r}\hfill[Library 
Function]
+\noindent\texttt{int foobar (\textnormal{i--nt} {\rmfamily \slshape f---oo}[, 
float {\rmfamily \slshape b--ar}]) r}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar ({\rmfamily \slshape i{-}{-}nt} {\rmfamily 
\slshape f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) 
var}\hfill[Library Function]
+\noindent\texttt{int foobar ({\rmfamily \slshape i--nt} {\rmfamily \slshape 
f---oo}[, float {\rmfamily \slshape b--ar}]) var}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (\textsl{i{-}{-}nt} {\rmfamily \slshape 
f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) slanted}\hfill[Library 
Function]
+\noindent\texttt{int foobar (\textsl{i{-}{-}nt} {\rmfamily \slshape f---oo}[, 
float {\rmfamily \slshape b--ar}]) slanted}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar ({\upshape \ttfamily i{-}{-}nt} {\rmfamily 
\slshape f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) 
code}\hfill[Library Function]
+\noindent\texttt{int foobar ({\upshape \ttfamily i{-}{-}nt} {\rmfamily 
\slshape f---oo}[, float {\rmfamily \slshape b--ar}]) code}\hfill[Library 
Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar ({\upshape \ttfamily i{-}{-}nt} {\rmfamily 
\slshape f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) 
t}\hfill[Library Function]
+\noindent\texttt{int foobar ({\upshape \ttfamily i{-}{-}nt} {\rmfamily 
\slshape f---oo}[, float {\rmfamily \slshape b--ar}]) t}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar ({\upshape \ttfamily \textbf{i{-}{-}nt}} 
{\rmfamily \slshape f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) 
t:b}\hfill[Library Function]
+\noindent\texttt{int foobar ({\upshape \ttfamily \textbf{i{-}{-}nt}} 
{\rmfamily \slshape f---oo}[, float {\rmfamily \slshape b--ar}]) 
t:b}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (\textnormal{{\rmfamily \slshape i--nt}} 
{\rmfamily \slshape f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) 
r:var}\hfill[Library Function]
+\noindent\texttt{int foobar (\textnormal{{\rmfamily \slshape i--nt}} 
{\rmfamily \slshape f---oo}[, float {\rmfamily \slshape b--ar}]) 
r:var}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (\textnormal{\textsl{i--nt}} {\rmfamily \slshape 
f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) r:slanted}\hfill[Library 
Function]
+\noindent\texttt{int foobar (\textnormal{\textsl{i--nt}} {\rmfamily \slshape 
f---oo}[, float {\rmfamily \slshape b--ar}]) r:slanted}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (\textnormal{{\upshape \ttfamily i{-}{-}nt}} 
{\rmfamily \slshape f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) 
r:code}\hfill[Library Function]
+\noindent\texttt{int foobar (\textnormal{{\upshape \ttfamily i{-}{-}nt}} 
{\rmfamily \slshape f---oo}[, float {\rmfamily \slshape b--ar}]) 
r:code}\hfill[Library Function]
 
 
 
 \index[fn]{foobar@\texttt{foobar}}%
-\noindent\texttt{int foobar (\textnormal{{\upshape \ttfamily i{-}{-}nt}} 
{\rmfamily \slshape f{-}{-}{-}oo}[, float {\rmfamily \slshape b{-}{-}ar}]) 
r:t}\hfill[Library Function]
+\noindent\texttt{int foobar (\textnormal{{\upshape \ttfamily i{-}{-}nt}} 
{\rmfamily \slshape f---oo}[, float {\rmfamily \slshape b--ar}]) 
r:t}\hfill[Library Function]
 
 
 



reply via email to

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