[email protected] writes:

>> 1. Custom menu systems that can be specified per-command, so that
>>    org-attach and others can still support existing menu UI
>> 2. org-attach and other commands using their own menu system by default,
>>    even when org-menu-system is something else. Changing the menu system
>>    in other commands would require forcing it upon a given command.
>> 
>> Does the above make sense?
>> 
> I think of two ways to do this:
>
> 1. For each replaced command, we keep the old implementation and use this as 
> an override.
> 2. For each replaced command, we write a new custom menu system that emulates 
> the original behaviour and use this menu system as the override.
>
> The difference is that the override alist stores commands in 1. and 
> menu-systems in 2. 
>
> I have attached an implementation of 1. Do you think this is the way to go?

I am leaning towards (2). We may want an override to be specific menu
system rather than custom function. Imagine some menu that can only work
in full using transient, but not alternative menus. We then want to have
a way to use transient even if global menu system is something else.

As for writing a custom menu system, I think it should be easy to do, if
we change `org-menu-define' to pass ARGLIST to the menu system, in
addition to (org-menu--bind-specification bound-arguments ,menu-actions)
Then, the custom menu system will simply look like
(defun custom-menu-system (_ _ &rest args)
  (apply #'old-command args))

> About (interactive) as default body, you are correct - that was not the 
> problem, only forcing org-element-context. Now we have another problem: I 
> think we are required to provide an uneven number of &key and &rest 
> arguments, so the body can not be empty :-( Can we get around this in some 
> way or do we have to specify (interactive) as the body?

I do not fully understand the problem.
Could you show a simplified macro definition and a macro call that
causes issues you described?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to