Re: [code] [textadept]An easy way to define new editing modes that are derived from pre-existing ones

From: Mitchell <>
Date: Wed, 17 Feb 2016 09:34:18 -0500 (EST)

Hi Pedro,

On Wed, 17 Feb 2016, Pedro Andres Aranda Gutierrez wrote:

> Hi,
> I have been trying to find out a mode to extend the Python mode to use it
> for providing unit test files for the scapy project. Currently, I can make
> textdept switch on the Python mode when writing these .uts files and avoid
> all the Python checks when saving them.
> However, they have some special characters to define test batch names, test
> names, activate keywords, etc, etc. Taking those into account was a couple
> of lines in Emacs and I thought it might be cool if there was an easy way
> (i.e. not replicating the Python LPeg and working on that) since that might
> be a feature that may not be interesting for other people and that I would
> rather place in my .textadept somewhere and not in the distro

Take a look at the sass, cuda, less, glsl, and rails lexers. Each extends
a similar language with extra rules for keywords, types, variables, etc.
That should give you an idea of how to create your own lexer that extends
Python. You can place it in `~/.textadept/lexers/` when you're finished.


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Wed 17 Feb 2016 - 09:34:18 EST

This archive was generated by hypermail 2.2.0 : Thu 18 Feb 2016 - 06:52:27 EST