The Department of Computer Science & Engineering
cse@buffalo

CSE202: Programming in Lisp

Course
Grades
Email

Welcome

Policies
    Grades
    Inc
    Intgrty

Preface
Part I
  Chap 1
  Chap 2
  Chap 3
  XEmacs
  Chap 4
  Chap 5
  Chap 6
  Chap 7
  Chap 8
  Chap 9
Part II
  Chap 10
  Chap 11
  Chap 12
  Chap 13
  Chap 14
  Chap 15
  Chap 16
  Chap 17
  Chap 18
  Chap 19
  Chap 20
  Chap 21
  Chap 22
  Chap 23
Part III
  Chap 24
  Chap 25
  Chap 26
  Chap 27
  Chap 28
  Chap 29
  Chap 30
  Chap 31
  Chap 32
USING XEMACS
Notes
Now that you've seen that you can run acl from the shell, and now that you've seen a little of how to interact with that version of acl, we will use the XEmacs Lisp development environment for the rest of the course.

XEmacs is a version of the Emacs editor, which you may already have used. I prefer XEmacs to the other versions of Emacs we have available at UB, so I will give you some instructions on how to use it, and then assume that you are using it.

Remember, XEmacs is a general-purpose editor, and has modes for developing programs in a variety of programming languages. Once you start using it, you can use it for all your work.

  1. Run XEmacs by executing the shell command
    xemacs &

  2. Exit XEmacs by typing C-x C-c while your cursor is inside its window.

  3. Run acl within XEmacs by executing the XEmacs command
    M-x run-cl from within XEmacs.
    • M-x is pronounced "Meta-x", and is typed by holding down the meta key while typing the x key. SparcStations have two meta keys on their keyboards. They are the ones next to the space bar with the diamonds on them. If your keyboard doesn't have a meta key, you can type M-x by typing the Escape key followed by the x key.
    • If you pause a second or so after typing M-x, you will see it echoed in the "minibuffer" at the bottom of the XEmacs window.
    • XEmacs has command completion. So once you start typing run-cl you can hit the space bar and see it completed in the minibuffer. When you're happy, be sure to type return (or enter) to execute the command.
    • After executing M-x run-cl, you will be asked to provide some arguments in the minibuffer. Each request will be accompanied by a default suggestion. Accept each default, by simply pressing the return key, except for the one labelled Process directory. For this one, enter ~/CSE202.
    • Finally, you will see the now familiar ACL banner and prompt, and you will see the mode "Inferior Common Lisp" on the mode line.

  4. You can interact with acl in the XEmacs buffer just as you did when running acl from the shell, only there are more keyboard commands to help you, and some of the commands you used before must be preceded by an additional keystroke. Here is a revised version of keystroke commands:
    exit ACL:exit
    interruptC-c C-c
    pop one level in the debuggerC-c C-d
    pop all debugger levels:res
    character eraseas before
    line eraseC-c C-u
    erase to current prompt, even if on subsequent lineC-c C-u

  5. You can see all the keyboard commands available in the Inferior Common Lisp mode by typing C-h m when your cursor is in the *acl* buffer. Try it. Here, however, are two of my favorites:
    close all open parenthesesC-c ]
    copy previous input to current line
    You can keep doing this to get earlier lines.
    C-c C-p

  6. Remember, XEmacs is a general purpose editor. You can have multiple buffers open to multiple files at the same time. If you need a quick set of notes on using XEmacs (and other versions of Emacs), look at the file /projects/shapiro/CS501/emacsnotes.text

  7. Now, go back through the exercises of Chapters 1-3, quickly trying out the XEmacs Lisp listener. When you're comfortable, move on to Chapter 4. Use XEmacs for the rest of this course. I hope you like it enough to use it in all your work.

Next

Copyright © 1999, 2000 by Stuart C. Shapiro. All rights reserved.

Stuart C. Shapiro <shapiro@cse.buffalo.edu>