What extman are people using?

31 views
Skip to first unread message

Chris Clark

unread,
Mar 14, 2023, 12:53:13 PM3/14/23
to scite-interest
And is the one you are using under source code control?

https://groups.google.com/g/scite-interest/c/8FiC37qqj0A/m/goEUfuAHBwAJ mentions the project page has disappeared. And I can't locate anything that looks definitive, I do see a lot of repos where people have some form of extman mingled with their own scripts.

I'm keen to upgrade my Scite version (4.1.5) to something newer (I'm really looking forward to having access to the Windows create.hidden.console=1 feature).

I see a few different extman plugins on my machine and I'm sure they are out of date. But at least one of them works with the small scripts I've created ;-)

If there isn't a report I may put some time into putting a quick repo together with what I have (but again, it is super old). I'm hoping to end up with an extman with the following minimum features:

* works with current 5.x scite ;-)
* scite_Command()
* scite_On...(), e.g. scite_OnBeforeSave()
* some form of loader; potentially; mgr:load_files() and/or scite_Files()

I'm checking here before I embark on writing code.

Thanks!

Chris

andrew strain

unread,
Mar 14, 2023, 7:25:15 PM3/14/23
to scite-interest
I use a mangled old version of extman which I really must clean up sometime, so I will be interested in your version.

As the initial script which scite runs, its prime responsibility seems to be to declare the variables and tables which the lua user does not want to be refreshed on buffer switches. For all of the scripts which extman calls with scite_dofile or plain dofile, any global variables and tables they declare will have their values reset on buffer switches but the ones declared in the initial script are persistent. This script refreshing has been good for my scites stability as I have about 10kloc of anarchic lua scripts attached to keypresses, with a sort of do-on-keypress system.

Instead of declaring multiple persistent globals in the initial script, a lua user might prefer to nest their own persistent things inside a global table called something like 'maintain'. It could be good to set a standard or idiom for this in extman.

The secondary role of extman seems to be to provide the functions which the historical extman provided for general compatibility and are still good to use. I do use in my codebase the scite_OnEvent managers as it did seem a bit neater to write:
  scite_OnKey(my_function_that_reacts_to_keys)
instead of:
  function OnKey(key,shift,ctrl,alt)
    return my_function_that_reacts_to_keys(key,shift,ctrl,alt)
  end


- and it could be handy to use the options  scite_OnKey(somefun,'remove')  or  scite_OnKey(somefun,'once')

I have a ton of utility files and functions, but none of them seem to need to be in the initial script, just the occasional extra persistent global wants registered there. I even think extmans scite_OnEvent registers don't need to be in the initial script, but might be wrong. I'm wondering about an absolute minimal extman including comment notes about the system, which can scite_dofile a secondary extman which contains the legacy extman utility functions, and then a selection of others that help the varied needs of scite lua users, enticing others to add their own. Just wondering though : )
Reply all
Reply to author
Forward
0 new messages