On Mon, Nov 09, 2009 at 09:49:00AM +0100, Jean-Marc Lasgouttes wrote: > Enrico Forestieri <[email protected]> writes: > > After the overhaul by Abdel it became easy to accomplish the above goal of > > not interpreting \ce as a special inset when mhchem is disabled. I attach > > here a revised version of your patch that does that. The explicit check for > > mhchem is rather ugly, but given that this solves the problem of reverting > > to earlier versions, I retract my opposition, so you can apply it AFAIC. > > Instead of testing explicitely for \ce and \cf, wouldn't it be possible > to specify in the lib/symbols file that they require mchem and do the > test on this requirement? This would have the advantage (maybe) to be > generalizable to other cases.
This is a very good idea. Then, we could have a method, say isAllowed(name, package), where "package" is the required package for the macro named "name". If the method returns false, \name is treated as an unknown macro. Such that, if you write \dotsb and amsmath is disabled, you would see \dotsb in red (and not the dots as it is now). The difficulty would be that we now have something as params().use_amsmath, while "package" would be a string, not easily associated to the variable name "use_amsmath". However, ATM I have no time to explore this idea. -- Enrico
