[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal: 'executable' org-capture-templaes

From: Ihor Radchenko
Subject: Re: Proposal: 'executable' org-capture-templaes
Date: Sat, 28 May 2022 11:51:58 +0800

Arthur Miller <arthur.miller@live.com> writes:

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

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

By "generic" I did not mean general-purpose all-functional framework.
We just need something to remove code duplication in
org-export-dispatch, org-agenda, org-capture, org-set-tags-command, etc
They all share pretty similar code to generate dialogues.

As for familiarity, I understand and it is exactly the reason why I
suggested to factor out the menu code from capture templates.

I am strongly not in favor of adding exec to org-capture itself. It's
a bit like if you were to add :activate-func for a link that actually
downloads some file from internet, then generates and exports agenda,
and meanwhile also restarts your remote server. This will also kind of
save the code, but completely out of purpose of :activate-func. Of
course, I am exaggerating here, but just want to make my point clear.

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

The last one was
And we had multiple complaints that Org menus are not searchable and do
not allow recursive edit.

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

Sure. But another feature of Emacs is being consistent. Emacs does
provide flexible interfaces, but they stick to they purpose. Abusing
them is up to the user (with no guarantees to work in future versions),
but not up to Emacs itself.

If we were to include your suggestion, we would also need to maintain
the new generalized functionality in future. Even if we need to change
some internals of org-capture. Over-generalization will put an extra
burden on future maintenance.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]