This is an Engineering Notebook post. It describes recent thoughts and
test.
Recently I been struggling to understand what, exactly, any new theme code
should do.
*Aha*: I can test themes without altering a line of code! There are two
parts of this strategy...
*Part 1: Use a minimal test file*
The *test_theme.bat* script *simulates* difficult theme-related code by
loading two files, a very small test file, *test_theme.leo*, and an actual
theme file, say EKRLight.leo.
test_theme.leo contains nothing but settings that we *don't *want to put in
theme files:
@bool minibuffer_find_mode = False
@bool show-tips = False
@bool use-gutter = False
So now EKRLight.leo contains only an @theme tree, not the settings above.
Finally, I changed the F5 @command script so that it executes
test_theme.bat.
*Part 2: Disable myLeoSettings.leo*Even though I'm running the F5 script
from one copy of Leo, I can disable myLeoSettings.leo by renaming it.
Doing so revealed several unbound @-constants in leoSettings.leo. They
have all been fixed.
*Summary*
1. Loading EKRLight.leo *last* is an excellent simulation of theming that
required *no* changes to the existing theme-related code. Something like
this:
leo test_theme.leo EKRLight.leo
The test is even better when myLeoSettings.leo has been disabled.
2. leoSettings.leo now apparently contains no unbound @-constants. This
should make testing theme files significantly easier.
3. The script above suggests the way forward. Something like:
leo test_theme.leo --theme=EKRLight.leo
This would load EKRLight.leo last, as required, but would then close
EKRLight.leo.
Following this super simple strategy is important. Messing with settings
will be hard enough. That's next.
Finally, we can replace --theme by a setting in myLeoSettings.leo.
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.