From: mithraeum <mithraeum@protonmail.com>
To: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Feature request - Decouple org's keybindings from their functions
Date: Tue, 27 Nov 2018 02:50:49 +0000 [thread overview]
Message-ID: <zgdfQsfGgD_jIOJWbAcXO-OUFv_XRlNgR_NfdCNrnVrMg2kNqD_vjhecTHb8H1sZxIj55yPzHdHGtxGcemm73mvhshQOZhPIT2xx7vGZheY=@protonmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2230 bytes --]
I'd like to request that org's keybindings be separated from the functions they use to do their work.
This would greatly ease the use of these functions by people who want to use their own keybindings rather than relying on keybindings that org provides.
The reason I ask is that recently I've been going through org-agenda.el and binding its functions in to my own hydras, in a way that makes sense to me and is compatible with my own pre-existing keybindings. I've found that in many cases the default org keybindings are tightly integrated with their functionality. In some cases it's possible to decouple them with some reverse-engineering effort, but in other cases it's virtually impossible without rewriting the function -- and even understanding how an org function does its work is often difficult.
One example of this is the "org-agenda" dispatcher function, which (for example) offers no clear way to independently invoke the "<" ("Buffer, subtree/region restriction") or ">" ("Remove restriction") commands.
Another example is the definition of org-agenda-custom-commands, which require the user to go through the org-agenda dispatcher to invoke their custom agenda views. Those views would ideally be accessible by simple functions that the user could call directly any way they see fit.
As a user, it would make my life so much easier if I didn't have to delve deeply in to a menuing function's source code to figure out how it works so that I can bind something it does to a keyboard shortcut (or hydra) of my choice.
Ideally, each org menu's keybinding would be an exceedingly simple binding to a single function that should be just as easily invocable from user code as it is from org's own code. It should not be buried in a mountain of logic and assumptions in the middle of a function that builds up a ton of state before the inner function is callable, as that would require the user to reproduce that state before they could use the function themselves.
Ultimately, I think it would be much, much cleaner for org to use a dedicated, well designed menuing package like hydra to do its menuing. But simply decoupling org's keybindings from the functionality they invoke would be a great first step.
[-- Attachment #2: Type: text/html, Size: 2487 bytes --]
next reply other threads:[~2018-11-27 2:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-27 2:50 mithraeum [this message]
2018-11-27 8:02 ` Feature request - Decouple org's keybindings from their functions Nicolas Goaziou
2018-11-27 9:47 ` mithraeum
2018-11-28 8:04 ` stardiviner
2018-11-28 9:11 ` Ihor Radchenko
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='zgdfQsfGgD_jIOJWbAcXO-OUFv_XRlNgR_NfdCNrnVrMg2kNqD_vjhecTHb8H1sZxIj55yPzHdHGtxGcemm73mvhshQOZhPIT2xx7vGZheY=@protonmail.com' \
--to=mithraeum@protonmail.com \
--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 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).