Re: [code] [textadept]

From: Jae-woo Kim <zeus87.jwkim.att.gmail.com>
Date: Sun, 25 Oct 2015 11:54:37 +0900

Thank you, Robert, Mitchell. I understanded what you both said, and
successed to follow your instruction.
Yes, now I can see my API document comment after seeing the official API
document when I press Ctrl+H repeatedly. I think the effects of
  _USERHOME..'/modules/ansi_c/api'
  _USERHOME..'/modules/ansi_c/jay_api'
are same.

That's already sufficient to me, but now I'm trying to tweak the way
documents appears.
e.g.)
in official modules/ansi_c/api, there is
  sin sin(double) blahblah

and I made _USERHOME..'/modules/ansi_c/api'
  sin my_private_trivial_shy_comment

finally, I want to see "merged" API document in textadept like this,
  sin(double) blahblah
  my_private_trivial_shy_comment
when I press Ctrl+H "just one time".

But, as far, I've thought it's impossible to achieve this after reading
M.show_documentation() implementation in official
modules/textadept/editing.lua

Anyway, thank you for your help!

Keep going,
Jay

2015-10-24 23:33 GMT+09:00 Mitchell <m.att.foicica.com>:

> Hi,
>
> On Sat, 24 Oct 2015, Robert Gieseke wrote:
>
> Hi Jay,
>>
>> I think you need to add to the editing.api_files table for your language
>> module.
>>
>> http://foicica.com/textadept/api.html#textadept.editing.api_files
>>
>> For example in the built-in "ansi_c" module there is
>>
>> textadept.editing.api_files.ansi_c = {
>> _HOME..'/modules/ansi_c/api', _HOME..'/modules/ansi_c/lua_api',
>> _USERHOME..'/modules/ansi_c/api'
>> }
>>
>> If you wanted to add to this table you would need to do this in a
>> "post_init.lua" file, search for "Language Module Preferences" in the
>> manual.
>>
>> I think (untested), something like
>>
>> events.connect(events.LEXER_LOADED, function(lang)
>> if lang == 'ansi_c' then
>> local api_files = textadept.editing.api_files.ansi_c
>> api_files[#api_files + 1] = _USERHOME..'/modules/ansi_c/jay_api'
>> end
>> end)
>>
>
> There's no need to connect to an event from `post_init.lua`, as that file
> is loaded when the ansi_c module is loaded, and only once (think of it as
> being appended to the end of Textadept's existing ansi_c module). By
> connecting it to the lexer loaded event, you'll be adding that API file
> each and every time you open a C file.
>
> All that is needed is to create ~/.textadept/modules/ansi_c/post_init.lua
> and put in the following lines:
>
> local api_files = textadept.editing.api_files.ansi_c
> api_files[#api_files + 1] = _USERHOME..'/modules/ansi_c/jay_api'
>
> Cheers,
> 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.
>
>

-- 
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 Sat 24 Oct 2015 - 22:54:37 EDT

This archive was generated by hypermail 2.2.0 : Sun 25 Oct 2015 - 06:26:32 EDT