Update of /project/climacs/cvsroot/climacs In directory common-lisp.net:/tmp/cvs-serv1821
Modified Files: buffer.lisp climacs.asd gui.lisp packages.lisp pane.lisp Log Message: Persistent/balanced-tree buffer implementations with tests.
Date: Wed Jan 26 08:10:41 2005 Author: abakic
Index: climacs/buffer.lisp diff -u climacs/buffer.lisp:1.23 climacs/buffer.lisp:1.24 --- climacs/buffer.lisp:1.23 Tue Jan 18 10:59:51 2005 +++ climacs/buffer.lisp Wed Jan 26 08:10:40 2005 @@ -92,7 +92,7 @@ (defclass standard-right-sticky-mark (right-sticky-mark mark-mixin) () (:documentation "A right-sticky-mark subclass suitable for use in a standard-buffer"))
-(defmethod initialize-instance :after ((mark left-sticky-mark) &rest args &key (offset 0)) +(defmethod initialize-instance :after ((mark standard-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))) () @@ -102,7 +102,7 @@ :chain (slot-value (buffer mark) 'contents) :position offset)))
-(defmethod initialize-instance :after ((mark right-sticky-mark) &rest args &key (offset 0)) +(defmethod initialize-instance :after ((mark standard-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))) () @@ -287,7 +287,7 @@ either immediately before the closest following newline character, or at the end of the buffer if no following newline character exists."))
-(defmethod end-of-line ((mark mark-mixin)) +(defmethod end-of-line ((mark mark-mixin)) ;PB (let* ((offset (offset mark)) (buffer (buffer mark)) (chain (slot-value buffer 'contents))
Index: climacs/climacs.asd diff -u climacs/climacs.asd:1.15 climacs/climacs.asd:1.16 --- climacs/climacs.asd:1.15 Mon Jan 24 15:01:37 2005 +++ climacs/climacs.asd Wed Jan 26 08:10:40 2005 @@ -49,9 +49,13 @@ "Flexichain/utilities" "Flexichain/flexichain" "Flexichain/flexicursor" + "Persistent/binseq-package" + "Persistent/binseq" + "Persistent/obinseq" "translate" "packages" "buffer" + "Persistent/persistent-buffer" "base" "io" "abbrev" @@ -64,7 +68,9 @@ ;;---- optional ---- "testing/rt" "buffer-test" - "base-test") + "base-test" + "Persistent/persistent-buffer-test" + "Persistent/persistent-base-test")
#+asdf (defmethod asdf:perform :around ((o asdf:compile-op)
Index: climacs/gui.lisp diff -u climacs/gui.lisp:1.98 climacs/gui.lisp:1.99 --- climacs/gui.lisp:1.98 Mon Jan 24 04:49:09 2005 +++ climacs/gui.lisp Wed Jan 26 08:10:40 2005 @@ -747,7 +747,7 @@ (accept 'integer :prompt "Goto Position")))
(define-named-command com-goto-line () - (loop with mark = (make-instance 'standard-right-sticky-mark + (loop with mark = (make-instance 'standard-right-sticky-mark ;PB :buffer (buffer (current-window))) do (end-of-line mark) until (end-of-buffer-p mark)
Index: climacs/packages.lisp diff -u climacs/packages.lisp:1.40 climacs/packages.lisp:1.41 --- climacs/packages.lisp:1.40 Mon Jan 24 04:49:09 2005 +++ climacs/packages.lisp Wed Jan 26 08:10:40 2005 @@ -23,7 +23,7 @@ ;;; Package definitions for the Climacs editor.
(defpackage :climacs-buffer - (:use :clim-lisp :flexichain) + (:use :clim-lisp :flexichain :binseq) (:export #:buffer #:standard-buffer #:mark #:left-sticky-mark #:right-sticky-mark #:standard-left-sticky-mark #:standard-right-sticky-mark @@ -41,7 +41,10 @@ #:delete-region #:buffer-object #:buffer-sequence #:object-before #:object-after #:region-to-sequence - #:low-mark #:high-mark #:modified-p #:clear-modify)) + #:low-mark #:high-mark #:modified-p #:clear-modify + + #:binseq-buffer #:obinseq-buffer + #:persistent-left-sticky-mark #:persistent-right-sticky-mark))
(defpackage :climacs-base (:use :clim-lisp :climacs-buffer)
Index: climacs/pane.lisp diff -u climacs/pane.lisp:1.13 climacs/pane.lisp:1.14 --- climacs/pane.lisp:1.13 Mon Jan 24 04:49:09 2005 +++ climacs/pane.lisp Wed Jan 26 08:10:41 2005 @@ -156,7 +156,7 @@
;(defgeneric indent-tabs-mode (climacs-buffer))
-(defclass climacs-buffer (standard-buffer abbrev-mixin filename-mixin name-mixin undo-mixin) +(defclass climacs-buffer (standard-buffer abbrev-mixin filename-mixin name-mixin undo-mixin) ;PB ((needs-saving :initform nil :accessor needs-saving) (syntax :initarg :syntax :initform (make-instance 'basic-syntax) :accessor syntax) (indent-tabs-mode :initarg indent-tabs-mode :initform t @@ -195,14 +195,14 @@ (declare (ignore args)) (with-slots (buffer point mark) pane (when (null point) - (setf point (make-instance 'standard-right-sticky-mark + (setf point (make-instance 'standard-right-sticky-mark ;PB :buffer buffer))) (when (null mark) - (setf mark (make-instance 'standard-right-sticky-mark + (setf mark (make-instance 'standard-right-sticky-mark ;PB :buffer buffer)))) (with-slots (buffer top bot scan) pane - (setf top (make-instance 'standard-left-sticky-mark :buffer buffer) - bot (make-instance 'standard-right-sticky-mark :buffer buffer))) + (setf top (make-instance 'standard-left-sticky-mark :buffer buffer) ;PB + bot (make-instance 'standard-right-sticky-mark :buffer buffer))) ;PB (setf (stream-default-view pane) (make-instance 'climacs-textual-view)) (with-slots (space-width tab-width) (stream-default-view pane) (let* ((medium (sheet-medium pane)) @@ -212,12 +212,12 @@
(defmethod (setf buffer) :after (buffer (pane climacs-pane)) (with-slots (point mark top bot) pane - (setf point (make-instance 'standard-right-sticky-mark + (setf point (make-instance 'standard-right-sticky-mark ;PB :buffer buffer) - mark (make-instance 'standard-right-sticky-mark + mark (make-instance 'standard-right-sticky-mark ;PB :buffer buffer) - top (make-instance 'standard-left-sticky-mark :buffer buffer) - bot (make-instance 'standard-right-sticky-mark :buffer buffer)))) + top (make-instance 'standard-left-sticky-mark :buffer buffer) ;PB + bot (make-instance 'standard-right-sticky-mark :buffer buffer)))) ;PB
(define-presentation-type url () :inherit-from 'string)