[metapost] augment drawoptions

Taco Hoekwater taco at elvenkind.com
Sat Apr 12 09:35:15 CEST 2008


Stephan Hennig wrote:
> 
> To keep changes to draw options locally, I've tried to save _op_ prior
> to using addtodrawoptions.  But again, this doesn't work.  Any ideas?

You cannot save _op_ because it is a macro, not a variable.

You could do explicit macro definitions and restores with expandafter:

def savedrawoptions =
   expandafter def expandafter _savedop_ expandafter = _op_ enddef;
enddef

def restoredrawoptions =
   expandafter def expandafter _op_ expandafter = _savedop_ enddef;
enddef

But it is not very elegant. In fact, I cannot come up an elegant
solution to the problem that does not require rewriting quite a
bit of plain.mp.

Best wishes,
Taco



More information about the metapost mailing list