diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/l3kernel/l3basics.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/l3kernel/l3basics.dtx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx b/Master/texmf-dist/source/latex/l3kernel/l3basics.dtx index 95440947255..51bbd55bfab 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{l3names} -\GetIdInfo$Id: l3basics.dtx 2817 2011-09-12 14:16:56Z joseph $ +\GetIdInfo$Id: l3basics.dtx 2896 2011-10-09 20:36:50Z joseph $ {L3 Experimental basic definitions} %</driver|package> %<*driver> @@ -617,7 +617,7 @@ % There are occasions where control sequences need to be deleted. % This is handled in a very simple manner. % -% \begin{function}{\cs_undefine:N, \cs_undefine:c} +% \begin{function}[updated = 2011-09-15]{\cs_undefine:N, \cs_undefine:c} % \begin{syntax} % \cs{cs_undefine:N} \meta{control sequence} % \end{syntax} @@ -2282,7 +2282,7 @@ } } %<*package> -\tex_ifodd:D \@l@expl@log@functions@bool +\tex_ifodd:D \l@expl@log@functions@bool \cs_set_protected_nopar:Npn \chk_if_free_cs:N #1 { \cs_if_free:NF #1 @@ -2524,11 +2524,21 @@ % \begin{macro}{\cs_undefine:N, \cs_undefine:c} % The following function is used to free the main memory from the % definition of some function that isn't in use any longer. +% The \texttt{c} variant is careful not to add the control sequence +% to the hash table if it isn't there yet, and it also avoids nesting +% \TeX{} conditionals in case |#1| is unbalanced in this matter. % \begin{macrocode} \cs_new_protected_nopar:Npn \cs_undefine:N #1 { \cs_gset_eq:NN #1 \c_undefined:D } \cs_new_protected_nopar:Npn \cs_undefine:c #1 - { \cs_gset_eq:cN {#1} \c_undefined:D } + { + \if_cs_exist:w #1 \cs_end: + \exp_after:wN \use:n + \else: + \exp_after:wN \use_none:n + \fi: + { \cs_gset_eq:cN {#1} \c_undefined:D } + } % \end{macrocode} % \end{macro} % |