Re: [code] [textadept] Removing language-specific context menus

From: Ryan Pusztai <rpusztai.att.gmail.com>
Date: Thu, 22 Jan 2015 16:35:55 -0500

Hi Mitchell,

On Thu, Jan 22, 2015 at 4:23 PM, Mitchell <m.att.foicica.com> wrote:

> Hi,
>
> Background: Textadept allows language-specific modules to define a
> language-specific context menu:
>
> _M[lang] = {
> ... menu ...
> }
>
> Whenever that language is loaded, that right-click context menu is used
> instead of Textadept's default one. This was put in place long ago because
> there was no easy way to edit a menu without completely redefining it. For
> a while now Textadept has allowed users to edit
> `textadept.menu.context_menu`, etc. directly as Lua tables. In my opinion,
> this effectively eliminates the need for the above feature. (If a
> language-module wants to add language-specific features to the context
> menu, it can do so without destroying any edits another language-specific
> module has made.)
>
> Unless anyone has any particularly strong objections, this change will be
> committed soon.

I am currently a user of this and I edit 2 or more languages during a
session with TA.
Are you proposing to just add things to the menu for each language and grow
the menu for each file with a different language?

Here is an example of a Lua, Python, C++, Perl file all loaded at the same
time:

Undo
Redo
-----------
cut
copy
paste
-----------
Select All
-----------
<lua custom item1>
<lua custom item2>
-----------
<c custom item1>
<c custom item2>
-----------
<python custom item1>
<python custom item2>
-----------
<perl custom item1>
<perl custom item2>

Would it be like this?

I am not familiar with the `textadept.menu.context_menu` property, does it
know TA default menu? This way when switching buffers you can get rid of
the other languages items and only add the language specific items.

I hope this makes sense. (I was having problems describing my questions)

--
Regards,
Ryan
-- 
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 Thu 22 Jan 2015 - 16:35:55 EST

This archive was generated by hypermail 2.2.0 : Fri 23 Jan 2015 - 06:31:47 EST