On 15/06/2011 14:14, Joseph Wright wrote:
> There are a number of ways we could handle this. One way would be to
> have a \DeclareBookmarkableCommand (or similar) macro, which would work
> in the form
>    \DeclareBookmarkableCommand\foo{m}
>      {Standard code}
>      {Bookmark code}

One issue this approach would raise is whether the two implementations
(expandable and non-expandable) should be tied together. You can imagine
using the \DeclareDocumentCommandImplemenation idea to separate out
expandable and protected versions of a macro without needing to create
both at the same time.

One approach might then be

  \DeclareBookmarkCommand \foo { m } { Bookmark code }

which checks for an existing \foo, checks that the arg. spec. is the
same, then does what Heiko suggested and sets things up to allow a
selection of route.
Joseph Wright