[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [RFC] New "kbd" macro?
From: |
Nicolas Goaziou |
Subject: |
Re: [O] [RFC] New "kbd" macro? |
Date: |
Sun, 17 Sep 2017 09:20:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Completing myself:
Nicolas Goaziou <address@hidden> writes:
> Kaushal Modi <address@hidden> 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,