Completing myself:

Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Kaushal Modi <kaushal.m...@gmail.com> writes:
>
>> Makes me think.. instead of hard-codng the kbd export forms in the macro,
>> wouldn't it be better to define those in the respective exporter
>> backends?
>
> We don't have a syntax for these. 
>
>> Can a mechanism be put in place so that we can have a 'kbd' element
>> behavior that can be defined in the :translate-alist?

There is a (convoluted) way, though.

The macro can expand to something specific, like a "kbd" export snippet
(i.e., @@kbd:...@@). "ox.el" can then turn these snippets into nested
(kbd ...) and (key ...) objects.

Pros:

- Every back-end can have total control over how "kbd" and "key" objects
  are transformed.

- Export back-ends that inherit from ours benefit from the
  transformation without additional work (like a regular macro).

Cons:

- It's less straightforward than a regular macro.

- Back-ends built from scratch (i.e., that do not inherit from any
  existing back-end) need to define handlers for those pseudo-objects
  (unlike to a regular macro). I'm not sure about where to document
  that.


I'm not sure it is worth it, considering, so far, only "latex" back-end
has no obvious default value.

WDYT?

Regards,

Reply via email to