[Openmcl-devel] Contrib: context-menu

Glen Foy lisp at clairvaux.org
Sun Aug 30 07:35:55 PDT 2009


On Aug 17, 2009, at 3:58 PM, Rainer Joswig wrote:
> * It occupies the right click menu, also with a lot of modifiers.
> Every other tool out there would like to get the right click menu,
> soon. On the Lisp Machine for example, right click in the editor
> brings up a small menu, where one of the menu items is 'List
> Definitions' and on invoking it, it displays a typeout window with
> mouse sensitive definitions names and their type (class, function,
> variable, ...). LispWorks has a right click menu that repeats some of
> the menus from the menubar (which I think is a bit of overkill for a
> Mac UI).

This is a first cut at dealing with some of the issues Rainer  
mentions.  It is just a prototype; feel free to add your suggestions.

The idea is that Hemlock's contextual popup menu is an important and  
limited resource.  No one tool should have exclusive ownership.  The  
UI, therefore, needs a mechanism for conveniently switching between  
tools.

One approach is to have a "default" tool.  Right-Click produces the  
default tool's menu.  That menu has tool specific entries, but it also  
has a "tools" submenu.  The submenu lists all the other available  
tools and selecting one changes the current default.  This is a simple  
approach and may be sufficient.  It's the approach implemented by this  
prototype.

Another approach would be to make Liist-Definitions the permanent  
"default".  It's menu would always be displayed when you Right-Click.   
It would have a "tools" submenu and you could access other tools by  
navigating through a hierarchy of submenus.  This approach is less  
democratic and navigating through a hierarchy of submenus is tedious.  
There are probably other paradigms that we could consider as well.

In any case, there are four new tools:  Context-Menu-CM, Hemlock- 
Commands-CM, CL-Documentation-CM and List-Definitions-CM.  The Hemlock- 
Commands-CM tool includes first-cut implementations of "Inspect Symbol  
at Point" (control-x control-i) and "Symbol Documentation" (control-x  
control-d).  "Symbol Documentation" pops a dialog and displays CCL's  
documentation when it exists.  If not, it displays MCL's  
documentation. The dialog also has a "HyperSpec" button, for when you  
need a more elaborate explanation.  The HyperSpec is required, so you  
either have to be connect to the internet or you need a local copy.  
See the Context-Menu/ReadMe.


If you would like to give it a try, do this:

cd  ccl/contrib/
svn update

That will pull in new versions of all new contribs, including Context- 
Menu-CM, Hemlock-Commands-CM, CL-Documentation-CM and List-Definitions- 
CM.

In the Listener or in ~/ccl-init.lisp execute these forms:

;;; your own path here, if you are using a local copy of the HyperSpec:
(setq gui::*hyperspec-root-url* (gui::pathname-to-url "/Lisp/ 
hyperspec-7-0/"))

(require :context-menu-cm)
(require :cl-documentation-cm)
(require :list-definitions-cm)
(require :hemlock-commands-cm)
(cmenu:set-default-tool "List-Definitions-CM")


Note: Context-Menu provides a simple API for writing new tools.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20090830/e43a6445/attachment.htm>


More information about the Openmcl-devel mailing list