[slime-cvs] CVS slime

mkoeppe mkoeppe at common-lisp.net
Sat Aug 25 00:37:26 UTC 2007


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

Modified Files:
	slime.el 
Log Message:
* slime.el (slime-dispatch-event): Handle new optionals args of
messages :presentation-start and :presentation-end.

* slime.el (slime-mark-presentation-start)
(slime-mark-presentation-end): New arg "target"; record
presentation boundaries separately for REPL results and regular
process output.  This fixes the presentation markup of REPL
results when the presentation-streams contrib is loaded.


--- /project/slime/cvsroot/slime/slime.el	2007/08/24 15:48:44	1.811
+++ /project/slime/cvsroot/slime/slime.el	2007/08/25 00:37:26	1.812
@@ -2645,10 +2645,10 @@
     (destructure-case event
       ((:write-string output &optional id target)
        (slime-write-string output id target))
-      ((:presentation-start id)
-       (slime-mark-presentation-start id))
-      ((:presentation-end id)
-       (slime-mark-presentation-end id))
+      ((:presentation-start id &optional target)
+       (slime-mark-presentation-start id target))
+      ((:presentation-end id &optional target)
+       (slime-mark-presentation-end id target))
       ;;
       ((:emacs-rex form package thread continuation)
        (slime-set-state "|eval...")
@@ -2927,10 +2927,14 @@
 (make-variable-buffer-local
  (defvar slime-presentation-start-to-point (make-hash-table)))
 
-(defun slime-mark-presentation-start (id)
+(defun slime-mark-presentation-start (id target)
+  "Mark the beginning of a presentation with the given ID.
+TARGET can be nil (regular process output) or :repl-result."
   (setf (gethash id slime-presentation-start-to-point) 
         (with-current-buffer (slime-output-buffer)
-          (marker-position (symbol-value 'slime-output-end)))))
+          (if (eq target :repl-result)
+              (point-max)
+            (marker-position (symbol-value 'slime-output-end))))))
 
 (defun slime-mark-presentation-start-handler (process string)
   (if (and string (string-match "<\\([-0-9]+\\)" string))
@@ -2938,13 +2942,19 @@
              (id (car (read-from-string match))))
         (slime-mark-presentation-start id))))
 
-(defun slime-mark-presentation-end (id)
+(defun slime-mark-presentation-end (id target)
+  "Mark the end of a presentation with the given ID.
+TARGET can be nil (regular process output) or :repl-result."
   (let ((start (gethash id slime-presentation-start-to-point)))
     (remhash id slime-presentation-start-to-point)
     (when start
       (with-current-buffer (slime-output-buffer)
-        (slime-add-presentation-properties start (symbol-value 'slime-output-end)
-                                           id nil)))))
+        (let ((end 
+               (if (eq target :repl-result)
+                   (point-max)
+                 (symbol-value 'slime-output-end))))
+        (slime-add-presentation-properties start end
+                                           id nil))))))
 
 (defun slime-mark-presentation-end-handler (process string)
   (if (and string (string-match ">\\([-0-9]+\\)" string))




More information about the slime-cvs mailing list