LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Proportional Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-Transfer-Encoding: 7bit
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Joseph Wright <[log in to unmask]>
Date: Sat, 13 Sep 2008 22:30:11 +0100
Content-Type: text/plain; charset=ISO-8859-1
MIME-Version: 1.0
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments: text/plain (27 lines)
Hello all,

I wonder if anyone can make a suggestion on how to solve a problem I'm
finding rather tricky with my "keys" efforts.  The issue is adding code
to an existing macro.  There are a number of scenarios, but I control
the initial definition, and so I have three possibilities:

1) Definitions with a known argument pattern (one parameter #1).  Here,
I can "recover" the code out of the macro definition, add to in and
re-cast the macro.  This works for \def:Npn and \def:Npx

2) \def:Npn macros with unknown "p".  Here, I can save the argument
pattern to a toks, and the body to a second toks. The macro can then be
redefined using the information in the two toks as needed.

3) \def:Npx macros with unknown "p".  This is the problem.  I can of
course save the argument and body *as given*, but can't find a method to
get the body toks expanded, nor a reliable way of recovering the data
from the macro definition itself.

Any ideas for (3) would be welcome.  One extra point is that ideally I
don't want to using \meaning + \scantokens, etc., as this looses catcode
information.  I'm hoping for a trick at the initial point of definition
based on the fact that I can hold onto the various bits and pieces.
-- 
Joseph Wright

ATOM RSS1 RSS2