This is #1531 <https://github.com/leo-editor/leo-editor/issues/1531>, which arises from a less-than-perfect fix for #1286 <https://github.com/leo-editor/leo-editor/issues/1286>.
This post describes the details and choices. But first, a summary of my plans... *Plans* It's too late to complete #1531 <https://github.com/leo-editor/leo-editor/issues/1531> for Leo 6.2 final. It has been rescheduled for Leo 6.3. For 6.2, I *will *add items to @data contextmenu-commands in leoSettings.leo. These items will create cut/copy/paste/select-all *text* items popup menus. These items will be added in the 6.2 branch, and merged into devel. The "popup" branch will contain all code changes for 6.3. This branch is based on devel. The popup branch will *not* be merged into 6.2. *Background* I completed #1286 <https://github.com/leo-editor/leo-editor/issues/1286> without a great deal of thought. My reasoning was that popups containing cut/copy/paste/select-all *text* popups were almost useless. Better to add outline-oriented commands everywhere. Several people have questioned this choice. This is the kind of apparently trivial fit-and-finish issue that newbies often use to evaluate the "worth" of an app. They see something like this and start pontificating :-) Yes, it's ridiculous, but it's a fact of life. So something must be done... *Specifying popup items* 1. Users can specify additional entries for the popup menu using *@data contextmenu-commands*. At present, the default, in leoSettings.leo, is: # Important: the contextmenu.py plugin must be enabled for these settings to take effect. # Add commands to contextmenu # The format is <command> SPACE <description> copy-node Copy Node cut-node Cut Node paste-node Paste Node paste-retaining-clones Paste Node As Clone 2. The contextmenu plugin *itself* adds a set of "standard" items. There is a buglet in this code that I *will* correct for 6.2. The old code added a "Delete" item. It should be labelled "Delete Node". 3. Finally, *other* plugins can add items to the list. At present, the (misnamed) *g.tree_popup_handlers* list contains entries for all entries. I forget when items get added to this list. The load order of plugins is likely significant. *Choices* Vitalije and I have been considering whether there should be *two* popup menus: one for the tree, and one for the body. Imo, this will create needless complexity. With proper labels, it should be clear which popup items apply to the outline and which apply to the body (or other text widgets). Furthermore, I see no reason ever to hide one set of commands. Vitalije suggests putting outline commands first when the outline pane has focus, and putting body commands first otherwise. It's a reasonable suggestion, but it would create lots of behind-the-scenes complexities because now all specifications must include tree/body switch. This is not worth doing, imo. Neither newbies nor anyone else will swoon with delight. Probably, nobody will even notice. It doesn't add to Leo's *perceived* quality :-) *My Goals* 1. At present, the contextmenu plugin specifies default entries for the pop menu. This is silly. Probably *all* standard entries can be specified by adding entries to the @data setting. 2. The @data setting should allow the user to specify separators in the popup menu. 3. (Probably not) The @data setting might allow the user to specify sub-menus in the popup menu. At present, the todo.py plugin adds the Task sub menu. It would take considerable work to allow users to specify sub menus. 4. Show plugins-defined popup items after user-defined items, with a menu separator between them. This will require a new global list, say g.plugins_popup_handlers. *Summary* 6.2 will contain new items in @data contextmenu-commands for common text oriented commands. That should satisfy most users. All code changes will be deferred to Leo 6.3. The "popup" branch will hold the work. Imo, using the same popup for all panes is plenty good enough. This change is not worth extra code complexity. All comments welcome. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/8aa15618-e139-443f-9da8-44f9eceb9a9d%40googlegroups.com.
