emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Dynamic keybindings in the manual
@ 2022-09-25 15:30 Timothy
  2022-09-25 17:52 ` Juan Manuel Macías
  2022-09-26  4:52 ` Bastien
  0 siblings, 2 replies; 5+ messages in thread
From: Timothy @ 2022-09-25 15:30 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1850 bytes --]

Hi All,

(skip to the rule if you’re not interested in a preamble)

In the recent discussion about potentially no longer generating `org-release' in
the Makefile, it was mentioned that `orgcard.tex' may be a bit of a blocker to
that.

This prompted me to take a look at `orgcard.tex' and I was surprised to discover
that it’s TeX TeX, not even LaTeX, and it has hard-coded keybindings.

Neither of those things seemed great to me, so I thought I’d try my hand at
whipping up an Org version. In doing so I made a macro that inserts the
appropriate keybinding.

┌────
│ #+macro: key (eval (format "{{{kbd(%s%s)}}}" (if $2 (concat $1 " ") "") (or (org-string-nw-p (key-description (or (where-is-internal (intern (string-trim (or $2 $1))) nil t) ))) (format "M-x %s" (string-trim (or $2 $1))))))
└────

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Looking at the manual, I see that it too has hardcoded keybindings. Considering
that occasional changes can easily slip by (see
<https://list.orgmode.org/20220916214715.109658-1-laalsaas@systemli.org>, just one
week ago), I think it would make sense to adopt a similar approach.

Instead of having
┌────
│ {{{kbd(C-c C-r)}}} (~org-reveal~)
└────


We could have
┌────
│ {{{cmd(org-reveal)}}}
└────


With the use of the earlier `key' macro and
┌────
│ #+macro: cmd {{{key($1)}}} (~$1~)
└────

While I think this could be a good idea, I don’t think I’m likely to get to this
any time soon, so I’m shooting this off to the ML in case other people are
interested.

All the best,
Timothy

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-28  6:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25 15:30 Dynamic keybindings in the manual Timothy
2022-09-25 17:52 ` Juan Manuel Macías
2022-09-26  4:52 ` Bastien
2022-09-26  4:55   ` changing orgcard.tex (was: Dynamic keybindings in the manual) Timothy
2022-09-28  6:16     ` changing orgcard.tex Bastien

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).