From:  david peterson
Subject: history mechanism (kbd) ??
Date: 
Message-ID: <35vc52$262k@yuma.ACNS.ColoState.EDU>
Is there some form of a history mechanism for the different 
implementations of Common Lisp?  I'm currently using AKCL but will
be using Allegro in the near future as well - so I'm interested 
in this capability for both.

To be more specific, I'm trying to find a keyboard-driven (i.e. not
mouse.cut.and.paste) way to cycle thru previous commands on the
CL prompt.  Ideally, I'd like to be able to edit (i.e. in line editor
fashion) the commands before submitting them.

I searched the FAQs for "history", "previous", and "next" to no avail.

I suspect that there may be 'work-around' ways to do this from Emacs,
but I'm using VI.  In other words, Emacs-specific methods would still
be appreciated but I'd like something editor/environment-independent.

TIA,
Dave

--
David Peterson                  #include        <standard.disclaimer>	
Department of Computer Science	#include        <witty.saying>
Colorado State University       #include        <fancy.pseudo.graphics>
········@cs.colostate.edu
From: Barry Margolin
Subject: Re: history mechanism (kbd) ??
Date: 
Message-ID: <35vet1$52j@tools.near.net>
In article <···········@yuma.ACNS.ColoState.EDU> ········@carter.cs.colostate.edu ( david peterson) writes:
>Is there some form of a history mechanism for the different 
>implementations of Common Lisp?  I'm currently using AKCL but will
>be using Allegro in the near future as well - so I'm interested 
>in this capability for both.

Except for Lisp Machines, I don't know of any Lisp systems that have a
built-in, Emacs- or vi-style history mechanism.  In general, Lisp vendors
have been implementing this by running Lisp from Emacs buffers and
providing Emacs enhancements to interface with the Lisp process.

>To be more specific, I'm trying to find a keyboard-driven (i.e. not
>mouse.cut.and.paste) way to cycle thru previous commands on the
>CL prompt.  Ideally, I'd like to be able to edit (i.e. in line editor
>fashion) the commands before submitting them.

The only things that are built into Common Lisp systems are the variables
+, ++, and +++, which hold the last three top-level forms.  So you can
re-execute the last form by typing:

	(eval +)

If you want to "edit" it, you can use SETF to modify parts of the form.
For instance, if you typed (+ <complex expression> <another expression>),
and then want to do the same thing except with subtraction, you could do:

(setq form +)
(setf (car form) '-)
(eval form)

>I suspect that there may be 'work-around' ways to do this from Emacs,
>but I'm using VI.  In other words, Emacs-specific methods would still
>be appreciated but I'd like something editor/environment-independent.

There are quite a few Emacs interfaces to Lisp that provide such
facilities.  I don't remember any details, but there should be a section in
the FAQ on this.
-- 

Barry Margolin
BBN Internet Services Corp.
······@near.net