Version 7 of e_menu, pluginable menu for editors

Updated 2019-08-04 16:36:20 by aplsimple

This software written in Tcl/Tk and pompously named e_menu provides a menu system bound to an edit session. A text editor with plugin or context facilities allows to use e_menu as "a plugin of plugins" that raises a whole environment of commands & menus around the editor.

Also, e_menu provides a context help on Tcl/Tk commands / keywords while editing a Tcl script. It means that you can set the caret on desirable Tcl/Tk command / keyword and press F1 key (if you map F1 to call e_menu) and then get a help page for the selected Tcl/Tk command / keyword.

By now e_menu is implemented for Geany and TKE editors, both very good for Tcl coding. Though the usage of e_menu is mostly independent on an editor, a few demonstrative details for Geany and TKE are described.

By now e_menu is implemented for:

Also, there are at least three file managers that allow to run e_menu and apply its commands to files and directories.

A sort of quick start demo is available: e_menu.mp4 (~11 Mb).

e_menu has the following features:

  • calling a context help for Tcl/Tk while editing a Tcl script (nay, any text containing Tcl)
  • for faster response Tcl/Tk help pages can be made and called offline
  • opening any number of menus containing any commands (programs) to run
  • passing a selected text as %s wildcard to the menu commands to process
  • using a lot of other wildcards in the menu commands, including %f (edited file name), %x (its extention), %d (its directory), %PD (its project's directory derived from %d)
  • commands can be run by itself and by shell in console box
  • commands can be run with or without waiting their completion
  • internal command %E means “edit a file”
  • internal command %B means “browse an internet link”
  • internal command %M means “do a message”
  • internal command %Q means “do a query“
  • internal command %I means “enter a data that can be required by next commands“
  • internal command %C means “execute a Tcl code“
  • internal command %S means “execute OS command“
  • internal command %IF means “conditional execution“
    • all internal commands can include a selected text
  • a batch of multiple commands can be united under a single menu item which in turn can be multi-lined
  • a menu item can include the whole shell script (even in two ways), so no need of disk files to perform it
  • any command can be confirmed, with message box of title and text including the selection
  • input dialogs (with entries, checkboxes, radiobuttons etc.) may provide data for commands
    • the data may be saved/restored between sessions
  • a hierarchy of menus is provided
  • a child menu can be called with or without waiting it, with or without closing its parent menu
  • a child menu can be called with closing its parent and calling back the parent after closing the child
  • menus can be called (or made afterwards) as 'stayed on the top of screen'
  • menus can be called to stay at any desirable position with reasonable width
  • inactive menus are lowlighted as opposed to highlighted active ones
  • menu items can be bound to hotkeys F1-F12 (by default they are bound to 1-9a-zA-Z which makes maximum 61+3=64 items)
  • menu items and their underlying commands can include counters of their calls (up to 10 counters per a menu)
  • menu items and their underlying commands can be supplied with current date/time
  • e_menu menus are independent applications and as such can be run independently on the editor
  • any menu item can be assigned to 'autorun' at start of e_menu (submenus including)
  • commands that are invisible in menu may be assigned to 'autorun' (submenus including)
  • Tcl command(s) can be assigned to 'autorun' at start of e_menu
  • menus can be edited 'on fly' and then re-read
  • when calling non-existent menu you are prompted to create it from a template; so you can create all menu system 'on fly'
  • 'autorun' items and commands are also re-run when the menu is re-read
  • menu items can be run repeatedly at intervals set in seconds
  • e_menu can be started with a pause to delay its initialization
  • e_menu neighboring applications can be killed with two keystrokes (sort of clearance)
  • there are a lot of 'look and feel' options
  • the options may be set at calling of e_menu and/or in OPTIONS section of a menu
  • parent menu options are inherited by child menu and can be overridden by its OPTIONS
  • as an easy exercise, Mercurial or Fossil SCM support can be provided with e_menu
  • encoding of menus is utf-8

You can include in your menus any commands that would process the selected text, as well as other relevant attributes: a current file's name, a file's directory, time/date, environment variables, a project's directory etc.

For example, having this menu:

https://aplsimple.bitbucket.io/en/tcl/e_menu/files/menu.png

and "class" selected in the edited text, we can perform the following:

  • HELP "class" - get a help on "class" (i.e. oo::class of Tcl)
  • EXEC "class" - execute the selection as a command with arguments
  • SHELL "class" - execute the selection in the console box
  • Run me (with class) - execute a current edited file with the selection as an argument(s)
  • Run Tcl {class} ... - run the selection as Tcl code in console box
  • Edit/create file "class" - edit (or create if absent) a file named after the selection
  • Open directory "src" - open the current file's directory by file manager
  • Open terminal in "src" - open a console box for the current file's directory
  • Open in Firefox "class" site - go to an Internet site named after the selection (in Firefox)
  • Search in Firefox "class" - run Firefox's search machine for the selection
  • Open Wikipedia for "class" - go to Wikipedia for the selection
  • Open GoldenDict for "class" - go to GoldenDict for the selection
  • Search All class in src - open a submenu to run grep (with a lot of options) to find the selection in the current file's directory
  • Backup of paveme.tcl - create a backup of the current file (similar to Vim's backup)
  • Commit "class_on_'date'_'time'" - make a SCM commit with the selection+date+time as the commit message
  • Differences of pafeme.tcl - show changes made to the current file since some prior commit (being chosen)
  • Edit all *.tcl of 'current dir' - open all .tcl files of the current file's directory
  • Fossil, Git, Hg - open a submenu with corresponding SCM commands
  • Utils - open a submenu with miscellaneous commands and submenus

Further details:

https://aplsimple.bitbucket.io/en/tcl/e_menu

Download links:

https://aplsimple.bitbucket.io/bin/e_menu.rar

https://aplsimple.bitbucket.io/files/e_menu.mp4