[latex3-commits] [l3svn] branch master updated: Update \char_set_active_eq:NN/Remove \char_set_active:Npn
noreply at latex-project.org
noreply at latex-project.org
Tue Sep 1 23:35:46 CEST 2015
This is an automated email from the git hooks/post-receive script.
joseph pushed a commit to branch master
in repository l3svn.
The following commit(s) were added to refs/heads/master by this push:
new 32571f7 Update \char_set_active_eq:NN/Remove \char_set_active:Npn
32571f7 is described below
commit 32571f7232292b1df20f9b414b534168fc4a709b
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Sep 1 22:34:20 2015 +0100
Update \char_set_active_eq:NN/Remove \char_set_active:Npn
As discussed on the team list, the updated approach here does not
itself make the char active. It also means that all active chars
must have some equivalent funtion (macro) defintion.
To do yet is 'char generation' (cf. \Ucharcat).
---
l3kernel/l3candidates.dtx | 70 +++++++------------------------
l3kernel/l3doc.dtx | 4 +-
l3kernel/testfiles/m3expl001.luatex.tlg | 4 --
l3kernel/testfiles/m3expl001.tlg | 4 --
l3kernel/testfiles/m3expl001.xetex.tlg | 4 --
l3kernel/testfiles/m3expl003.luatex.tlg | 4 --
l3kernel/testfiles/m3expl003.tlg | 4 --
l3kernel/testfiles/m3expl003.xetex.tlg | 4 --
l3kernel/testfiles/m3token005.lvt | 27 ++++++------
9 files changed, 32 insertions(+), 93 deletions(-)
diff --git a/l3kernel/l3candidates.dtx b/l3kernel/l3candidates.dtx
index 06579e3..8aa4aca 100644
--- a/l3kernel/l3candidates.dtx
+++ b/l3kernel/l3candidates.dtx
@@ -1034,52 +1034,16 @@
%
% \section{Additions to \pkg{l3tokens}}
%
-% \begin{function}{\char_set_active:Npn, \char_set_active:Npx}
-% \begin{syntax}
-% \cs{char_set_active:Npn} \meta{char} \meta{parameters} \Arg{code}
-% \end{syntax}
-% Makes \meta{char} an active character to expand to \meta{code} as
-% replacement text.
-% Within the \meta{code}, the \meta{parameters} (|#1|, |#2|,
-% \emph{etc.}) will be replaced by those absorbed. The \meta{char} is
-% made active within the current \TeX{} group level, and the definition
-% is also local.
-% \end{function}
-%
-% \begin{function}{\char_gset_active:Npn, \char_gset_active:Npx}
-% \begin{syntax}
-% \cs{char_gset_active:Npn} \meta{char} \meta{parameters} \Arg{code}
-% \end{syntax}
-% Makes \meta{char} an active character to expand to \meta{code} as
-% replacement text.
-% Within the \meta{code}, the \meta{parameters} (|#1|, |#2|,
-% \emph{etc.}) will be replaced by those absorbed. The \meta{char} is
-% made active within the current \TeX{} group level, but the definition
-% is global. This function is therefore suited to cases where an active
-% character definition should be applied only in some context (where the
-% \meta{char} is again made active).
-% \end{function}
-%
-% \begin{function}{\char_set_active_eq:NN}
+% \begin{function}[updated = 2015-09-01]
+% {\char_set_active_eq:NN, \char_gset_active_eq:NN}
% \begin{syntax}
% \cs{char_set_active_eq:NN} \meta{char} \meta{function}
% \end{syntax}
-% Makes \meta{char} an active character equivalent in meaning to the
-% \meta{function} (which may itself be an active character). The \meta{char}
-% is made active within the current \TeX{} group level, and the definition
-% is also local.
-% \end{function}
-%
-% \begin{function}{\char_gset_active_eq:NN}
-% \begin{syntax}
-% \cs{char_gset_active_eq:NN} \meta{char} \meta{function}
-% \end{syntax}
-% Makes \meta{char} an active character equivalent in meaning to the
-% \meta{function} (which may itself be an active character). The \meta{char}
-% is made active within the current \TeX{} group level, but the definition
-% is global. This function is therefore suited to cases where an active
-% character definition should be applied only in some context (where the
-% \meta{char} is again made active).
+% Sets the behaviour of the \meta{char} in situations where it is an
+% active char (category code $13$) to be equivalent to that of the
+% \meta{function}. The category code of the \meta{char} is
+% \emph{unchanged} by this process. The \meta{function} may itself
+% be an active character.
% \end{function}
%
% \begin{function}[TF, updated = 2012-12-20]{\peek_N_type:}
@@ -4335,33 +4299,27 @@
%<@@=char>
% \end{macrocode}
%
-% \begin{macro}{\char_set_active:Npn, \char_set_active:Npx}
-% \begin{macro}{\char_gset_active:Npn, \char_gset_active:Npx}
% \begin{macro}{\char_set_active_eq:NN, \char_gset_active_eq:NN}
+% Two simple functions with very similar definitions, so set up using
+% an auxiliary.
% \begin{macrocode}
\group_begin:
\char_set_catcode_active:N \^^@
- \cs_set:Npn \char_tmp:NN #1#2
+ \cs_set_protected:Npn \char_tmp:NN #1#2
{
- \cs_new:Npn #1 ##1
+ \cs_new_protected:Npn #1 ##1
{
- \char_set_catcode_active:n { `##1 }
\group_begin:
- \char_set_lccode:nn { `\^^@ } { `##1 }
- \tl_to_lowercase:n { \group_end: #2 ^^@ }
+ \char_set_catcode_active:n { `##1 }
+ \char_set_lccode:nn { `\^^@ } { `##1 }
+ \tex_lowercase:D { \group_end: #2 ^^@ }
}
}
- \char_tmp:NN \char_set_active:Npn \cs_set:Npn
- \char_tmp:NN \char_set_active:Npx \cs_set:Npx
- \char_tmp:NN \char_gset_active:Npn \cs_gset:Npn
- \char_tmp:NN \char_gset_active:Npx \cs_gset:Npx
\char_tmp:NN \char_set_active_eq:NN \cs_set_eq:NN
\char_tmp:NN \char_gset_active_eq:NN \cs_gset_eq:NN
\group_end:
% \end{macrocode}
% \end{macro}
-% \end{macro}
-% \end{macro}
%
% \begin{macrocode}
%<@@=peek>
diff --git a/l3kernel/l3doc.dtx b/l3kernel/l3doc.dtx
index 6fb6f7b..743dd33 100644
--- a/l3kernel/l3doc.dtx
+++ b/l3kernel/l3doc.dtx
@@ -1681,7 +1681,9 @@ Do not distribute a modified version of this file.
\bool_set_false:N \l_@@_macro_EXP_bool
\bool_set_false:N \l_@@_macro_rEXP_bool
\bool_set_false:N \l_@@_no_label_bool
- \char_set_active:Npn < ##1 > { \meta {##1} }
+ \cs_set_protected:Npn \@@_active_meta:w ##1 > { \meta {##1} }
+ \char_set_active_eq:NN < \@@_active_meta:w
+ \char_set_catcode_active:N \<
}
% \end{macrocode}
% \end{macro}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 85f66a9..2a961ed 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -4204,10 +4204,6 @@ Defining \c__tl_change_case_misc_lower_tl on line ...
Defining \tl_log:N on line ...
Defining \tl_log:c on line ...
Defining \tl_log:n on line ...
-Defining \char_set_active:Npn on line ...
-Defining \char_set_active:Npx on line ...
-Defining \char_gset_active:Npn on line ...
-Defining \char_gset_active:Npx on line ...
Defining \char_set_active_eq:NN on line ...
Defining \char_gset_active_eq:NN on line ...
Defining \__peek_execute_branches_N_type: on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index ceec02e..2dab29d 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -4203,10 +4203,6 @@ Defining \c__tl_change_case_misc_lower_tl on line ...
Defining \tl_log:N on line ...
Defining \tl_log:c on line ...
Defining \tl_log:n on line ...
-Defining \char_set_active:Npn on line ...
-Defining \char_set_active:Npx on line ...
-Defining \char_gset_active:Npn on line ...
-Defining \char_gset_active:Npx on line ...
Defining \char_set_active_eq:NN on line ...
Defining \char_gset_active_eq:NN on line ...
Defining \__peek_execute_branches_N_type: on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 63b6837..d9f9e72 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -4203,10 +4203,6 @@ Defining \c__tl_change_case_misc_lower_tl on line ...
Defining \tl_log:N on line ...
Defining \tl_log:c on line ...
Defining \tl_log:n on line ...
-Defining \char_set_active:Npn on line ...
-Defining \char_set_active:Npx on line ...
-Defining \char_gset_active:Npn on line ...
-Defining \char_gset_active:Npx on line ...
Defining \char_set_active_eq:NN on line ...
Defining \char_gset_active_eq:NN on line ...
Defining \__peek_execute_branches_N_type: on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index e34b43b..0f633b2 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -4205,10 +4205,6 @@ Defining \c__tl_change_case_misc_lower_tl on line ...
Defining \tl_log:N on line ...
Defining \tl_log:c on line ...
Defining \tl_log:n on line ...
-Defining \char_set_active:Npn on line ...
-Defining \char_set_active:Npx on line ...
-Defining \char_gset_active:Npn on line ...
-Defining \char_gset_active:Npx on line ...
Defining \char_set_active_eq:NN on line ...
Defining \char_gset_active_eq:NN on line ...
Defining \__peek_execute_branches_N_type: on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 2ee070f..e077f6c 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -4204,10 +4204,6 @@ Defining \c__tl_change_case_misc_lower_tl on line ...
Defining \tl_log:N on line ...
Defining \tl_log:c on line ...
Defining \tl_log:n on line ...
-Defining \char_set_active:Npn on line ...
-Defining \char_set_active:Npx on line ...
-Defining \char_gset_active:Npn on line ...
-Defining \char_gset_active:Npx on line ...
Defining \char_set_active_eq:NN on line ...
Defining \char_gset_active_eq:NN on line ...
Defining \__peek_execute_branches_N_type: on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index ac2d04b..1f0d6c4 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -4204,10 +4204,6 @@ Defining \c__tl_change_case_misc_lower_tl on line ...
Defining \tl_log:N on line ...
Defining \tl_log:c on line ...
Defining \tl_log:n on line ...
-Defining \char_set_active:Npn on line ...
-Defining \char_set_active:Npx on line ...
-Defining \char_gset_active:Npn on line ...
-Defining \char_gset_active:Npx on line ...
Defining \char_set_active_eq:NN on line ...
Defining \char_gset_active_eq:NN on line ...
Defining \__peek_execute_branches_N_type: on line ...
diff --git a/l3kernel/testfiles/m3token005.lvt b/l3kernel/testfiles/m3token005.lvt
index f10429a..1b84ce3 100644
--- a/l3kernel/testfiles/m3token005.lvt
+++ b/l3kernel/testfiles/m3token005.lvt
@@ -14,11 +14,12 @@
\TEST { Char~set~active~(setting) }
{
- \char_set_active:Npn A { Works }
- \char_gset_active:Npn B { Works }
+ \cs_set:Npn \test { Works }
+ \char_set_active_eq:NN A \test
+ \char_gset_active_eq:NN B \test
\group_begin:
- \char_set_active:Npn C { Works }
- \char_gset_active:Npn D { Works }
+ \char_set_active_eq:NN C \test
+ \char_gset_active_eq:NN D \test
\group_end:
\cs_log:N A
\cs_log:N B
@@ -28,11 +29,12 @@
\TEST { Char~set~active~(simple~rescan) }
{
- \char_set_active:Npn A { Works }
- \char_gset_active:Npn B { Works }
+ \cs_set:Npn \test { Works }
+ \char_set_active_eq:NN A \test
+ \char_gset_active_eq:NN B \test
\group_begin:
- \char_set_active:Npn C { Works }
- \char_gset_active:Npn D { Works }
+ \char_set_active_eq:NN C \test
+ \char_gset_active_eq:NN D \test
\group_end:
\tl_rescan:nn { } { \cs_log:N A }
\tl_rescan:nn { } { \cs_log:N B }
@@ -42,11 +44,12 @@
\TEST { Char~set~active~(make~active~rescan) }
{
- \char_set_active:Npn A { Works }
- \char_gset_active:Npn B { Works }
+ \cs_set:Npn \test { Works }
+ \char_set_active_eq:NN A \test
+ \char_gset_active_eq:NN B \test
\group_begin:
- \char_set_active:Npn C { Works }
- \char_gset_active:Npn D { Works }
+ \char_set_active_eq:NN C \test
+ \char_gset_active_eq:NN D \test
\group_end:
\tl_rescan:nn { \char_set_catcode_active:N \A } { \cs_log:N A }
\tl_rescan:nn { \char_set_catcode_active:N \B } { \cs_log:N B }
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the latex3-commits
mailing list