Re: [code] Tabs and Indentation by file type

From: Michael Richter <ttmrichter.att.gmail.com>
Date: Sun, 18 Aug 2013 17:32:06 +0800

I'd tried that already. No dice. Cutting and pasting exactly the code you
typed above still gives me Makefiles with spaces: 2.

On 18 August 2013 17:17, Robert Gieseke <rob.g.att.web.de> wrote:

> Hi Michael,
>
> Am 8/18/13 11:01 AM, schrieb Michael Richter:
>
>> OK, I've tinkered with this for a while and can't figure it out.
>>
>> How do I get Textadept to use tabs/8 for indentation for Makefiles *only*.
>>
>>
>> More generally, how do I set tabs/spaces/indentation amount by file type.
>>
>> I've tried putting it into the lexer. I've tried making a subdirectory
>> under ~/.textadept/modules and putting the stuff in a post_init.lua file
>> and I never see the indentation/tabs settings change in the actual editor.
>>
>>
> try this in your init.lua:
>
> events.connect(events.**LANGUAGE_MODULE_LOADED, function(lang)
> if lang == 'makefile' then
> buffer.use_tabs = true
> buffer.tab_width = 8
> end
> end)
>
> The Python module [1] shows how this could be included in a language
> module file, it should be fine in your init.lua, though. Just in case you
> want more Makefile snippets …
>
> (Thanks for asking this -- it reminded me that I wanted this quite a few
> times but was too lazy to actually put it in my init.lua)
>
> Robert
>
> [1] http://foicica.com/hg/python/**file/ec31ba527326/init.lua<http://foicica.com/hg/python/file/ec31ba527326/init.lua>
>
> --
> 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.
>
>

-- 
"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 Sun 18 Aug 2013 - 05:32:06 EDT

This archive was generated by hypermail 2.2.0 : Sun 18 Aug 2013 - 06:37:32 EDT