[code] How would this work?

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Thu, 21 Feb 2013 15:58:09 +0800

I'd like to support vim modelines (or something similar) in textadept. A
modeline, for those not in the know, looks something like this, stuck in a
comment somewhere:

vim: ft=prolog sw=3 ts=6

This modeline, for example, tells vim that the file has a file type of
"prolog", a shift width of 3 and a tab stop of 6.

If I wanted to make a commensurate feature for textadept, how would I go
about doing this? Let's say I wanted to look for and parse something like
this:

textadept: set_lexer=prolog tab_width=4 indent=4 use_tabs=false

It could be anywhere in the file (I'd rather not force it to be the first
line because then shebang settings could interfere) so ... where would I
hook things for this kind of functionality? (I can write the actual code
that parses and sets the exposed values easily.)

-- 
"Perhaps people don't believe this, but throughout all of the discussions
of entering China our focus has really been what's best for the Chinese
people. It's not been about our revenue or profit or whatnot."
--Sergey Brin, demonstrating the emptiness of the "don't be evil" mantra.
-- 
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 Thu 21 Feb 2013 - 02:58:09 EST

This archive was generated by hypermail 2.2.0 : Thu 21 Feb 2013 - 06:33:50 EST