Re: [code] [textadept] Proporsal: sam command language plugin

From: Robert <rob.g.att.web.de>
Date: Mon, 15 Jul 2013 13:19:31 +0200

Hi,

Am 7/15/13 12:48 PM, schrieb suharik:
> http://doc.cat-v.org/plan_9/4th_edition/papers/sam/
> http://sam.cat-v.org/cheatsheet/
>
> I want to implement analogue of sam command language for textadept text
> editor.
> Some benefits it could give:
> - Structural regular expressions (for example, `,x/=.*$/s/ +/ /g`
> removes duplicated spaces in every line after '=' symbol)
> - Parallel commands (for example, you can replace every 'vi' by 'emacs'
> and every 'emacs' by 'vi')
> - Working with multiple files, advanced pipeline I/O and a lot or other
> features. This is a very powerful thing.
> - Finally, you can file/replace without annoying find/replace form
>
> But I have some questions about API. How to create a text field for
> commands?
>

have a look at the `command_entry` module[1].
It's used in the `find_incremental` and `filter_through` functionality
for example, you can find more in Textadept's source files editing.lua
and keys.lua [2,3].
Basically, you have a special key mode that is active, when the command
entry is open and a function to be called on enter which implements your
desired Sam functionality.

This looks very interesting, looking forward to it.

Robert

[1] http://foicica.com/textadept/api/gui.command_entry.html
[2]
http://foicica.com/hg/textadept/file/521696b77843/modules/textadept/editing.lua#l519
[3]
http://foicica.com/hg/textadept/file/521696b77843/modules/textadept/keys.lua#l597

-- 
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 Mon 15 Jul 2013 - 07:19:31 EDT

This archive was generated by hypermail 2.2.0 : Tue 16 Jul 2013 - 06:36:18 EDT