diff options
author | Karl Berry <karl@freefriends.org> | 2014-11-27 23:13:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-11-27 23:13:25 +0000 |
commit | c7cbb3204c55f770253d06d1b5bf0ac87d8d82e7 (patch) | |
tree | de3df344b5ec86321915da54b47d4aab9170226d /Master/texmf-dist/source/latex/everyhook/everyhook.dtx | |
parent | 1a1408f472bf9441bdfb843abe54322dcf13ec31 (diff) |
everyhook (27nov14)
git-svn-id: svn://tug.org/texlive/trunk@35675 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/everyhook/everyhook.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/everyhook/everyhook.dtx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/latex/everyhook/everyhook.dtx b/Master/texmf-dist/source/latex/everyhook/everyhook.dtx index 9567ec290bb..bb62f32b535 100644 --- a/Master/texmf-dist/source/latex/everyhook/everyhook.dtx +++ b/Master/texmf-dist/source/latex/everyhook/everyhook.dtx @@ -1,7 +1,7 @@ % \iffalse The license starting three lines down applies to this file %<*batchfile> \begingroup\input docstrip \preamble -Copyright (C) 2010, 2011 by Stephen Checkoway +Copyright (C) 2010, 2011, 2014 by Stephen Checkoway This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either @@ -75,7 +75,7 @@ everyhook.sty. \GetFileInfo{\jobname.sty} \title{The \textsf{\jobname} package\thanks{This document corresponds to \textsf{\jobname}~\fileversion, dated \filedate.}} -\author{Stephen Checkoway\\\texttt{s@cs.ucsd.edu}} +\author{Stephen Checkoway\\\texttt{s@cs.jhu.edu}} \lstset{language=[LaTeX]TeX,basicstyle=\ttfamily, texcsstyle=*\normalfont\bfseries, @@ -367,12 +367,13 @@ normal behavior with \cs{afterassignment} and % % \changes{v1.0}{2010/09/26}{Initial version} % \changes{v1.1}{2011/02/03}{Add excludeor} +% \changes{v1.2}{2014/11/26}{Let everyX be redefined} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}[1999/12/01] \RequirePackage{svn-prov} \ProvidesPackageSVN - {$Id: everyhook.dtx 10 2011-02-04 06:43:36Z steve $} - [v1.1 \revinfo\ Hooks for low level TeX everyX primitives.] + {$Id: everyhook.dtx 12 2014-11-26 15:34:56Z steve $} + [v1.2 \revinfo\ Hooks for low level TeX everyX primitives.] \DeclareOption{excludeor}{% \AtBeginDocument{% \output\expandafter{% @@ -389,13 +390,14 @@ normal behavior with \cs{afterassignment} and % \begin{macro}{\eh@definehook} % This performs all of the setup work for each hook. First, it takes % control of \TeX's token parameter given in the second argument. Then -% it shows the name of the primitive with a normal token register (and +% it shadows the name of the primitive with a normal token register (and % copies the current definition). The pre and post hooks are defined % to be initially empty. % \begin{macrocode} \def\eh@definehook#1#2{% \cslet{eh@every#1}#2% \newtoks#2% + \cslet{eh@private#1}#2% #2\csuse{eh@every#1}% \csdef{eh@pre#1}{}% \csdef{eh@post#1}{}% @@ -410,9 +412,16 @@ normal behavior with \cs{afterassignment} and % before the the token register \cs{everyfoo} is expanded. Thus if the % post hook is empty, then code in \cs{everyfoo} sees no additional % tokens, in case that is important. +% +% Unfortunately, some code wants to redefine \cs{everyfoo} itself in +% order to prevent \emph{other} code that uses \cs{everyfoo} from +% actually setting anything. To deal with that, we use the private +% token list +% +% \indent\lstinline!\eh@everyfoo{\eh@prefoo\the\expandafter\eh@privatefoo\eh@postfoo}! % \begin{macrocode} \csuse{eh@every#1}\expandafter{\csname eh@pre#1\expandafter\endcsname - \expandafter\the\expandafter\expandafter\expandafter#2% + \expandafter\the\csname eh@private#1\expandafter\endcsname \csname eh@post#1\endcsname}% } % \end{macrocode} |