Caution: major configuration bug fixed. Also @buttons & @commands changed

2 views
Skip to first unread message

Edward K. Ream

unread,
Nov 24, 2011, 11:04:49 AM11/24/11
to leo-editor
Rev 4844 fixes a bad bug in the logic that handles settings.

Previously, settings nodes that followed @commands nodes might be
ignored. The trunk now contains two kinds of fixes: an essential
piece of defensive code in the generic tree-traversal code, and fixes
to specific code that handles @commands and @buttons trees.

unitTest.leo now contains a proper unit test of @buttons and @commands
handling, but these changes could have far-reaching consequences.
Settings that may have been improperly ignored may suddenly spring to
life. There is no way to test these effects: this warning is the only
option.

In addition, @buttons and @commands nodes now *add* @button/@command
nodes to the global lists, rather than *replacing* the lists. I can
undo this change if people complain, but I think it makes sense.
After all, these commands are advertized as creating *global*
buttons. leoSettings.leo will never contain *active* global buttons,
so it will never create unwanted buttons or commands.

Edward

P.S. Here is the checkin log:

Fixed a major bug in the config parser logic that caused problems with
nearby @buttons & @commands nodes. Also, such nodes now extend rather
replace previous nodes.

1. Fixed major bug in settingsTreeParser.visitNode.
It now does p.copy() to protect the callers traverals.
This could have significant impacts on people's settings.

2. Added g.app.config.unitTestDict for unit testing.

3. Leo now extends the list of @buttons and @commands, rather than
replacing them.
This is reasonable only because leoSettings.leo should never define
*active*
buttons or commands.

EKR

Reply all
Reply to author
Forward
0 new messages