emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Kaushal Modi <kaushal.modi@gmail.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>, Rasmus <rasmus@gmx.us>
Subject: Re: [RFC] New "kbd" macro?
Date: Sun, 17 Sep 2017 09:20:15 +0200	[thread overview]
Message-ID: <87efr594gg.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87fuboc60m.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Fri, 15 Sep 2017 17:53:45 +0200")

Completing myself:

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Kaushal Modi <kaushal.modi@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	other threads:[~2017-09-17  7:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 13:22 [RFC] New "kbd" macro? Nicolas Goaziou
2017-09-13 14:03 ` Kaushal Modi
2017-09-13 14:05   ` Kaushal Modi
2017-09-13 19:25   ` Nicolas Goaziou
2017-09-14  4:45   ` Marcin Borkowski
2017-09-14 13:49   ` Oleh Krehel
2017-09-13 19:24 ` Eric S Fraga
2017-09-14  8:07 ` Rasmus
2017-09-14 22:02   ` Nicolas Goaziou
2017-09-15  7:36     ` Rasmus
2017-09-15 10:16       ` Nicolas Goaziou
2017-09-15 11:20         ` Rasmus
2017-09-15 11:52           ` Nicolas Goaziou
2017-09-15 12:54     ` Kaushal Modi
2017-09-15 13:08       ` Kaushal Modi
2017-09-15 15:53         ` Nicolas Goaziou
2017-09-17  7:20           ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87efr594gg.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=kaushal.modi@gmail.com \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).