[slime-cvs] CVS slime/contrib

CVS User sboukarev sboukarev at common-lisp.net
Fri May 7 08:27:20 UTC 2010


Update of /project/slime/cvsroot/slime/contrib
In directory cl-net:/tmp/cvs-serv21072

Modified Files:
	ChangeLog slime-presentations.el slime-repl.el 
Log Message:
* slime-presentations.el (slime-presentation-write): Reuse
functions from slime-repl. This fixes spurious point jumps.

* slime-repl.el (slime-repl-show-maximum-output):
Don't search for a window of the buffer if the current window
already displays it.
(slime-with-output-end-mark): Removed, unused.


--- /project/slime/cvsroot/slime/contrib/ChangeLog	2010/05/05 13:55:18	1.375
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2010/05/07 08:27:20	1.376
@@ -1,3 +1,13 @@
+2010-05-07  Stas Boukarev  <stassats at gmail.com>
+
+	* slime-presentations.el (slime-presentation-write): Reuse
+	functions from slime-repl. This fixes spurious point jumps.
+
+	* slime-repl.el (slime-repl-show-maximum-output):
+	Don't search for a window of the buffer if the current window
+	already displays it.
+	(slime-with-output-end-mark): Removed, unused.
+
 2010-05-05  Stas Boukarev  <stassats at gmail.com>
 
 	* slime-tramp.el (slime-tramp-to-lisp-filename): Check if slime is
--- /project/slime/cvsroot/slime/contrib/slime-presentations.el	2010/05/05 16:00:44	1.32
+++ /project/slime/cvsroot/slime/contrib/slime-presentations.el	2010/05/07 08:27:20	1.33
@@ -752,42 +752,23 @@
      t)
     (t nil)))
 
+(defun slime-presentation-write-result (string)
+  (with-current-buffer (slime-output-buffer)
+    (let ((marker (slime-output-target-marker :repl-result)))
+      (goto-char marker)
+      (slime-propertize-region `(face slime-repl-result-face
+                                      rear-nonsticky (face))
+        (insert string))
+      ;; Move the input-start marker after the REPL result.
+      (set-marker marker (point)))))
+
 (defun slime-presentation-write (string &optional target)
   (case target
     ((nil)                              ; Regular process output
-     (with-current-buffer (slime-output-buffer)
-       (slime-with-output-end-mark
-	(slime-propertize-region '(face slime-repl-output-face
-					rear-nonsticky (face))
-	  (insert string))
-        (set-marker slime-output-end (point))
-        (when (and (= (point) slime-repl-prompt-start-mark)
-                   (not (bolp)))
-          (insert "\n")
-          (set-marker slime-output-end (1- (point))))
-        (if (< slime-repl-input-start-mark (point))
-            (set-marker slime-repl-input-start-mark
-                        (point))))))
+     (slime-repl-emit string))
     (:repl-result                       
-     (with-current-buffer (slime-output-buffer)
-       (let ((marker (slime-output-target-marker target)))
-         (goto-char marker)
-         (slime-propertize-region `(face slime-repl-result-face
-                                         rear-nonsticky (face))
-           (insert string))
-         ;; Move the input-start marker after the REPL result.
-         (set-marker marker (point)))))
-    (t
-     (let* ((marker (slime-output-target-marker target))
-            (buffer (and marker (marker-buffer marker))))
-       (when buffer
-         (with-current-buffer buffer
-           (save-excursion 
-             ;; Insert STRING at MARKER, then move MARKER behind
-             ;; the insertion.
-             (goto-char marker)
-             (insert-before-markers string)
-             (set-marker marker (point)))))))))
+     (slime-presentation-write-result string))
+    (t (slime-emit-to-target string target))))
 
 (defun slime-presentation-current-input (&optional until-point-p)
   "Return the current input as string.
--- /project/slime/cvsroot/slime/contrib/slime-repl.el	2010/05/05 16:00:44	1.42
+++ /project/slime/cvsroot/slime/contrib/slime-repl.el	2010/05/07 08:27:20	1.43
@@ -160,27 +160,6 @@
       (display-buffer (current-buffer) t))
     (slime-repl-show-maximum-output)))
 
-(defmacro slime-with-output-end-mark (&rest body)
-  "Execute BODY at `slime-output-end'.  
-
-If point is initially at `slime-output-end' and the buffer is visible
-update window-point afterwards.  If point is initially not at
-`slime-output-end, execute body inside a `save-excursion' block."
-  `(let ((body.. (lambda () , at body))
-         (updatep.. (and (eobp) (pos-visible-in-window-p))))
-     (cond ((= (point) slime-output-end)
-            (let ((start.. (point)))
-              (funcall body..)
-              (set-marker slime-output-end (point))
-              (when (= start.. slime-repl-input-start-mark) 
-                (set-marker slime-repl-input-start-mark (point)))))
-           (t 
-            (save-excursion 
-              (goto-char slime-output-end)
-              (funcall body..))))
-     (when updatep..
-       (slime-repl-show-maximum-output))))
-
 (defun slime-output-filter (process string)
   (with-current-buffer (process-buffer process)
     (when (and (plusp (length string))
@@ -243,7 +222,7 @@
   (case target
     ((nil) (slime-repl-emit string))
     (:repl-result (slime-repl-emit-result string))
-    (t (slime-emit-string string target))))
+    (t (slime-emit-to-target string target))))
 
 (defvar slime-repl-popup-on-output nil
   "Display the output buffer when some output is written.
@@ -308,7 +287,7 @@
     (t
      (gethash target slime-output-target-to-marker))))
 
-(defun slime-emit-string (string target)
+(defun slime-emit-to-target (string target)
   "Insert STRING at target TARGET.
 See `slime-output-target-to-marker'."
   (let* ((marker (slime-output-target-marker target))
@@ -580,7 +559,9 @@
 (defun slime-repl-show-maximum-output ()
   "Put the end of the buffer at the bottom of the window."
   (when (eobp)
-    (let ((win (get-buffer-window (current-buffer))))
+    (let ((win (if (eq (window-buffer) (current-buffer))
+                   (selected-window)
+                   (get-buffer-window (current-buffer) t))))
       (when win
         (with-selected-window win
           (set-window-point win (point-max)) 





More information about the slime-cvs mailing list