Running Nyquist in an Emacs buffer(see GNU Emacs user manual: compiling and testing programs - sub-chapter: running an external lisp) Type the following lines by replacing "e:/programme/nyquist/ny.exe" with the path to your nyquist executable:
Emacs opens a new buffer named "inferior-lisp" with the Nyquist interpreter running inside. You can either type your commands directly into the interpreter or you can do the following: Go to the Emacs scratch buffer. I the status line you can read [(Lisp Interaction)] what means the buffer is in Lisp interaction mode. Then you type:
In the status line appears (Lisp), the buffer is in Lisp mode now. Then, in the buffer, type some Nyquist code:
Place the cursor after the last paren and type:
C-x C-e is the Emacs abbreviation of: execute evaluation On a Microsoft windows computer you will hear a one second sine wave sound. If you go to the "inferior-lisp" buffer you will see a Nyquist message:
If you leave the scratch buffer in "Lisp Interaction" mode instead and type C-x C-e, Emacs will send your Nyquist code to the internal ELisp interpreter and the result will be that a debugger buffer is opened with a message like this:
If this happens to you then you know that your buffer is in the wrong Lisp mode. But you have learned that it is only a question of the buffer mode which Lisp interpreter will be used by Emacs. Now you know that you can use both - Emacs Lisp or Nyquist XLisp - whenever you like. You only have to switch the buffer mode. For Nyquist XLisp evaluations you need "Lisp Mode". For Lisp mode you type:
For Emacs Lisp (called ELisp) evaluations you need either "Emacs Lisp Mode" or "Lisp Interaction" mode. For Emacs Lisp mode you type:
For Lisp interaction mode you type:
See also: The different Emacs Lisp modes |