CLIM mail archive

[Prev][Next][Index][Thread]

Command parser problem



    Date: Wed, 17 Oct 90 13:41 PDT
    From: TYSON@sunset.ai.sri.com (Mabry Tyson)

    First a simple thing...  It appears that an interactor pane is not a valid
    argument to STREAM-FINISH-OUTPUT but it is ok for your other STREAM- functions.

Fixed in patch number 13, which follows.

    Now a moderate problem:  In Gnuemacs with Allegro running under it, I
    get an error when I try to compile the DEFINE-PRESENTATION-TYPE SENTENCE
    below by itself (ie, in a file buffer) but Allegro compiles it fine when
    it compiles the file it is in.  I don't know if that is some problem
    related to CLIM, but ...

Can you provide a description of the error message?  Thanks.


    Now the complex thing...  The code below purports to read a sentence from
    the stream.  

    At least in Franz lisp, CLIM 1 0.9, the :MULTILINE T version goes into an
    infinite loop as it tries to update the cursor position from the input
    (as it rescans the input after I have added a \newline to it).

    ... is it a bug?

Yes, fixed in patch 12, which follows.  Please QA the patch for
us.

    [Also, am I wrong or can I avoid the two different forms of the call to
    ACCEPT above and the two different arglists for SENTENCE in the 
    DEFINE-PRESENTATION-TYPE below.]

You can't avoid it because CLIM's presentation type system in 0.9
doesn't have "presentation arguments."  There is a designed new
version of the presentation system which supports the extended
syntax and which should be in Release 1.0.

What follows is two patch files, separated by a line of
asterisks.

**************************************************************
;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: CLIM-INTERNALS; Base: 10; Patch-File: T -*-
;;; Patch file for CLIM-PATCH version 1.12
;;; Reason: Function (CLOS:METHOD CI::DO-TEXT-SCREEN-REAL-ESTATE (CI::OUTPUT-PROTOCOL-MIXIN T T T T T T T T T T)):
;;;   Skip over #\Newlines properly.
;;; Written by York, 10/18/90 09:51:19
;;; CLIM version: 0.9; ECO level 11 Developer's pre-release. (from CLIM:0-9;SYS;PRECOM),

(in-package :clim-internals)

;(SYSTEM-INTERNALS:FILES-PATCHED-IN-THIS-PATCH-FILE 
;  "CLIM:0-9;SYS;PRECOM.LISP.NEWEST"
;  "CLIM:0-9;CLIM;OUTPUT-PROTOCOL.LISP.101")
;
;
;;=====================================
;(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION)
;(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "CLIM:0-9;CLIM;OUTPUT-PROTOCOL.LISP.101")
;(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES
;  "-*- Mode: LISP; Syntax: Common-lisp; Package: CLIM-INTERNALS; Base: 10; Lowercase: Yes -*-")

;;; Input Editor support.  This does STREAM-SCAN-STRING-FOR-WRITING and
;;; other stuff, and calls the continuation so the Input Editor can know
;;; where its strings are on the screen.
(defmethod do-text-screen-real-estate ((stream output-protocol-mixin) continuation
				       string start end
				       cursor-x cursor-y height baseline style max-x)
  ;; Continuation is a function which takes L T R B Baseline
  (declare (dynamic-extent continuation)
	   (values new-cursor-x new-cursor-y new-height new-baseline))
  (unless end (setq end (length string)))
  (let ((medium #+Silica (sheet-medium stream) #-Silica stream))
    (loop
      (when (>= start end) (return (values cursor-x cursor-y height baseline)))
      (multiple-value-bind (write-char? next-char-index new-cursor-x new-baseline new-height)
	  (stream-scan-string-for-writing stream #+Silica medium string start end style
					  cursor-x max-x)
	(maxf height new-height)
	(maxf baseline new-baseline) 
	(setf start next-char-index)
	(unless (= cursor-x new-cursor-x)
	  (funcall continuation cursor-x cursor-y new-cursor-x (+ cursor-y height) baseline))
	(setf cursor-x new-cursor-x)
	(cond ((null write-char?))		;Nothing to do for this char.
	      ((or (graphic-char-p write-char?)	;Must have wrapped
		   (char-equal write-char? #\Newline))
	       (incf cursor-y height)
	       (setf height 0 cursor-x 0 baseline 0)
	       ;; We want to skip over the newline to continue the scan.
	       (when (char-equal write-char? #\Newline)
		 (incf start)))
	      ;; Tabs are a little inefficient in that they call the continuation an
	      ;; extra time when they could be folded into the rest of the string, but
	      ;; I don't think anybody will notice, especially since the callers of
	      ;; this function merge the rectangles.
	      ((char-equal write-char? #\Tab)
	       (let ((new-cursor-x (stream-next-tab-column stream cursor-x style)))
		 (when (> (+ new-cursor-x *character-wrap-indicator-width*) max-x)
		   (incf cursor-y height)
		   (setf height 0 cursor-x 0 baseline 0)
		   (setf new-cursor-x (stream-next-tab-column stream cursor-x style)))
		 (funcall continuation cursor-x cursor-y new-cursor-x (+ cursor-y height) 
			  baseline)
		 (setf cursor-x new-cursor-x)))
	      (t (error "~S found char ~A, and doesn't know what to do."	; ??
			'do-text-screen-real-estate write-char?)))))))



;;=====================================
;(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION)
;(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "CLIM:0-9;SYS;PRECOM.LISP")
;(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES
;  "-*- Mode: Lisp; Package: CLIM-INTERNALS; Base: 10.; Syntax: Common-Lisp -*-")

(when (= clim-internals::*clim-patch-level* 11)
  (setq clim-internals::*clim-patch-level* 12))


**************************************************************
;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: CLIM-INTERNALS; Base: 10; Patch-File: T -*-
;;; Patch file for CLIM-PATCH version 1.13
;;; Reason: Function (CLOS:METHOD CLIM-LISP:STREAM-FINISH-OUTPUT (CI::OUTPUT-PROTOCOL-MIXIN)):  Add this.
;;; Written by York, 10/18/90 10:06:53
;;; CLIM version: 0.9; ECO level 11 Developer's pre-release. (from CLIM:0-9;SYS;PRECOM),

(in-package :clim-internals)


;(SYSTEM-INTERNALS:FILES-PATCHED-IN-THIS-PATCH-FILE 
;  "CLIM:0-9;SYS;PRECOM.LISP.NEWEST"
;  "CLIM:0-9;CLIM;OUTPUT-PROTOCOL.LISP.102")
;
;
;;=====================================
;(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION)
;(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "CLIM:0-9;CLIM;OUTPUT-PROTOCOL.LISP.102")
;(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES
;  "-*- Mode: LISP; Syntax: Common-lisp; Package: CLIM-INTERNALS; Base: 10; Lowercase: Yes -*-")

(defmethod stream-finish-output ((stream output-protocol-mixin))
  ;; --- port layer doesn't provide full resynchronization.
  ;; --- so we call force-output to get its various :around methods.
  (stream-force-output stream)
  )



;;=====================================
;(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION)
;(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "CLIM:0-9;SYS;PRECOM.LISP")
;(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES
;  "-*- Mode: Lisp; Package: CLIM-INTERNALS; Base: 10.; Syntax: Common-Lisp -*-")

(when (= clim-internals::*clim-patch-level* 12)
  (setq clim-internals::*clim-patch-level* 13))




0,,

Follow-Ups: References:

Main Index | Thread Index