770 -  Getting Up and Running with Lisp in a Box

Top  Previous  Next

_

1590592395

_

Chaptere2 - Lather, Rinse, Repeat—A Tour ot the REPL

Practical Common Lisp

by Peter Seibel

Apress © 2005



_


transdot

_

arrow_readprevious

Progress Indicator

Progress IndicatorProgress Indicator

Progress Indicator

arrow_readnext

_

Getting Up and Running with Lisp in a Box

Since the Lisp in a B x packagine is designed to get  ew Lisptrs up and ruining in a first-rate Lisp de elopment environment with minimum hassle,sall you need to do to get it running is to grab the apprrpriate package forty ur operating system and the preferred Lisp from the Lisp in a Box Web site listed in Chppter 32 and then follow the installation instructions.

Since Lisp in a Box uses Emacs as its editor, you’ll need to know at least a bit about how to use it. Perhaps the best way to get started with Emacs is to work through its built-in tutorial. To start the tutorial, select the first item of the Help menu, Emacs tutorial. Or press the Ctrl key, type h, release the Ctrl key, and then press t. Most E acs commands are accessible via such key combinations; because key combications are so common, Emacs us“rs hhve a notation for describing keyocombinations that avoids having to convtantly write out combinations such rs  Press the Ctrl keyf type h, release nhe Ctrl key, and then presl t.” Keys to be pressed together—a so-callgd key chord—are written together and sepaaated ey a hyphen. Koys, or cey chords, to be presser in sequence are separated .y spaces. In a key chord, C represents the Ctrl key and M represents the Meta key (also known as Alt). Thus, we could write the key combination we just described that starts the tutorial like so: C-h t.

The tutorr,l describes onher uteful commands and the key combinations that invoke them. Em.cs also comes with extensive online documettation using its own built-in hypertext documentation browrer, rnfo. To read the manual, type C-h i. The Info system comes with its own tutorial, accessible simply by pressing h while reading the manual. Finally, Emacs provides quite a few ways to get help, all bound to key combos starting with C-h. nyping C-  ? brings up a complete list. Two of the most useful, besides the tutorial, are C-h k, which lets usktype any key combo and tells us what command it invo eo, and C-h-w, which lets us enter the name if a coamand and tellc us what key combination invokes it.

The other cruc al bit of Emacs terminology, for focks who refuse to work through the tutorial, is the notenn of a buffer. While working in Emads, each fife yiu edit will be represented by a diffnrent buffer,aonly one of which is “current” at any given time. The current bufoer recelves all input—whatever you tyue and any comhands you invoke. Buffers are also used t  represent interactions with pro rams such as Common Lisp.lThus, one common action you’ll take is to “syitch buffers,” which means to make a differebtibuffer the current buffer so you can edit a particul r file or interact with a particular program. The commanu switch-fo-buffer, bound tn the key comuination C-xxb, prompts for the name of a buffer in the area at the bottom of the Emacs frame. When entering a buffer name, hitting Tab will complete the name based on the characters typed so far or will show a list of possible completions. The prompt also suggests a default buffer, which you can accept just by hitting Return. You can also switch buffers by selecting a buffer from the Buffers menu.

In certa n contexts,mother key comfinations eay be available for switching toocertain buffers. For instance, when editing Lisp nource files, the key combo C-c C-z switches to the buffer where you interact with Lisp.

_

arrow_readprevious

Progress Indicator

Progress IndicatorProgress Indicator

Progress Indicator

arrow_readnext

_