Update of /project/mcclim/cvsroot/mcclim/Drei In directory clnet:/tmp/cvs-serv21453
Modified Files: drei.lisp drei-clim.lisp Log Message: Make use of `accepting-from-user' general (seems to work) and move definition of `display-drei' to drei.lisp
--- /project/mcclim/cvsroot/mcclim/Drei/drei.lisp 2006/11/11 00:08:30 1.4 +++ /project/mcclim/cvsroot/mcclim/Drei/drei.lisp 2006/11/14 07:48:30 1.5 @@ -615,6 +615,10 @@ top (clone-mark (low-mark buffer) :left) bot (clone-mark (high-mark buffer) :right))))
+;; Main redisplay entry point. +(defgeneric display-drei (frame drei) + (:documentation "Display the given Drei instance.")) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Some standard building block machinery. @@ -754,6 +758,23 @@ (unwind-protect (progn ,@body) ,@(remove-if #'null (mapcar #'third triple-list))))))))
+(defgeneric invoke-accepting-from-user (drei continuation) + (:documentation "Set up `drei' and the environment so that +calls to `accept' will behave properly. Then call +`continuation'.")) + +(defmethod invoke-accepting-from-user ((drei drei) (continuation function)) + ;; By default, everything should work. + (funcall continuation)) + +(defmacro accepting-from-user ((drei) &body body) + "Modidfy `drei' and the environment so that calls to `accept' +can be done to arbitrary streams from within `body'. Or, at +least, make sure the Drei instance will not be a problem. When +Drei calls a command, it will be wrapped in this macro, so it +should be safe to use `accept' within Drei commands." + `(invoke-accepting-from-user ,drei #'(lambda () ,@body))) + ;;; Plain `execute-frame-command' is not good enough for us. Our ;;; event-handler method uses this function to invoke commands, note ;;; that it is also responsible for updating the syntax of the buffer @@ -774,7 +795,8 @@ (handling-drei-conditions ;; Must be a list of buffers, so wrap in call to `list'. (with-undo ((list buffer)) - (execute-frame-command frame command)) + (accepting-from-user (drei-instance) + (execute-frame-command frame command))) (setf (previous-command drei-instance) command) (update-syntax buffer (syntax buffer)) (when (modified-p buffer) @@ -784,20 +806,3 @@ (let ((*standard-input* (or *minibuffer* *standard-input*))) (execute-drei-command-for-frame (pane-frame (editor-pane drei)) drei command))) - -(defgeneric invoke-accepting-from-user (drei continuation) - (:documentation "Set up `drei' and the environment so that -calls to `accept' will behave properly. Then call -`continuation'.")) - -(defmethod invoke-accepting-from-user ((drei drei) (continuation function)) - ;; By default, everything should work. - (funcall continuation)) - -(defmacro accepting-from-user ((drei) &body body) - "Modidfy `drei' and the environment so that calls to `accept' -can be done to arbitrary streams from within `body'. Or, at -least, make sure the Drei instance will not be a problem. When -Drei calls a command, it will be wrapped in this macro, so it -should be safe to use `accept' within Drei commands." - `(invoke-accepting-from-user ,drei #'(lambda () ,@body))) --- /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp 2006/11/11 00:08:30 1.5 +++ /project/mcclim/cvsroot/mcclim/Drei/drei-clim.lisp 2006/11/14 07:48:30 1.6 @@ -287,8 +287,7 @@ (let* ((*minibuffer* (or *minibuffer* (unless (eq drei *standard-input*) *standard-input*)))) - (accepting-from-user (drei) - (execute-drei-command-for-frame (pane-frame drei) drei command)))) + (execute-drei-command-for-frame (pane-frame drei) drei command)))
(defmethod additional-command-tables append ((drei drei-gadget-pane) (table drei-command-table)) @@ -344,20 +343,17 @@ (:documentation "A constellation of a Drei gadget instance and a minibuffer."))
-(defgeneric display-drei (frame instance) - (:documentation "Display the given Drei instance.")) - -(defmethod display-drei (frame (instance drei-pane)) +(defmethod display-drei (frame (drei drei-pane)) (declare (ignore frame)) - (display-drei-pane instance (active instance))) + (display-drei-pane drei (active drei)))
-(defmethod display-drei :after (frame (instance drei)) - (with-accessors ((minibuffer minibuffer)) instance - (when (and minibuffer (not (eq minibuffer (editor-pane instance)))) +(defmethod display-drei :after (frame (drei drei)) + (with-accessors ((minibuffer minibuffer)) drei + (when (and minibuffer (not (eq minibuffer (editor-pane drei)))) (redisplay-frame-pane (pane-frame minibuffer) minibuffer))))
-(defmethod display-drei (frame (instance drei-area)) - (display-drei-area instance)) +(defmethod display-drei (frame (drei drei-area)) + (display-drei-area drei))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;