[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] The best way to choose an "action" at point: context-menu-mode
From: |
Juri Linkov |
Subject: |
Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? |
Date: |
Mon, 16 Dec 2024 09:46:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) |
>>> 1. List of possible actions: ((name1 . action1 props) (name2 . action2 ...)
>>> ...)
>>> PROPS is a plist defining extra properties like key-binding, display
>>> string, maybe something else to be used in the future.
>>> 2. Menu interface to use (transient, context-menu, embark, which-key)
>>
>> This looks like the best design. Any part of the org buffer could have
>> text properties with a list of its available actions. Such a property
>> could be similar to 'context-menu-functions' handled by 'context-menu-map'.
>> But since it will be a plain generic list, it could be transformed to any
>> menu interface such as transient, context-menu, etc.
>
> I am a bit lost.
> Maybe I did not describe the use cases I had in mind well.
>
> What I have in mind is a menu UI for various commands:
> 1. org-open-at-point (one set of actions)
> 2. org-ctrl-c-ctrl-c (another set of action)
> 3. some other command
> 4. ...
>
> Then, "actions" will be various options a given command can do.
>
> In such scenario, the usefulness of text properties is elusive to me.
> I'd rather link the menu items to a command, not to place in buffer.
Indeed, in this case text properties are not needed.
Then you can use something like the buffer-local variable with the
same name 'context-menu-functions' (handled in 'context-menu-map').
The main point is that these functions return a menu.
But instead of a menu, an org function could return
a more high-level data structure like
((name1 . action1 props) (name2 . action2 ...) ...)
IOW, this means adding an abstraction layer on top of the existing
user interfaces such as transient and context-menu.
>> To transform it to context-menu, org-mode should provide a function
>> like 'context-menu-minor' that will create a corresponding menu
>> that will be added as a submenu of the default context menu.
>>
>> Such integration with existing menus would be better than the current
>> implementation of context menus in org-mouse-context-menu that completely
>> replaces the context menu with its own.
>
> What do you mean by "default context menu"?
The default context menu is the menu constructed from many different
context-menu functions. Some of them add Undo/Redo entries,
some add Select/Copy/Paste, some add Global submenus, etc.
I meant to keep all these existing menu items, and also append
the submenu items returned by Org-mode.
- Re: Alternative defaults for visually impaired users? (was: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? (was: Fwd: Org-cite: Replace basic follow-processor with transient menu?)), (continued)
- Re: Alternative defaults for visually impaired users? (was: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? (was: Fwd: Org-cite: Replace basic follow-processor with transient menu?)), Eli Zaretskii, 2024/12/22
- Message not available
- Re: Alternative defaults for visually impaired users? (was: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? (was: Fwd: Org-cite: Replace basic follow-processor with transient menu?)), Eli Zaretskii, 2024/12/23
- Re: Alternative defaults for visually impaired users? (was: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? (was: Fwd: Org-cite: Replace basic follow-processor with transient menu?)), Ihor Radchenko, 2024/12/23
- Message not available
- Re: Alternative defaults for visually impaired users? (was: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? (was: Fwd: Org-cite: Replace basic follow-processor with transient menu?)), Ihor Radchenko, 2024/12/24
Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Suhail Singh, 2024/12/14
Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, indieterminacy, 2024/12/14
Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Juri Linkov, 2024/12/14
- Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Ihor Radchenko, 2024/12/15
- Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?,
Juri Linkov <=
- Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Ihor Radchenko, 2024/12/16
- Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Tor-björn Claesson, 2024/12/22
- Message not available
- Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Juri Linkov, 2024/12/24
- Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Tor-björn Claesson, 2024/12/24
Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark?, Kierin Bell, 2024/12/15
Re: [RFC] The best way to choose an "action" at point: context-menu-mode, transient, which-key or embark? (was: Fwd: Org-cite: Replace basic follow-processor with transient menu?), Psionic K, 2024/12/13