emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Proposal: 'executable' org-capture-templaes
Date: Fri, 27 May 2022 14:17:25 +0200	[thread overview]
Message-ID: <AM9PR09MB497778E3208F42D82BE7F21996D89@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <87mtf3tui1.fsf@localhost> (Ihor Radchenko's message of "Fri, 27 May 2022 13:27:50 +0800")

Ihor Radchenko <yantar92@gmail.com> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>> I was playing with org-capture today, and it strike me that it could be used as
>> a simple and lightweight alternative to create GUIs for user options, somewhat
>> resembling the use of well-known hydra/transient or built-in help macro or easy
>> menu.
> Is there any reason why you dislike transient (now part of Emacs core)?

It is not about me disliking transient, I am sure it is a great library. It is
more about simplicity and efficiency. Entire org-capture is ~2/3 of the size of
transient alone, and as an org user I have org-mode loaded almost always, while
I don't have transient loaded, since I am using magit very, very rarely, which I
believe is the only consumer of transient in my Emacs. So it is more about
lightness and efficiency. 

Simplicity comes from the org-templates. Me, and I guess other people are
familiar with org-catpure templates already, and I mean, can it be simpler to
create a menu of choices then a simple list:

'(("key1" "label1" exec (lambda () ...))
  ("key2" "label2" exec (labmda () ...))

People are already writing those as part of org-capture, so there is a
familiarity factor. Transient has to be learned, and the complexity is much

For the record, there are other alternatives to transient that were already in Emacs
for example macro 'make-help-screen', as used in Emacs help, but the complexity
is also bigger, I am sure you are aware of it's usage, but for other readers, an
example usage is in help.el, starting on line 238, where help menu is built. It
is not terribly complicated to use, but it is still more involved then
org-capture template would be.

Of course, those are more capapble than org-capture, but most often we need just
a simple choice.

> We actually had multiple threads discussing possibility to port all the
> Org dialogues to transient.

I have unfortunately missed those discussions. But as said, I am not in to argue
for or against transient at all. I would just like to re-use the org-capture
code, since it is already in-place.

>> I would like to propose a small 'feature/change' to org-capture templates, to
>> inlude a new target: 'exec'. It should be followed by a function to be
>> executed.
>> I believe that this is a simple change that does not intrude on anything else in
>> org-capture, you can see the attached patch. The goal is to just circumwent the
>> createion of capture buffer, bookmark and other processing done by org-capture
>> etc. However there might be things I am not aware of, so if someone have more
>> insight, it is welcomed to hear.
> It seems to be quite out of scope of org-capture.

Maybe, but than what is in scope of org-mode or org-capture or Emacs? We are
constantly bending code to do what it is not really meant to do. Since to be a
DNA of Emacs :).

>                                                   If anything, capture
> menu might be factored out to a generic menu framework.

Please no. Not every single piece of Emacs has to be a generalized
framework. Generalized frameworks add an extra layer of complexity, and it this
case, as you point out, we have other frameworks, so yet another framework is
*definitely* not what I ask for.

> already have transient achieving the same goal.

Yes, and other alternatives, but to higher cost mentally and computationally.

I just wish to use org-capture for its simplicity and lighntess. Considering
it's five lines of code, and no additional learning required to use it, I think
it is rather "cheap". We also had easy-menu and make-help-screen when we got
org-capture and transient. I can still understand the feeling that it is "out of
scope", but I don't think it is terribly out of org-capture waters.

Anyway, it is a proposal, and if you don't want it in org it is OK. I personally
think it could make life simpler in cases people need a simple choice menus to
fire up an action, and it comes with very small cost.

best regards

  reply	other threads:[~2022-05-27 12:18 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-26 15:27 Proposal: 'executable' org-capture-templaes Arthur Miller
2022-05-27  5:27 ` Ihor Radchenko
2022-05-27 12:17   ` Arthur Miller [this message]
2022-05-27 14:35     ` Max Nikulin
2022-05-28  3:51     ` Ihor Radchenko
2022-05-30  2:04       ` Arthur Miller
2022-05-30  5:05         ` Ihor Radchenko
2022-05-30 12:40           ` Arthur Miller
2022-05-31  4:58             ` Ihor Radchenko
2022-05-31 14:46               ` Arthur Miller
2022-06-04 15:35               ` Arthur Miller
2022-06-05  0:04                 ` Ihor Radchenko
2022-06-05 15:16                   ` Arthur Miller
2022-06-05 23:05                     ` Tim Cross
2022-06-08 12:43                       ` Ihor Radchenko
2022-06-08 21:13                         ` Tim Cross
2022-06-09  4:00                           ` Ihor Radchenko
2022-06-17  4:40                         ` Arthur Miller
2022-06-18  4:03                           ` Ihor Radchenko
2022-06-18  4:26                             ` Tim Cross
2022-06-18 12:25                       ` Max Nikulin
2022-06-08 12:24                     ` Ihor Radchenko
2022-06-05  7:36                 ` Max Nikulin
2022-06-05 15:07                   ` Arthur Miller
2022-06-06 17:06                     ` Max Nikulin
2022-06-07  3:09                       ` Samuel Wales
2022-06-07  3:16                         ` Samuel Wales
2022-06-08 12:48                           ` Ihor Radchenko
2022-06-10 16:53                         ` Max Nikulin
2022-06-11  5:26                           ` Ihor Radchenko
2022-06-18  8:18                             ` Max Nikulin
2022-06-18  8:25                               ` Ihor Radchenko
2022-06-19 11:20                                 ` Max Nikulin
2022-06-20 12:10                                   ` Ihor Radchenko
2022-06-20 17:24                                     ` Max Nikulin
2022-06-21  4:07                                       ` Ihor Radchenko
2022-06-21  7:38                                         ` Arthur Miller
2022-06-21 15:48                                         ` Max Nikulin
2022-06-22 12:13                                           ` Arthur Miller
2022-06-22 16:29                                             ` Max Nikulin
2022-06-26  4:50                                               ` Arthur Miller
2022-06-29 17:02                                                 ` Max Nikulin
2022-06-30 23:30                                                   ` Arthur Miller
2022-07-01 15:53                                                     ` Proposal: 'executable' org-capture-templates Max Nikulin
2022-06-25  7:32                                             ` Proposal: 'executable' org-capture-templaes Ihor Radchenko
2022-06-26  4:25                                               ` Arthur Miller
2022-06-26  4:37                                                 ` Ihor Radchenko
2022-06-26  4:52                                                   ` Arthur Miller
2022-06-21  7:37                                       ` Arthur Miller
2022-07-02 11:31                                         ` Max Nikulin
2022-07-03 15:12                                           ` Arthur Miller
2022-07-07 16:14                                             ` Proposal: 'executable' org-capture-templates Max Nikulin
2022-06-18 15:05                               ` Proposal: 'executable' org-capture-templaes Arthur Miller
2022-06-19 10:53                                 ` Max Nikulin
2022-06-19 15:34                                   ` Arthur Miller
2022-07-03  3:32                                     ` Max Nikulin
2022-06-08 12:35                     ` Ihor Radchenko
2022-05-31 16:37         ` Max Nikulin
2022-06-01  1:45           ` arthur miller

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:

  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=AM9PR09MB497778E3208F42D82BE7F21996D89@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.com \


* 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


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