[climacs-cvs] CVS update: climacs/buffer.lisp

Aleksandar Bakic abakic at common-lisp.net
Sat Jan 15 23:13:49 UTC 2005


Update of /project/climacs/cvsroot/climacs
In directory common-lisp.net:/tmp/cvs-serv18415

Modified Files:
	buffer.lisp 
Log Message:
Minor bug fixes.

Date: Sun Jan 16 00:13:48 2005
Author: abakic

Index: climacs/buffer.lisp
diff -u climacs/buffer.lisp:1.20 climacs/buffer.lisp:1.21
--- climacs/buffer.lisp:1.20	Sat Jan 15 18:39:24 2005
+++ climacs/buffer.lisp	Sun Jan 16 00:13:46 2005
@@ -95,6 +95,8 @@
 (defmethod initialize-instance :after ((mark left-sticky-mark) &rest args &key (offset 0))
   "Associates a created mark with the buffer it was created for."
   (declare (ignore args))
+  (assert (<= 0 offset (size (buffer mark))) ()
+	  (make-condition 'no-such-offset :offset offset))
   (setf (slot-value mark 'cursor)
 	(make-instance 'left-sticky-flexicursor
 	   :chain (slot-value (buffer mark) 'contents)
@@ -103,6 +105,8 @@
 (defmethod initialize-instance :after ((mark right-sticky-mark) &rest args &key (offset 0))
   "Associates a created mark with the buffer it was created for."
   (declare (ignore args))
+  (assert (<= 0 offset (size (buffer mark))) ()
+	  (make-condition 'no-such-offset :offset offset))
   (setf (slot-value mark 'cursor)
 	(make-instance 'right-sticky-flexicursor
 	   :chain (slot-value (buffer mark) 'contents)
@@ -398,7 +402,7 @@
 
 (defmethod delete-region ((mark1 mark-mixin) (mark2 mark-mixin))
   (assert (eq (buffer mark1) (buffer mark2)))
-  (when (> (offset mark1) (offset mark2))
+  (when (> (offset mark2) (offset mark1))
     (delete-buffer-range (buffer mark1)
 			 (offset mark1)
 			 (- (offset mark2) (offset mark1)))))




More information about the Climacs-cvs mailing list