Re: [textadept] Key commands in menu

From: Robert <>
Date: Fri, 29 Jul 2011 18:26:18 +0200


thank you! I'm glad you like it and that there isn't something "wrong"
with doing
buffer.undo = buffer.undo

The issues I mentioned were mostly just "stylistic", no docs and
functions just right next to the key definitions. (And I'm not good at
naming functions or variables.)

On Fri, Jul 29, 2011 at 5:20 PM, mitchell <> wrote:
> Robert,
> Apologies for the spam, but now that I've gotten over how amazing this code
> is and can potentially be, I want to address some of your points below:
> On Thu, 28 Jul 2011, Robert wrote:

>> Probably all the little helper functions in keys.lua should be
>> 9defined in editing.lua or other files.
> Yeah, I'll figure out the best place to put these. Since the string
> representation of functions is just the address in memory, location doesn't
> matter at this point (genius!!!).
>> Another idea I had was to call
>> the "menuitem" function only in "read_menu_table",
>> and have only tables in the menubar table. That way the creation of
>> the shortcut lookup
>> table could be done when calling "read_menu_table", now it needs
>> to be done before the calls to "menuitem".
> I agree. I created menuitem() so I wouldn't have to write { L('gtk-new'),
> new_buffer, K['gtk-new'] } a bajillion times for all menu items. Since your
> code doesn't rely on such things, the old table style can be restored.

This would fix one "issue", the lookup table should only be created when
set_menubar is called. Now there is an extra call at the beginning for
menuitem. Having the menu as a table structure it is possible for the
user to modify the menu table later and recreate it.

>> I had to include additional buffer functions assignments (in gui.lua),
>> similar to what is done with and other Lua functions.
>> Otherwise it was not possible to create identical string
>> representations for these buffer functions. An alternative would be
>> the older string based approach.
> No, I like your idea better.

Great, I wouldn't have liked it, either. The way you introduced after
3.6 is of course much
cleaner. I was just worried there might be issues with this.

>> I also moved "Select command" to
>> gui.lua, this could of course be done in a much cleaner way, but for
>> now it works.
> As mentioned earlier, I'll figure out the best place to put these functions.
> Thanks so much for your contributions!
> mitchell

Thank you, I take this as you implementing/trying this out, in
accordance with your
TA style guidelines ;-)

Received on Fri 29 Jul 2011 - 12:26:18 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:04:18 EST