diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3basics.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3basics.dtx | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index ac429fd8883..d38807ba1f6 100644 --- a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx +++ b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx @@ -35,7 +35,7 @@ % %<*driver|package> \RequirePackage{l3bootstrap} -\GetIdInfo$Id: l3basics.dtx 4144 2012-08-27 19:37:16Z bruno $ +\GetIdInfo$Id: l3basics.dtx 4212 2012-09-09 12:24:04Z bruno $ {L3 Basic definitions} %</driver|package> %<*driver> @@ -677,14 +677,15 @@ % \end{texnote} % \end{function} % -% \begin{function}[updated = 2011-12-22]{\cs_show:N, \cs_show:c} +% \begin{function}[updated = 2012-09-09]{\cs_show:N, \cs_show:c} % \begin{syntax} % \cs{cs_show:N} \meta{control sequence} % \end{syntax} % Displays the definition of the \meta{control sequence} on the % terminal. % \begin{texnote} -% This is the \TeX{} primitive \tn{show}. +% This is similar to the \TeX{} primitive \tn{show}, wrapped to a +% fixed number of characters per line. % \end{texnote} % \end{function} % @@ -1299,7 +1300,7 @@ % % \begin{function}{\__kernel_register_show:N, \__kernel_register_show:c} % \begin{syntax} -% \cs{\__kernel_register_show:N} \meta{register} +% \cs{__kernel_register_show:N} \meta{register} % \end{syntax} % Used to show the contents of a \TeX{} register at the terminal, formatted % such that internal parts of the mechanism are not visible. @@ -1410,16 +1411,13 @@ % \end{macro} % % \begin{macro}[EXP]{\token_to_meaning:N, \token_to_str:N, \cs_meaning:N} -% \begin{macro}{\cs_show:N} % Examining a control sequence or token. % \begin{macrocode} \tex_let:D \token_to_meaning:N \tex_meaning:D \tex_let:D \token_to_str:N \tex_string:D \tex_let:D \cs_meaning:N \tex_meaning:D -\tex_let:D \cs_show:N \tex_show:D % \end{macrocode} % \end{macro} -% \end{macro} % % \begin{macro}{\scan_stop:, \group_begin:, \group_end:} % The next three are basic functions for which there also exist @@ -1458,17 +1456,12 @@ % \end{macro} % % \begin{macro}[EXP]{\token_to_meaning:c, \token_to_str:c, \cs_meaning:c} -% \begin{macro}{\cs_show:c} % A small number of variants defined by hand. % Some of the necessary functions % (\cs{use_i:nn}, \cs{use_ii:nn}, and \cs{exp_args:NNc}) are not % defined at that point yet, but will be defined before those variants % are used. The \cs{cs_meaning:c} command must check for an undefined -% control sequence to avoid defining it mistakenly. The -% \cs{cs_show:c} command is \enquote{protected} because its action is -% not expandable. Also, the conversion of its argument to a control -% sequence is done within a group to avoid showing \tn{relax} for -% undefined control sequences. +% control sequence to avoid defining it mistakenly. % \begin{macrocode} \tex_def:D \token_to_str:c { \exp_args:Nc \token_to_str:N } \tex_long:D \tex_def:D \cs_meaning:c #1 @@ -1482,11 +1475,8 @@ { \tl_to_str:n {undefined} } } \tex_let:D \token_to_meaning:c = \cs_meaning:c -\etex_protected:D \tex_def:D \cs_show:c - { \group_begin: \exp_args:NNc \group_end: \cs_show:N } % \end{macrocode} % \end{macro} -% \end{macro} % % \subsection{Defining some constants} % @@ -2891,7 +2881,7 @@ % \end{macrocode} % \end{macro} % -% \subsection{Diagnostic wrapper functions} +% \subsection{Diagnostic functions} % % \begin{macro}[int]{\__kernel_register_show:N, \__kernel_register_show:c} % Check that the variable exists, then apply the \tn{showthe} primitive to @@ -2911,6 +2901,41 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\cs_show:N, \cs_show:c} +% \begin{macro}[aux, EXP]{\__cs_show:www} +% Some control sequences have a very long name or meaning. Thus, +% simply using \TeX{}'s primitive \tn{show} could lead to overlong +% lines. The output of this primitive is mimicked to some extent: a +% line-break is added after the first colon in the meaning (this is +% what \TeX{} does for macros and five |\...mark| primitives). Then +% the re-built string is given to \cs{iow_wrap:nnnN} for +% line-wrapping. The \cs{cs_show:c} command converts its argument to +% a control sequence within a group to avoid showing \tn{relax} for +% undefined control sequences. +% \begin{macrocode} +\group_begin: + \tex_lccode:D `? = `: \scan_stop: + \tex_catcode:D `? = 12 \scan_stop: +\tex_lowercase:D + { + \group_end: + \cs_new_protected:Npn \cs_show:N #1 + { + \__msg_show_variable:n + { + > ~ \token_to_str:N #1 = + \exp_after:wN \__cs_show:www \cs_meaning:N #1 + \use_none:nn ? \prg_do_nothing: + } + } + \cs_new:Npn \__cs_show:www #1 ? { #1 ? \\ } + } +\cs_new_protected_nopar:Npn \cs_show:c + { \group_begin: \exp_args:NNc \group_end: \cs_show:N } +% \end{macrocode} +% \end{macro} +% \end{macro} +% % \subsection{Engine specific definitions} % % \begin{macro}[pTF, EXP] |