[latex3-commits] [git/LaTeX3-latex3-latex2e] gh739: Make \ShowCommand stop for interaction with ltcmd (d69937db)

PhelypeOleinik phelype.oleinik at latex-project.org
Fri Dec 31 18:17:53 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : gh739
Link       : https://github.com/latex3/latex2e/commit/d69937db1d1c9abbb73570fb471ba203d2dc7a83

>---------------------------------------------------------------

commit d69937db1d1c9abbb73570fb471ba203d2dc7a83
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Fri Dec 31 14:17:53 2021 -0300

    Make \ShowCommand stop for interaction with ltcmd
    
    Fixes #739


>---------------------------------------------------------------

d69937db1d1c9abbb73570fb471ba203d2dc7a83
 base/changes.txt                     |  5 +++++
 base/doc/ltnews35.tex                | 17 +++++++++++++++++
 base/ltcmd.dtx                       | 20 ++++++++++++--------
 base/testfiles-ltcmd/github-569b.tlg | 14 ++++++++++++++
 4 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index ca0f92a6..171c20da 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2021-10-20 Phelype Oleinik  <phelype.oleinik at latex-project.org>
+
+	* ltcmd.dtx (subsubsection{Showing the definition of a command}):
+	Make \ShowCommand stop for interaction with ltcmd (gh/739)
+
 2021-12-27  Marcel Krüger  <Marcel.Krueger at latex-project.org>
   * ltluatex.dtx:
   Added \newluacmd and \newprotectedluacmd to simply allocating Lua command ids.
diff --git a/base/doc/ltnews35.tex b/base/doc/ltnews35.tex
index 79c439ef..20186244 100644
--- a/base/doc/ltnews35.tex
+++ b/base/doc/ltnews35.tex
@@ -372,6 +372,19 @@ hex 80 to 9F, this has been corrected in this release.
 
 
 
+\subsection{Fix \cs{ShowCommand} when used with \pkg{ltcmd}}
+
+When \cs{ShowCommand} support was added for \pkg{ltcmd} in the previous
+release~\cite{35:ltnews34}, a blunder in the code made it so that
+when \cs{ShowCommand} was used on a command defined with \pkg{ltcmd}, it
+only printed the meaning of the command in the terminal, but didn't stop
+for interaction as it does elsewhere (mimicking \cs{show}).  The issue
+is now fixed.
+%
+\githubissue{739}
+
+
+
 
 \section{Changes to packages in the \pkg{amsmath} category}
 
@@ -431,6 +444,10 @@ the column material out instead running the column short.
   \emph{\LaTeXe{} news 33}.\\
   \url{https://latex-project.org/news/latex2e-news/ltnews33.pdf}
 
+\bibitem{35:ltnews34} \LaTeX{} Project Team:
+  \emph{\LaTeXe{} news 34}.\\
+  \url{https://latex-project.org/news/latex2e-news/ltnews34.pdf}
+
 \end{thebibliography}
 
 
diff --git a/base/ltcmd.dtx b/base/ltcmd.dtx
index 0e212055..a45da684 100644
--- a/base/ltcmd.dtx
+++ b/base/ltcmd.dtx
@@ -34,8 +34,8 @@
 %%% From File: ltcmd.dtx
 %
 %    \begin{macrocode}
-\def\ltcmdversion{v1.0i}
-\def\ltcmddate{2021-12-02}
+\def\ltcmdversion{v1.0j}
+\def\ltcmddate{2021-12-31}
 %    \end{macrocode}
 %
 %<*driver>
@@ -2352,15 +2352,17 @@
 %   Now just print everything in the required format.  The auxiliary
 %   \cs{@@_split_signature:n} stores a ready-to-print token list in
 %   \cs{l_@@_tmpa_tl}, so we ust use that here:
+% \changes{v1.0j}{2021/13/31}
+%         {Make \cs{ShowCommand} stop for interaction}
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_show_command_aux:nNNn #1 #2 #3 #4
   {
     \@@_split_signature:n {#4}
-    \iow_term:x
+    \tl_show:x
       {
-        > ~ \token_to_str:N #2 = #1: \iow_newline:
+        \token_to_str:N #2 = #1: \iow_newline:
         \tl_use:N \l_@@_tmpa_tl
-        -> \cs_replacement_spec:N #3 .
+        -> \cs_replacement_spec:N #3
       }
   }
 %    \end{macrocode}
@@ -2371,15 +2373,17 @@
 %   |\ShowCommand\foo| is used (if |foo| is an environment), we show
 %   |\endfoo| as well, and when |\ShowCommand\endfoo| is used, change
 %   that to |\ShowCommand\foo| and do the same.
+% \changes{v1.0j}{2021/13/31}
+%         {Make \cs{ShowCommand} stop for interaction}
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_show_environment:N #1
   {
     \exp_after:wN \@@_show_environment:Nnnw #1 \q_@@
-    \iow_term:x
+    \tl_show:x
       {
-        > ~ \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline:
+        \token_to_str:N \end { \cs_to_str:N #1 } : \iow_newline:
         -> \exp_args:Nc \cs_replacement_spec:N
-          { environment~ \cs_to_str:N #1 ~end~aux~ } .
+          { environment~ \cs_to_str:N #1 ~end~aux~ }
       }
   }
 \cs_new_protected:Npn \@@_show_environment:Nnnw #1 #2 #3 #4 \q_@@
diff --git a/base/testfiles-ltcmd/github-569b.tlg b/base/testfiles-ltcmd/github-569b.tlg
index efabba2d..ce3ba55b 100644
--- a/base/testfiles-ltcmd/github-569b.tlg
+++ b/base/testfiles-ltcmd/github-569b.tlg
@@ -20,6 +20,8 @@ Don't change this file in any respect.
 ##8:#8
 ##9:#9
 }.
+<recently read> }
+l. ...\ShowCommand\foo
 > \foo=expandable document command:
   #1:m
   #2:o
@@ -40,6 +42,8 @@ Don't change this file in any respect.
 ##8:#8
 ##9:#9
 }.
+<recently read> }
+l. ...\ShowCommand\foo
 > \foo=document command:
   #1:E_{A}
   #2:E^{B}
@@ -54,6 +58,8 @@ Don't change this file in any respect.
 ##5:#5
 ##6:#6
 }.
+<recently read> }
+l. ...\ShowCommand\foo
 > \begin{foo}=document environment:
   #1:m
   #2:o
@@ -68,6 +74,8 @@ Don't change this file in any respect.
 ##2:#2
 ##3:#3
 ##4:#4}.
+<recently read> }
+l. ...\ShowCommand\foo
 > \end{foo}:
 ->\typeout {##5:#5
 ##6:#6
@@ -75,6 +83,8 @@ Don't change this file in any respect.
 ##8:#8
 ##9:#9
 }.
+<recently read> }
+l. ...\ShowCommand\foo
 > \begin{foo}=document environment:
   #1:m
   #2:o
@@ -89,6 +99,8 @@ Don't change this file in any respect.
 ##2:#2
 ##3:#3
 ##4:#4}.
+<recently read> }
+l. ...\ShowCommand\endfoo
 > \end{foo}:
 ->\typeout {##5:#5
 ##6:#6
@@ -96,3 +108,5 @@ Don't change this file in any respect.
 ##8:#8
 ##9:#9
 }.
+<recently read> }
+l. ...\ShowCommand\endfoo





More information about the latex3-commits mailing list.