Disabling Plugins disables menu actions

Bug #1292207 reported by SegundoBob
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
leo-editor
Fix Released
Undecided
Unassigned

Bug Description

The attached file, nopMenu.leo, demonstrates this problem: When plugins are enabled, the "nopMenu" action "child count" displays in the log pane the number of children of the currently selected node. When plugins are disabled (by starting Leo-Editor with the --no-plugins command-line option) the "nopMenu" action "child count" does nothing and no error is reported.

This bug is probably related to bug https://bugs.launchpad.net/leo-editor/+bug/1286914. But enabling/disabling plugins does NOT change the behavior of the test case for 1286914.

This bug is a moderate impediment to me, because when I disable plugins none of my custom menus work. I need to disable plugins to determine if the Gtk-CRITICAL error messages occur when plugins are disabled--as requested by Edward K. Ream.

Test system:
Xubuntu64 13.10
Leo Log Window
Leo 4.11 final, build 128f96dcd70d (branch: master), 2014-03-02 13:11:09
Python 2.7.5, qt version 4.8.4
linux2

When plugins are enabled, I have these plugins enabled:

plugins_menu.py
chapter_hoist.py
mod_scripting.py
quicksearch.py
contextmenu.py
nav_qt.py
stickynotes.py
viewrendered.py
free_layout.py
valuespace.py

Revision history for this message
SegundoBob (bhossley) wrote :
Revision history for this message
Edward K. Ream (edreamleo) wrote : Re: [Bug 1292207] [NEW] Disabling Plugins disables menu actions

On Thu, Mar 13, 2014 at 3:27 PM, SegundoBob <email address hidden> wrote:
> Public bug reported:

Disabling menus disables the plugins_menu.py plugin.

EKR

Revision history for this message
SegundoBob (bhossley) wrote :

I think you meant "Disabling plugins disables the plugins_menu.py plugin".

I only know a little about Leo-Editor, but I think the menus involved should have nothing to do with plugins. I believe these menus are a "core" facility. The menus involved are specified:

@settings
    @menuat help before
        @menu &nopMenu
            @item bob-childcount

When plugins are disabled, the menu itself is still displayed and its items still drop-down, but the item functions are never called.

Revision history for this message
SegundoBob (bhossley) wrote :

If the only plugin that is enabled is contextmenu.py, then my custom menus work.

If the contextmenu.py is NOT enabled, then my custom menus do NOT work.

Perhaps, some core code is unintentionally depending on contextmenu.py?

Revision history for this message
SegundoBob (bhossley) wrote :

Previously I reported that I had a menu that only worked when plugin contextmenu.py is enabled. Now I've come across another of my menus that only works when plugin mod_scripting.py is enabled. Perhaps this is evidence that the problem dependencies are in my menu code, not the Leo-Editor core.

I was never aware that I was using non-core functions. How does one identify non-core functions? How does one write a menu function that displays an error message when it fails because it tries to use a non-core function that is not present?

I hope someone is still looking at the Launchpad bugs till they have either all been closed or all open bugs have been migrated to GitHub.

Revision history for this message
Edward K. Ream (edreamleo) wrote : Re: [Bug 1292207] Re: Disabling Plugins disables menu actions

On Tue, Mar 18, 2014 at 3:33 PM, SegundoBob <email address hidden> wrote:

> I was never aware that I was using non-core functions. How does one
> identify non-core functions?

What function were you using?

> How does one write a menu function that displays an error message when it fails because it tries to use a non-core function that is not present?

Not sure I understand the question, but g.es should always work, and
g.trace and g.es_trace will always work provided you started Leo from
a console.

> I hope someone is still looking at the Launchpad bugs till they have
> either all been closed or all open bugs have been migrated to GitHub.

Yes, these bugs are still on the table and won't be forgotten.

Having said that, I have made no promises about any particular bug
will be fixed.

I would suggest that if you are having problems with scripting Leo
that you ask for help first rather than filing a bug report out of the
blue. The constant stream of relatively minor scripting-related bug
reports isn't helping either of us, imo.

The ideal would be for you to find and fix the bug yourself, after due
consultation, of course. This would have several advantages for you:
it's quicker and it would bring you more fully on board as a Leo
developer. I'd be happy to assist you in such projects.

Edward

Revision history for this message
Edward K. Ream (edreamleo) wrote :
Changed in leo-editor:
status: New → Fix Released
Revision history for this message
Edward K. Ream (edreamleo) wrote :

This bug is invalid.

Disabling plugins disable the mod_scripting plugin, so the @command nodes given in the example do nothing.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.