Lisp HUG Maillist Archive

Questions from LispWorks newcomer

I'm a newcomer to LispWorks, having previously used Macintosh Common LISP
for a number of years. I'm trying to find equivalents for editor commands
I've used in MCL:

1. Is there an editor command to tidy the formatting of a selection in the
editor, like you can do for a single line with Tab? In MCL selecting several
lines, eg a function definition, and pressing Tab tidies the entire
selection.

2. Is there a keystroke to return to level 0 from the restarts after an
error? (In MCL it's Command-period.)

3. Is there a keystroke to display the source for a symbol? (In MCL it's
Alt-period.)

4. Is there a keystroke to join two source lines together? (In MCL it's
Alt-space.)

5. Is there a keystroke to display the documentation for a symbol? (In MCL
it's Ctrl-x Ctrl-d.)

Thanks,
David Johnson-Davies

+------------------------------------------------------------+
David Johnson-Davies, Human-Computer Interface Ltd
17 Signet Court, Swanns Road, Cambridge, CB5 8LA, England.

Tel: +44 1223 314934, Fax: +44 1223 462562
Email: david@interface.co.uk, Web: http://www.interface.co.uk/
+------------------------------------------------------------+



Re: Questions from LispWorks newcomer

David Johnson-Davies wrote:

> 1. Is there an editor command to tidy the formatting of a selection in the
> editor, like you can do for a single line with Tab?

Ctrl-Alt-Q

> 2. Is there a keystroke to return to level 0 from the restarts after an
> error? (In MCL it's Command-period.)

I would do that with

   : c Space 0 Enter

(That's five keystrokes, not one, but hey.)

> 3. Is there a keystroke to display the source for a symbol? (In MCL it's
> Alt-period.)

Ditto.

> 4. Is there a keystroke to join two source lines together? (In MCL it's
> Alt-space.)

Ctrl-K Alt-space

> 5. Is there a keystroke to display the documentation for a symbol? (In MCL
> it's Ctrl-x Ctrl-d.)

Ctrl-D


Have fun with Lispworks!

Arthur


Re: Questions from LispWorks newcomer

On Mon, 10 Mar 2008 11:05:48 +0000, David Johnson-Davies <david@interface.co.uk> wrote:

> I'm a newcomer to LispWorks, having previously used Macintosh Common
> LISP for a number of years. I'm trying to find equivalents for
> editor commands I've used in MCL:

LispWorks comes with extensive documentation.

  http://www.lispworks.com/documentation/

It's also on your hard disk if you've installed it and accessible from
within the IDE.

> 1. Is there an editor command to tidy the formatting of a selection
> in the editor, like you can do for a single line with Tab? In MCL
> selecting several lines, eg a function definition, and pressing Tab
> tidies the entire selection.

"Indent Form" or "Indent Region"

  http://www.lispworks.com/documentation/lw50/EDUG-W/html/eduser-w-101.htm#marker-928958
  http://www.lispworks.com/documentation/lw50/EDUG-W/html/eduser-w-58.htm#marker-972120

> 2. Is there a keystroke to return to level 0 from the restarts after
> an error? (In MCL it's Command-period.)

:top or :a :t

  http://www.lispworks.com/documentation/lw50/LWUG/html/lwuser-25.htm#pgfId-887349

> 3. Is there a keystroke to display the source for a symbol? (In MCL
> it's Alt-period.)

It's the same in LispWorks.

  http://www.lispworks.com/documentation/lw50/EDUG-W/html/eduser-w-96.htm#marker-928560

> 4. Is there a keystroke to join two source lines together? (In MCL
> it's Alt-space.)

In the middle of a line Alt-Space does the same on LispWorks as on
MCL.  To join two lines, go to the end of the first line and type
Ctrl-K Alt-Space.

> 5. Is there a keystroke to display the documentation for a symbol?
> (In MCL it's Ctrl-x Ctrl-d.)

  http://www.lispworks.com/documentation/lw50/EDUG-W/html/eduser-w-109.htm

Edi.


Re: Questions from LispWorks newcomer

And if you have not done so already, have a look at Edi's lw-add-ons,
or his starter-pack which included lw-add-ons:


http://weitz.de/
-- 
  -asbjxrn


Re: Questions from LispWorks newcomer


Am 10.03.2008 um 12:05 schrieb David Johnson-Davies:

>
> I'm a newcomer to LispWorks, having previously used Macintosh Common  
> LISP
> for a number of years. I'm trying to find equivalents for editor  
> commands
> I've used in MCL:
>
> 1. Is there an editor command to tidy the formatting of a selection  
> in the
> editor, like you can do for a single line with Tab? In MCL selecting  
> several
> lines, eg a function definition, and pressing Tab tidies the entire
> selection.

Indent Form
Indent Region

I have added the following command to my own setup:

(editor:defcommand "Indent Defun" (p)
    "Mark current defun and indent it."
    "Mark and indent defun."
    (editor:mark-defun-command p)
    (editor:indent-region-command p))

It allows to reformat the whole top-level-form by hitting just one key.

>
>
> 2. Is there a keystroke to return to level 0 from the restarts after  
> an
> error? (In MCL it's Command-period.)

If you're in the Listener, you can type in :a and hit return - but  
thats not really a keystroke.
In the case you're using Mac OS X and enable to always enter the GUI  
debugger: You can just close the debugger window using Command-W.  
There could certainly be other solutions by digging around in the  
LispWorks apis and the editor source.

>
> 3. Is there a keystroke to display the source for a symbol? (In MCL  
> it's
> Alt-period.)

It should be Meta-period (Meta-.) - which mandates that you actually  
have a meta key. Under Mac OS X the situation is a bit difficult. The  
two possible keys in LispWorks for Mac are the command key and the alt- 
key. If you configure command to be meta you lose all Mac OS  
accelerators; if you choose alt you cannot longer use it to enter some  
special characters like @,{,},~ (at least on a typical german  
keyboard). So you can either try to rebuild the Mac OS X accelerators  
using LispWorks bindings or you write commands for each special char  
you want to insert. I've gone both paths in the past; now I added  
bindings for the commands Extended Command on #\control-\x and Emacs  
Command Escape on #\DLE (which happens to be a key between my right  
alt and control keys).

> 4. Is there a keystroke to join two source lines together? (In MCL  
> it's
> Alt-space.)

On the first of the two lines:
Ctrl-e Ctrl-k

> 5. Is there a keystroke to display the documentation for a symbol?  
> (In MCL
> it's Ctrl-x Ctrl-d.)

For Mac OS X:
http://www.lispworks.com/documentation/lw50/EDUG-M/html/eduser-m-110.htm#66391

--
Jochen Schmidt
Crispy Logics
Julienstr. 1, 90419 Nuremberg

Fon +49 (0)911 517 999 82
Fax +49 (0)911 517 999 83

mailto:info@crispylogics.com
http://www.crispylogics.com


Re: Questions from LispWorks newcomer

On Mon, 10 Mar 2008 17:40:44 +0200, Jānis Džeriņš <jonis@latnet.lv> wrote:

> Does not the Alt-^ (that's Alt-Shift-6) work?  (Can't test myself
> since I'm on Leopard.)

Seems you're right:

  http://www.lispworks.com/documentation/lw50/EDUG-W/html/eduser-w-58.htm#marker-972144

Never used that one, but I just tried it.  FWIW, with my German
keyboard on Windows I can reach this command with Esc ^ Space (pressed
in sequence, not at the same time).  The Space is necessary as ^ is a
"dead" key.


Updated at: 2020-12-10 08:43 UTC