all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Timothy <orgmode@tec.tecosaur.net>
To: emacs-orgmode@gnu.org
Subject: Dynamic keybindings in the manual
Date: Sun, 25 Sep 2022 23:30:00 +0800	[thread overview]
Message-ID: <87zgenxy0e.fsf@tec.tecosaur.net> (raw)

[-- 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

             reply	other threads:[~2022-09-25 15:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 15:30 Timothy [this message]
2022-09-25 17:52 ` Dynamic keybindings in the manual 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

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

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

  git send-email \
    --in-reply-to=87zgenxy0e.fsf@tec.tecosaur.net \
    --to=orgmode@tec.tecosaur.net \
    --cc=emacs-orgmode@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.