[slime-cvs] CVS slime

heller heller at common-lisp.net
Tue Aug 28 14:38:05 UTC 2007


Update of /project/slime/cvsroot/slime
In directory clnet:/tmp/cvs-serv7896

Modified Files:
	slime.el ChangeLog 
Log Message:
* swank.lisp (slime-repl-clear-buffer-hook): New hook.
(slime-repl-clear-buffer): Use it.

* slime-presentations.el (slime-clear-presentations): New
function. Add it to slime-repl-clear-buffer-hook.


--- /project/slime/cvsroot/slime/slime.el	2007/08/28 08:24:34	1.831
+++ /project/slime/cvsroot/slime/slime.el	2007/08/28 14:38:05	1.832
@@ -3492,31 +3492,16 @@
     (goto-char slime-repl-input-start-mark)
     (line-beginning-position)))
 
-(defun slime-repl-clear-buffer (&optional num-lines)
-  "Delete the output generated by the Lisp process.
+(defvar slime-repl-clear-buffer-hook)
 
-NUM-LINES, if provided, specifies the number of lines before the
-repl's input line to leave. Specifying NUM-LINES causes swank to
-remember the repl results so some memory leaking is possible."
-  (interactive "P")
-  (let ((effective-num-lines (cond
-                               ((null num-lines) nil)
-                               ((consp num-lines) (first num-lines))
-                               ((integerp num-lines) num-lines)
-                               ((eql '- num-lines) -1))))
-    (unless effective-num-lines
-      (slime-eval-async `(swank:clear-repl-results)))
-    (set-marker slime-repl-last-input-start-mark nil)
-    (let ((inhibit-read-only t))
-      (delete-region (point-min)
-                     (if num-lines
-                         (save-excursion
-                           (goto-char slime-repl-input-start-mark)
-                           (forward-line (- effective-num-lines))
-                           (beginning-of-line)
-                           (point))
-                         (slime-repl-input-line-beginning-position)))
-      (goto-char slime-repl-input-start-mark))))
+(defun slime-repl-clear-buffer ()
+  "Delete the output generated by the Lisp process."
+  (interactive)
+  (set-marker slime-repl-last-input-start-mark nil)
+  (let ((inhibit-read-only t))
+    (delete-region (point-min) (slime-repl-input-line-beginning-position))
+    (goto-char slime-repl-input-start-mark))
+  (run-hooks 'slime-repl-clear-buffer-hook))
 
 (defun slime-repl-clear-output ()
   "Delete the output inserted since the last input."
--- /project/slime/cvsroot/slime/ChangeLog	2007/08/28 13:53:02	1.1178
+++ /project/slime/cvsroot/slime/ChangeLog	2007/08/28 14:38:05	1.1179
@@ -8,6 +8,8 @@
 	(*send-repl-results-function*): New variable.
 	(eval-region): Simplify.
 	(track-package, cat): New functions.
+	(slime-repl-clear-buffer-hook): New hook.
+	(slime-repl-clear-buffer): Use it.
 
 2007-08-28  Matthias Koeppe  <mkoeppe at mail.math.uni-magdeburg.de>
 




More information about the slime-cvs mailing list