[Geany-Devel] Lua script vs the plugin wishlist

Steven Blatnick steve8track at xxxxx
Wed Jun 5 15:05:35 UTC 2013


Along the same lines, I've developed another way people can quickly 
integrate functionality to geany in minutes rather than days or even 
hours :-)

external-tools 
<https://github.com/sblatnick/geany-plugins/tree/external-tools/external-tools> 
- Add virtually ANY executable script or file to be called from keyboard 
shortcuts or the Tools menu.  The intended use is that you can write 
*bash scripts* or even *perl scripts* that use environment variables to 
get data from geany (via environment variables passed to the scripts) 
and are able to act based on some settings on geany or the code.

One advantage that this plugin offers that the lua plugin could maybe 
consider doing is having a nice UI for adding, removing, and editing 
scripts.

This plugin hasn't been submitted to geany-plugins yet, as I am still 
working on it.  That said, it's already quite functional.  It behaves 
much like gedit's external tools, but with some improvements and planned 
features they missed.  (I use gedit's version of the plugin daily, so 
I'm hoping to add it to geany and improve on it)

Here are the currently set environment variables:

 1. GEANY_LINE_NUMBER - The current line number the cursor is at in the
    editor
 2. GEANY_SELECTION - Any currently selected text
 3. GEANY_SELECTED_LINE - All of the text on the current line the cursor
    is at
 4. GEANY_FILE_PATH - Path to the current file in the editor
 5. GEANY_FILE_MIME_TYPE - Mime type of the current file (example:
    "text/x-csrc")
 6. GEANY_FILE_TYPE_NAME - Mime type by name of the current file
    (example filetype: "C")

Output from the script can be directed into:

 1. New "Tools" tab of the Message Window as either text output or a
    table (I'm still working on the table)
 2. Overwrite currently selected text
 3. Do nothing in the UI (good for opening other tools like meld)
 4. Overwrite the currently selected line
 5. /any other ideas?/

I hope the plugin will be greatly flexible.  I plan on adding that file 
paths in the output on the tools tab of the message window will be 
clickable to browse to files as well as a table output for CSV-like uses.

Anyway, I hope somebody likes this little sneak peak at my plugin :-)

Thanks,

Steven Blatnick


On 06/05/2013 06:06 AM, Thomas Martitz wrote:
> Am 05.06.2013 13:46, schrieb Thrawn:
>> Hi, folks.
>>
>> Lex, thanks for your comments. I have heard before about GeanyLua's 
>> future being uncertain, and I did email the list suggesting that I 
>> would be willing to be an emergency backup maintainer. Ie I don't 
>> generally have the time, but given a choice between fixing a severe 
>> problem and losing the plugin, I'd step up.
>>
>> Just tonight I've uploaded another script to the Geany Wiki, for 
>> surrounding the current selection with brackets, tags, etc. That 
>> fulfils another item from the plugin wishlist. It took about 40 lines 
>> (including comments and debug lines) and 15 minutes.
>>
>> I strongly urge that GeanyLua be retained. I think that it and 
>> GeanyPy are the way of the future for plugin development, and since 
>> GeanyPy isn't available precompiled, GeanyLua is the only 
>> out-of-the-box candidate for developing a useful feature (that would 
>> normally involve a plugin) in an hour or less. The documentation is 
>> clear; the API is simple but effective; there's no boilerplate (no 
>> import statements, no class declarations, no metadata, just code); 
>> deployment is just a matter of copying the script into the geanylua 
>> directory and restarting/rescanning; and it integrates nicely with 
>> the keybinding system.
>>
>> Anyone who wants to develop a plugin, or wishes for a feature that 
>> some other editor has, should consider GeanyLua. It might not do what 
>> they need, but if it does, they'll be able to do it within an 
>> afternoon. I'm already maintaining 6 different Lua-powered features 
>> (some of which involve multiple scripts), with a 7th to be uploaded 
>> soon, and it's easy.
>>
>
>
> I believe GeanyLua is nice, but it still needs a maintainer :) You 
> could be the one!
>
> Best regards
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130605/acd13541/attachment.html>


More information about the Devel mailing list