Will Robertson wrote:
> On 15/09/2008, at 3:42 PM, Joseph Wright wrote:
>> So my attempts to create a simple hook:
>> \def:cpx {<key>} <arg spec.> {\exp_not:N\prehook <code>
>> \exp_not:posthook}
>> fail when the added code contains #1, #2, ... My current approach at
>> least does not give a TeX error under these circumstances (I've added a
>> custom one to warn of a problem).
>> I'm sure I'm mossing something, but my knowledge of TeX's approach to
>> doubling # characters, etc., is clearly insufficient to find it.
> Maybe as a pre-cursor to this work we should port patchcmd to expl3?
> Even that package only handles "plain" argument specs, though.
> W

That is a somewhat different issue, I think. As I said, the problem here
is my lack of knowledge of how to get the "hooks" to reproduce exactly
the input, including the "#1", etc., signs.

Of course, \patchcmd would be nice for other things (as I've already said).
Joseph Wright