Rainer Joswig
Hamburg, Germany
Email: joswig@lisp.de
| On Mouse Copy |
| Those who edit Lisp code might be interested in 'Mouse Copy'. I have used this functionality
the first time in Zmacs on the Symbolics Lisp Machine. Macintosh Common Lisp has a nice version
in its example directory (ccl:examples;mouse-copy.lisp). LispWorks has also a Mouse Copy facility - improved in LispWorks 5.
Recently I thought about adding it to Clozure CL and wrote down what it should do.
Then I had a conversation with Michael Weber (the author of the Redshank extension to GNU Emacs),
who saw my post about adding Mouse Copy to Clozure CL. This brought some more thinking about
the 'Mouse Copy' functionality. Here are some thoughts:
So, what is 'Mouse Copy'? 'Mouse Copy' allows you to click on Lisp expressions in the editor and have it inserted at the current 'point'. If there is a current selection, this selection will be replaced with the s-expression you have clicked on. If the s-expression is in another buffer, window or a dialog-item, then it will be copied from there without activating the buffer, window or dialog-item. The focus stays where you want to have the S-Expression entered. If you click on several symbols, these symbols will be added at the point and a space between them will be inserted. It also tries to be clever when to add an additional space and when not. Mouse Copy allows you to reuse parts of your code and write code by clicking on existing code snippets. There is an assumption that, while writing a program, there is a high possibility that there are symbols, lists, numbers, strings, comments already on the screen that you want to reuse.
An example would be a class definitions: So, what should Mouse Copy do?
Possible advanced functionality:
Implementation:
|
Links:
| Redshank, GNU Emacs extension for editing Lisp code |
Keywords:
| EMACS ZMACS |