Re: Fwd: [code] [textadept] Theme selection

From: Robert <rob.g.att.web.de>
Date: Fri, 8 Mar 2013 10:48:35 +0100

Hi Mitchell.

On Fri, Mar 8, 2013 at 3:41 AM, Mitchell <m.att.foicica.com> wrote:
> On Wed, 6 Mar 2013, Robert wrote:
>> I've tried to find a way to show only actual themes from my user
>> themes directory in the theme selection dialog. I came up with the
>> attached patch to check for the existence of a view.lua file in the
>> assumed 'theme'. This filters out '..' as before, but also '.hg' and
>> the readme I have in my theme collection.
>>
>> Is there another way to achieve this?
>
>
> I was thinking of committing something like this:
>
> ...
> local theme_dir = _USERHOME..'/themes/'
> for theme in lfs.dir(theme_dir) do
> if not theme:find('^%.') and
> lfs.attributes(theme_dir..theme, 'mode') == 'directory' then
> themes_found[theme] = true
> end
> end
> ...
>
> Is this okay for you?

Thank you for looking into this - your solution is much more elegant
than my little hack and covers my use case perfectly.
I didn't think of this pattern to cover both '.hg' and '..'.

Thanks again,
Robert

>
> Mitchell

-- 
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 Fri 08 Mar 2013 - 04:48:35 EST

This archive was generated by hypermail 2.2.0 : Fri 08 Mar 2013 - 06:45:05 EST