emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Arthur Miller
Subject: Re: Proposal: 'executable' org-capture-templaes
Date: Sun, 03 Jul 2022 17:12:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Max Nikulin <manikulin@gmail.com> writes:

> On 21/06/2022 14:37, Arthur Miller wrote:
>> Emacs as a whole is not designed to work in the way I
>> percieve it has clean separation between contexts in each frame. Menu
>> buffer is "global" for entire Emacs process, and there are other
>> features of Emacs that does not work well in such scenarion. Some people
>> prefer to keep an Emacs process per project/task for that reason.
>
> A side note rather unrelated to menu for Org mode.
>
> My impression is that Emacs process per task scenario is not supported.

I am not sure if we think of same thing, but "process per task" means simply how
people use Emacs. Some people open each file in a new Emacs process, some people
like to keep different tasks in different instances of Emacs, for example Gnus
in one Emacs, and editing work in another etc. It is not that Emacs has some
feature that would make one prohibit to start Gnus in other session, or to load
same set of files in different Emacs processes, but I don't think it is
necessary either.

> almost certainly requires different init files, but request for a command line

Again, I am not sure if we think of same things here, but I don't think it is
needed, but anyway: 

> option overriding init.el was refused:

do we need it? Aren't -q and -l option enough to load a different file after
startup? There is also -e and -f option that could be used for the purpose of
more customization. 

> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15539
> setting user-emacs-directory at command line invocation
>> So I think the conclusion to this long thread was that we don't want to
>> add a specific switch for this, and instead people can say
>> "XDG_CONFIG_HOME=/whatever emacs" when they want to change these paths.
>> So I'm closing this bug report.
>
> Unfortunately initialization in Emacs is rather tricky and
>     emacs -q -l init.el
> may behave differently.
>
> On the other hand the latest variant of org-select is quite close to 
> reasonable
> level of support of multiple instances of the same menu.
>
>>>>> Currently several capture menu instances may be requested though
>>>>> org-protocol (or calling org-capture from emacsclient). The behavior is
>>>>> rather confusing. New menu may help to fix the issue, that is why I
>>>>> raised the question about parallel captures.
>>>> I am not sure which behavior you have in mind.
>>>
>>> try the following commands without selecting a template in an Emacs frame in
>>> between
>>>
>>>      emacsclient 'org-protocol:/capture?url=url-A&title=title-A&body=body=A'
>>>      emacsclient 'org-protocol:/capture?url=url-B&title=title-B&body=body=B'
>>>
>>>> What I was thinking as a conservative implementation that would not
>>>> introduce any new features is replacing the old menu with the new one
>>>> every time the same menu is called. So, every time the user calls menu
>>>> (e.g. capture menu), only the last capture environment is preserved. The
>>>> previous, potentially unfinished, capture menus will be destroyed.
>>>
>>> Causing loss of user data. Currently it is hard to start new capture before
>>> selecting a template.
>> Current org-capture is one at a time because of how org-mks works. There
>> is nothing that prevents org-capture to open enumerated buffers,
>> org-caputre<1>, org-capture<2> etc. User has to manually serialize data
>> anyway, via C-c C-c from withing capture buffer? So in principle it is
>> still one capture buffer at a time that manipulates the file on the disk
>> itself?
>
> I would like to avoid confusion here. "*CAPTURE*" buffers are created after
> selection of template. Menu is gone away and content is already added to the
> target document, so it will be saved in response to C-x C-s or autosaved after
> some interval. There is no need of additional persistence at this stage.
>
> And to be clear, example I provided is broken, it creates 2 template selection
> menus existing at the same time, but second request overwrites capture
> data. When one template is selected, menu disappears, but session is still
> blocked by waiting for a key specifying second template. It is really ugly. I
> expect that new menu implementation will allow to improve user experience.
>
> I was writing about interval between invocation of `org-capture' and selection
> of some template. During this period capture data exist only as values of
> runtime variable. Currently it is acceptable because it is almost impossible 
> to
> do anything else in Emacs till capture template is selected.
>
> Non-blocking menu makes the issue more severe for some (likely small) fraction
> of users. Of course, it is responsibility of code calling menu and arranging
> menu item handler, not the code implementing menu.
>
> The priority of this issue is certainly less than choosing proper menu API and
> implementing it. However it should not be forgotten at the moment when new 
> menu
> implementation will be committed to Org.

I'll think more about what you write here and your next mail, so I'll answer at
later time, I am not sure I can give some constructive answer at the moment.

best regards
/a



reply via email to

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