emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Proposal: 'executable' org-capture-templaes
Date: Sun, 3 Jul 2022 10:32:16 +0700	[thread overview]
Message-ID: <t9r2k2$bbn$1@ciao.gmane.io> (raw)
In-Reply-To: <AM9PR09MB497729C6B8BB6E492380F65196B19@AM9PR09MB4977.eurprd09.prod.outlook.com>

On 19/06/2022 22:34, Arthur Miller wrote:
> Max Nikulin writes:
>> I believe, multiple capture menus should be possible in parallel even within
>> single frame since it may contain several windows and user experience should be
>> better than now. Keymap-based selection opens a road in this direction since
>> menu may be non-modal, but it requires a bit different design.
> That sounds like a new feature. You are correct, keymaps do open in that
> direction. That would be possible to tuck on the routine that saves the
> temporary buffer (whatever is called with C-c C-c). When user press C-c C-c in a
> capture buffer, that is the only time when interaction with real a file on the
> disk happends, right?

I am going through older messages trying to find possible sources of 
different assumptions. I am at least partially repeating myself, but I 
consider this point as an important one.

When a capture template is selected, `org-capture-fill-template' adds 
capture text to the proper heading of the target document. Capture 
windows display narrowed down buffers of target documents. Disk 
operations happen on C-c C-s hit by user (it can be done for a capture 
buffer as well) or on autosave timer. Aborting capture by C-c C-k 
reverts the change by erasing earlier added text from the target 
document. It is safe to have multiple capture buffers, but some amount 
of work is required to make parallel menu buffers straightforward.

>> I mentioned completing-read because I consider it as a test of API quality. It
>> should be possible to plug alternative menu implementation and completing read
>> may be a simple enough variant. It is blocking, but in the case of capture "push
>> to capture queue" could be used to postpone the action.
> I don't think it matters there that completing read is blocking. Users do
> completing read just to pick one action to get executed. I don't think I
> understand how qeue of captures to do would work, to be honest.

It is related to code calling menu rather than implementation of menu. 
It is a way to improve handling of parallel capture template selection 
menus even with `org-mks'. Certainly I expect that new menu library will 
not add any new obstacles. Assume a modal template selection is 
configured, e.g. based on completing read and such "menu" is currently 
active. The user may switch to another application and request new 
capture through "org-protocol:" URI. The best way to handle such case 
from my point of view is to detect that the menu is active, collect 
values necessary to expand template and put this capture state to some 
queue. As soon as the user selects template for the capture started 
earlier, next state is popped from the queue and next template selection 
prompt is activated.

>> P.S. Notice text properties for entries in the following modal menu:
>> Timothy to emacs-orgmode. [PATCH] New remote resource download policy. Sun, 12
>> Jun 2022 22:43:07 +0800. https://list.orgmode.org/87mteiq6ou.fsf@gmail.com
> I am not sure what do you bring that cod up? I looked at the link, but I just
> see text styling with faces. Do  you mean to use text properties to communicate
> the state? Sure text properties can be used for different things, but already
> have "template" (a list) we are passing around. Isn't it sufficient as a state
> carrier. You can push/pop things off of it to communicate whatever. Forgive me
> if I don't understand what you meant there.

At that moment I considered it as a feature request to add text 
properties to keys displayed in the menu. Later I realized that it is 
not a problem even for `org-mks' since strings with keys may be 
propertized in advance.

It is unrelated to user state, but the patch adds another implementation 
of menu. I hope that it will be possible to avoid dedicated menu code 
for this particular query and rely on org-select your proposed.

Timothy wrote that a reason for custom menu was modal nature of 
`org-mks', so it would made impossible to inspect the document before 
decision if a remote URL should be allowed. org-select should relieve 
this limitation.

  reply	other threads:[~2022-07-03  3:33 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
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 [this message]
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='t9r2k2$bbn$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \


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