On Fri, May 10, 2013 at 03:49:45AM +0200, Bram Moolenaar wrote:
ZyX wrote:This is a description of proposed new python interfaces.Well, that's a very long list. Do we really need all of this?Let's at least order by usefulness.
I took some time today to look more closely at the RFC and the other resonses in this thread. I also played around a bit with creating a "meta-plugin" that would allow writing python-only plugins, just to get a feel of things. So, with all that in mind here is my priorized wish-list:
0. We all seem to agree that a complementary pure python module is a good idea. Where it make sense to do so parts of the proposed improvements cab be added there, and it will also give us a nice home to add more convenience functions (e.g. for dealing with some ex. commands) later.
1. Add the ability to create a FuncRef for arbitrary python callables:The extra book keeping required to do this now feels unnecessarily complicated and I think performance-wise the indirection (vim_function -> id2callable registry -> python function) will probably be noticeable for many repeated calls (e.g. when used in
a sub-replace-expression in a big file) 2. Ability to create / remove autocommands, maps and user commands:The fully introspectable mappings mappings as proposed by ZyX would be awesome, but at a bare minimum a convenient API for creation and removal should be available
3. vim.functions:Again, the introspection is not strictly necessary, but a convenience wrapper that pulls the FuncRefs will make code look much nicer. In that regard I'd also offer attribute access for builtin/ global functions in addition to the getitem syntax. That way you can do things like:
curbuf = vim.functions.bufnr("%")
4. $thing.valid for buffer, window, etc. objects
Being able to tell whether a reference to one of those is still
usable seems quite useful to me
The above are the most useful I think, 5. vim.signs & related 6. vim.jumps & related 7. vim.hlgroups % related 8. vim.find_buffer This one would make more sense as a method on vim.buffers for me9. anything else ;) it is an extensive RFC after all (Thanks very much for writing it up and for working on improving the Python bindings in general btw.)
Regards, Andy -- Happiness is just an illusion, filled with sadness and confusion.
pgp_ivw9tFLFm.pgp
Description: PGP signature
