Search code examples
emacslispread-eval-print-loopslime

How to save all functions I entered in LispBox/Slime?


Situation: I entered several functions while working with REPL in Emacs. Problem: There is junk like "; Evaluation aborted" when I'm simply saving buffer. What I want: clear descriptions of all the functions I entered in their latest revision.

Can I do that? Thanks.


Solution

  • I agree that the best work flow method is to write your code in a separate buffer and evaluate in that, rather than enter the functions in the repl.

    Assuming you have gone the repl way, I guess, C. Martin's solution to save the repl log and manually go through it are your only options.

    If you entered the functions and vars into a separate package, you could go through the symbols in the package to help you decide what you want to keep.

    E.g. to see all symbols created in the cl-user package:

    (let ((p (find-package :cl-user)))
      (loop
         for s being the symbols in p
         when (eq p (symbol-package s))
         do (format t "~a~%" s)))