From c7cbb3204c55f770253d06d1b5bf0ac87d8d82e7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 27 Nov 2014 23:13:25 +0000 Subject: everyhook (27nov14) git-svn-id: svn://tug.org/texlive/trunk@35675 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/everyhook/README | 4 ++-- .../texmf-dist/doc/latex/everyhook/everyhook.pdf | Bin 107902 -> 115777 bytes .../source/latex/everyhook/everyhook.dtx | 21 +++++++++++++++------ .../texmf-dist/tex/latex/everyhook/everyhook.sty | 9 +++++---- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Master/texmf-dist/doc/latex/everyhook/README b/Master/texmf-dist/doc/latex/everyhook/README index 215ac28f003..a282ebedb1b 100644 --- a/Master/texmf-dist/doc/latex/everyhook/README +++ b/Master/texmf-dist/doc/latex/everyhook/README @@ -1,4 +1,4 @@ -$Id: README 10 2011-02-04 06:43:36Z steve $ +$Id: README 13 2014-11-26 16:22:03Z steve $ ABOUT @@ -12,7 +12,7 @@ hooks. LICENSE -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 diff --git a/Master/texmf-dist/doc/latex/everyhook/everyhook.pdf b/Master/texmf-dist/doc/latex/everyhook/everyhook.pdf index 326e3b5eac5..0eae6be6794 100644 Binary files a/Master/texmf-dist/doc/latex/everyhook/everyhook.pdf and b/Master/texmf-dist/doc/latex/everyhook/everyhook.pdf differ 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} diff --git a/Master/texmf-dist/tex/latex/everyhook/everyhook.sty b/Master/texmf-dist/tex/latex/everyhook/everyhook.sty index 64e8d20785b..d35debea7bb 100644 --- a/Master/texmf-dist/tex/latex/everyhook/everyhook.sty +++ b/Master/texmf-dist/tex/latex/everyhook/everyhook.sty @@ -5,7 +5,7 @@ %% The original source files were: %% %% everyhook.dtx -%% 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 @@ -26,8 +26,8 @@ \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{% @@ -42,11 +42,12 @@ \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}{}% \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}% } \eh@definehook{par}\everypar -- cgit v1.2.3