(defun ledit (l) (let ((sexp (copy-tree l))) (setq *sexp* sexp *sexp0* sexp *sexp1* sexp *markstack* (list sexp)) (when (eq 'ok (edit-sexp)) (rplaca l (car *sexp0*)) (rplacd l (cdr *sexp0*)) t))) ;;; (defun edit-sexp () (catch 'edit-sexp-end (let ((prompt 'e>) cmd) (prin1 prompt) (do ((cmd (read) (read))) (nil) (cond ((atom cmd) (ledit-atom-cmd cmd)) ((numberp (car cmd)) (ledit-list-number-cmd (car cmd) (cdr cmd))) (t (ledit-list-symbol-cmd (car cmd) (cdr cmd)))) (prin1 prompt)))))