[slime-cvs] CVS slime

heller heller at common-lisp.net
Fri Aug 24 12:28:38 UTC 2007


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

Modified Files:
	slime.el ChangeLog 
Log Message:
Don't use rectangle code, because it inappropriately sets the mark.

* slime.el (slime-with-rigid-indentation): Fix evaluation order.
(slime-indent-rigidly): New.
(slime-insert-possibly-as-rectange): Don't set mark.



--- /project/slime/cvsroot/slime/slime.el	2007/08/23 22:50:06	1.804
+++ /project/slime/cvsroot/slime/slime.el	2007/08/24 12:28:38	1.805
@@ -1183,13 +1183,23 @@
 (defmacro slime-with-rigid-indentation (level &rest body)
   "Execute BODY and then rigidly indent its text insertions.
 Assumes all insertions are made at point."
-  (let ((start (gensym)))
-    `(let ((,start (point)))
+  (let ((start (gensym)) (l (gensym)))
+    `(let ((,start (point)) (,l ,(or level '(current-column))))
        (prog1 (progn , at body)
-         (indent-rigidly ,start (point) ,level)))))
+         (slime-indent-rigidly ,start (point) ,l)))))
 
 (put 'slime-with-rigid-indentation 'lisp-indent-function 1)
 
+(defun slime-indent-rigidly (start end column)
+  "Similar to `indent-rigidly' but doesn't inherit text props."
+  (save-excursion
+    (goto-char end)
+    (beginning-of-line)
+    (while (and (<= start (point))
+                (progn
+                  (save-excursion (insert-char ?\  column))
+                  (zerop (forward-line -1)))))))
+
 ;;;;; Snapshots of current Emacs state
 
 ;;; Window configurations do not save (and hence not restore)
@@ -3020,20 +3030,8 @@
         (delete-overlay overlay)))))
 
 (defun slime-insert-possibly-as-rectangle (&rest strings)
-  (if (zerop (current-column))
-      (apply #'insert strings)
-      (dolist (string strings)
-        (if (string= string "\n")
-            (newline)
-            (let ((lines (split-string string "\n")))
-              (when (rest lines)
-                (save-excursion
-                  (dotimes (i (length lines))
-                    (newline))))
-              (insert-rectangle lines)
-              (when (rest lines)
-                (forward-char 1)
-                (delete-backward-char 1)))))))
+  (slime-with-rigid-indentation nil
+    (apply #'insert strings)))
 
 (defun slime-insert-presentation (string output-id)
   (cond ((not slime-repl-enable-presentations)
--- /project/slime/cvsroot/slime/ChangeLog	2007/08/24 06:41:54	1.1154
+++ /project/slime/cvsroot/slime/ChangeLog	2007/08/24 12:28:38	1.1155
@@ -1,18 +1,24 @@
 2007-08-24  Helmut Eller  <heller at common-lisp.net>
 
+	* slime.el (slime-with-rigid-indentation): Fix evaluation order.
+	(slime-indent-rigidly): New.
+	(slime-insert-possibly-as-rectange): Don't set mark.
+
+2007-08-24  Helmut Eller  <heller at common-lisp.net>
+
 	* swank-sbcl.lisp (sbcl-inspector): Fix typo.
 
 2007-08-23  Matthias Koeppe  <mkoeppe at mail.math.uni-magdeburg.de>
 
 	Repair inspection of presentations.
-	
+
 	* swank.lisp (inspect-presentation): New slimefun.
 	* slime.el (slime-inspect-presentation-at-mouse): Use it here.
 
 2007-08-23  Helmut Eller  <heller at common-lisp.net>
 
 	Move Marco Baringer's inspector to contrib.
-	
+
 	* swank.lisp (*default-inspector*): New variable. Set this
 	variable dispatch to different inspectors.
 	(inspect-object): Use it.




More information about the slime-cvs mailing list