Re: [code] [textadept] New Theme and Settings Proposal

From: Robert <rob.g.att.web.de>
Date: Sat, 18 May 2013 11:33:33 +0200

Hi Mitchell,

On Fri, May 17, 2013 at 7:30 AM, Mitchell <m.att.foicica.com> wrote:
> I've been working on a new implementation for themes and settings and have
> something workable that I'd like to share as a proposal.

like everyone else I am very happy about the general direction of this.
Some thoughts and ideas below.

> Similarly I could tweak the default font and keep everything else the same:
>
> dofile(_HOME..'/themes/light.lua')
> local style = buffer.property['style.default']
> style = style..',font:DejaVu Sans Mono,size:11'
> buffer.property['style.default'] = style
>
> In either case, I now add the following to my *~/.textadept/init.lua*:
>
> gui.set_theme('light')

Would it somehow be possible to change fonts even more easily? For
example globale variables
_FONT = 'DejaVu Sans Mono'
_FONTSIZE = 12
to be set in *init.lua*?
Another option could be saving them along with the theme name in *theme*:
-- Contents of theme:
black
DejaVu Sans Mono
12

> So what about the old view.lua and buffer.lua? Are they still grouped in
> with themes? No :) Textadept has a new *settings.lua* that contains all
> non-color buffer properties.

How about calling it *properties.lua*? 'Buffer properties' and 'view
properties' are already established terms in the manual and (to me at
least) 'properties' sounds less "general" than 'settings'.
Also, have you considered just using events? Or is this not possible,
does *settings.lua* somehow need to be loaded from the lexer side as
well?
Changeset 1439 [1] introduces using events for setting the language
module specific properties so this would fit in nicely. It could be
bound to a THEME_SET event or something (to avoid the buffer and view
specific distinction).

> Thoughts and suggestions are very welcome.
In general I would prefer a more Lua-ish way of describing the theme
styles as already suggested by Gilles.

Robert

[1] http://foicica.com/hg/textadept/rev/86e2b6431c32

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Sat 18 May 2013 - 05:33:33 EDT

This archive was generated by hypermail 2.2.0 : Sat 18 May 2013 - 06:31:41 EDT