A more general version of
\DeclareTextComposite that runs
arbitrary code with cmd.
This allows accents on ‘i’ to act like accents on dotless i,
See fontenc package for a list of common encodings. Normally
cmd will have already been declared with
or as a one argument