Re: [code] [textadept] Language specific settings

From: Rob Kendrick <rjek+foicica.com.att.rjek.com>
Date: Wed, 29 Jan 2014 09:28:26 +0000

On Tue, Jan 28, 2014 at 02:05:44PM -0500, Mitchell wrote:
> >This strikes me as a common enough desire that there should probably be
> >some built-in infrastructure for doing it that allows more succinct
> >configuration.
>
> Do you have an idea? I cannot think of one that has as much
> flexibility as doing something language-specific in a LEXER_LOADED
> event. For example, using tables for indentation settings feels too
> constraining:
>
> textadept.file_types.indentation.javascript = {
> use_tabs = true,
> tab_width = 4
> }

Nobody said you had to remove the hook on the LEXER_LOADED event too :)
>
> >In such a thing, I believe it might be desirable to allow the
> >configuration of indentation rules not just based on lexer in use, but
> >path, as not all projects follow the same.
>
> I cannot imagine what a framework for this would look like... ideas?

Probably a list of regexps/patterns to look through on file load, which
can then either be functions as before to manipulate the state, or a
data structure as above. This is essentially how Emacs and Vim do it.

B.

-- 
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 Wed 29 Jan 2014 - 04:28:26 EST

This archive was generated by hypermail 2.2.0 : Wed 29 Jan 2014 - 06:40:13 EST