On Fri, Sep 28, 2012 at 8:20 AM, Edward K. Ream <[email protected]> wrote:
> On Thu, Sep 27, 2012 at 12:43 PM, Terry Brown <[email protected]> wrote:
>
>> I think all the commands which write text to the log explicitly set the
>> color as the do so, which is why you can't override it.
>
> Correct.
>
> Leo should use the following setting more often:
>
>     @color log_error_color = red.
>
> Also, there is a disabled setting:
>
>     @@color log_text_foreground_color = None
>
> I look into this today as I complete the border-color work.

Rev 5461 is a mass update to most of Leo's files, including all
plugins in leoPlugins.leo,  that begins this process.  Here is the
checkin log:

"A mass update, replacing g.es/_print(color='red') with g.error or
g.red and replacing g.es/_print(color='blue') with g.warning or
g.blue. All unit tests pass and pylint is happy."

A few notes:

-  These changes were long overdue anyway.  It's bad style to put hard
constants in code, and "red" and "blue" are the worst kinds of hard
constants: they make it difficult or impossible to adapt to different
color schemes, and are not friendly to assistive technologies.

- g.red is a synonym for g.error; and g.blue is a synonym for
g.warning.  For instance, you would say g.blue('done') rather than
g.warning('done').

- At present, g.red and g.error always print in red, and g.blue and
g.warning always print in blue, but the point of the mass update is
that these methods can now honor the following settings::

    @color log_error_color = red
    @color log_warning_color = blue

These is a small problem that must be worked around:  these functions
in leoGlobals do not take a 'c' argument, so have no direct way of
doing, say,

    color = c.config.getColor('log_error_color') or 'red'

So a kludge will be needed.  When the log changes, Leo will set some
global, say g.app.log_c.  This is also something that should have been
done a long time ago.  I'll be working on this asap.

To summarize, when the work is complete users will be able to set
colors for the log_error_color and log_warning_color settings that
will be compatible with the color scheme used in the log pane.  Calls
to g.error and g.red will use the former setting; calls to g.warning
and g.blue will use the latter.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to