[climacs-devel] two buffer/mark proposals
Aleksandar Bakic
a_bakic at yahoo.com
Sun Feb 27 12:03:26 UTC 2005
I solved the undo problem. Here are the essentials diffs besides the
delegating-buffer class in its own file.
Alex
Index: pane.lisp
===================================================================
RCS file: /project/climacs/cvsroot/climacs/pane.lisp,v
retrieving revision 1.18
diff -c -r1.18 pane.lisp
*** pane.lisp 5 Feb 2005 06:49:53 -0000 1.18
--- pane.lisp 27 Feb 2005 11:58:10 -0000
***************
*** 135,140 ****
--- 135,157 ----
(mapc #'flip-undo-record records)
(setf records (nreverse records))))
+ ;;; undo-mixin delegation (here because of the package)
+
+ (defmethod undo-tree ((buffer delegating-buffer))
+ (undo-tree (implementation buffer)))
+
+ (defmethod undo-accumulate ((buffer delegating-buffer))
+ (undo-accumulate (implementation buffer)))
+
+ (defmethod (setf undo-accumulate) (object (buffer delegating-buffer))
+ (setf (undo-accumulate (implementation buffer)) object))
+
+ (defmethod performing-undo ((buffer delegating-buffer))
+ (performing-undo (implementation buffer)))
+
+ (defmethod (setf performing-undo) (object (buffer delegating-buffer))
+ (setf (performing-undo (implementation buffer)) object))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Isearch
***************
*** 165,176 ****
;(defgeneric indent-tabs-mode (climacs-buffer))
! (defclass climacs-buffer (standard-buffer abbrev-mixin filename-mixin
name-mixin undo-mixin) ;PB
((needs-saving :initform nil :accessor needs-saving)
(syntax :accessor syntax)
(indent-tabs-mode :initarg indent-tabs-mode :initform t
:accessor indent-tabs-mode))
! (:default-initargs :name "*scratch*"))
(defmethod initialize-instance :after ((buffer climacs-buffer) &rest args)
(declare (ignore args))
--- 182,201 ----
;(defgeneric indent-tabs-mode (climacs-buffer))
! (defclass extended-standard-buffer (standard-buffer undo-mixin abbrev-mixin)
()
! (:documentation "Extensions accessible via marks."))
!
! (defclass extended-obinseq-buffer (obinseq-buffer undo-mixin abbrev-mixin) ()
! (:documentation "Extensions accessible via marks."))
!
! (defclass climacs-buffer (delegating-buffer filename-mixin name-mixin)
((needs-saving :initform nil :accessor needs-saving)
(syntax :accessor syntax)
(indent-tabs-mode :initarg indent-tabs-mode :initform t
:accessor indent-tabs-mode))
! (:default-initargs
! :name "*scratch*"
! :implementation (make-instance 'extended-standard-buffer)))
(defmethod initialize-instance :after ((buffer climacs-buffer) &rest args)
(declare (ignore args))
***************
*** 210,223 ****
(declare (ignore args))
(with-slots (buffer point mark) pane
(when (null point)
! (setf point (make-instance 'standard-right-sticky-mark ;PB
! :buffer buffer)))
(when (null 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) ;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))
--- 235,246 ----
(declare (ignore args))
(with-slots (buffer point mark) pane
(when (null point)
! (setf point (clone-mark (low-mark buffer) :right)))
(when (null mark)
! (setf mark (clone-mark (low-mark buffer) :right))))
(with-slots (buffer top bot scan) pane
! (setf top (clone-mark (low-mark buffer) :left)
! bot (clone-mark (high-mark buffer) :right)))
(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))
***************
*** 227,238 ****
(defmethod (setf buffer) :after (buffer (pane climacs-pane))
(with-slots (point mark top bot) pane
! (setf point (make-instance 'standard-right-sticky-mark ;PB
! :buffer buffer)
! mark (make-instance 'standard-right-sticky-mark ;PB
! :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)
--- 250,259 ----
(defmethod (setf buffer) :after (buffer (pane climacs-pane))
(with-slots (point mark top bot) pane
! (setf point (clone-mark (low-mark (implementation buffer)) :right)
! mark (clone-mark (low-mark (implementation buffer)) :right)
! top (clone-mark (low-mark (implementation buffer)) :left)
! bot (clone-mark (high-mark (implementation buffer)) :right))))
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250
More information about the climacs-devel
mailing list