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

[LAURA@VX.LCS.MIT.EDU: bug in IDENTITY translator ]



Well, priority level 2 (important) hasn't gotten any response from
customer service yet.  Anybody here got any suggestions?

Date: Mon, 15 Aug 88 16:46 EDT
From: Laura Bagnall <LAURA@VX.LCS.MIT.EDU>
Subject: bug in IDENTITY translator 
To: Bug-Lispm@ZERMATT.LCS.MIT.EDU, Customer-Reports@STONY-BROOK.SCRC.SYMBOLICS.COM
Status: RO

1In Symbolics 3640 Genera 7.2, System 376.158, Experimental Logical Pathnames Translation Files NEWEST, Utilities 27.29, Server Utilities 28.5,
Hardcopy 118.17, Zmail 165.20, LMFS 102.7, Tape 82.18, Nsage 27.120, Extended Help 18.4, Documentation Database 62.1, Metering Substrate 26.8,
Metering 11.2, Hacks 14.1, IP-TCP 67.5, ILA-NFS 9.7, 7-2-Patches 1.16, MAC 14.9, TeX-DVI 2.4, QUIC 2.0, IMPRESS 2.0, LPD 2.3, Pascal Runtime 20.2,
Compiler Tools Package 11.0, Compiler Tools Runtime 21.1, Pascal Package 9.0, Syntax Editor Runtime 4.0, TeX-SCT 2.1, TeX-Doc 2.0, TeX-Common 2.2,
VIRTeX 2.0, TeX 2.0, LaTeX 2.0, SliTeX 2.0, YTeX 2.0, BibTeX 2.2, Illustrate 13.2, Experimental Multilisp 22.0, Experimental Multilisp Compiler 12,
Experimental Bounce 3, Experimental LUNIX 1, Experimental Laura Init 4, Parvis 3.4, Basic Graph 3.0, microcode 3640-MIC 420, FEP 127,
FEP0:>v127-lisp.flod(64), FEP0:>v127-loaders.flod(64), FEP0:>v127-debug.flod(38), FEP0:>v127-info.flod(64), Machine serial number 4597,
Patch speller so it knows about "''" in Latex mode. (from LAURA:TOOLS;INIT-STUFF.LISP.13)
on Symbolics 3640 #4597 (Flute):

0Importance: Important (2) Workaround is needed

I have a presentation type called FILTER (defined below).  It has a
:presentation-subtypep option defined which says that one filter is a
subtypep of another if both their values are the same, or if they don't
both have the value option specified.

Example: 

(dw:presentation-subtypep '(filter :value boolean) '(filter :value integer))
NIL						;subtypep
T						;known-p
NIL						;predicate

(dw:presentation-subtypep '(filter :value boolean) '(filter :value boolean))
T						;subtypep
T						;known-p
NIL						;predicate

So far, so good.  However, the problem is that when the input context is
(filter :value something), presentations with type (filter :value
something-else) are incorrectly sensitive.  I have traced this as far as
the IDENTITY translator, defined below.  Its tester calls
DW:PRESENTATION-TYPE-APPLIES-P, which in turn calls
DW:PRESENTATION-SUBTYPEP with a third argument (PREDICATE-P) of T.  I
don't understand what PREDICATE-P means, but it has the result of
causing DW:PRESENTATION-SUBTYPEP to return T,T instead of NIL,T,NIL, as
before.

Example: 
(dw:presentation-subtypep '(filter :value boolean) '(filter :value integer) t) 
T
T
(dw:presentation-subtypep '(filter :value boolean) '(filter :value boolean) t)
T
T

The result of all of this is that the filter presentations are mouse
sensitive in an input context where they shouldn't be sensitive.  What
would be a workaround for this?     -- Laura


;;; Definition of filter presentation type

(define-presentation-type filter ((&key arguments value))
   :parser ((stream &key initially-display-possibilities)
	    (dw:complete-from-sequence
	      (get-filter-list dw:*program*)
	      stream
	      :initially-display-possibilities initially-display-possibilities))
   :presentation-subtypep
   ((type1 type2)
    (dw:with-presentation-type-arguments (filter type1)
      (let ((value1 value))
	(dw:with-presentation-type-arguments (filter type2)
	  (let ((value2 value))
	    (filter-subtypep value1 value2)))))))

(defun filter-subtypep (value1 value2)
  (cond ((and value1 value2)
	 ;; the following doesn't work.
	 ;; See message <19880630195835.7.LAURA@FLUTE.LCS.MIT.EDU>,
	 ;; sent to Bug-Lispm on 30 Jun 88.
	 ;; (dw:presentation-subtypep value1 value2)
	 (if (eq value1 value2)
	     (values t t)
	     (values nil t)))
	(t (values t t))))

(define-presentation-translator identity
  (t t
   :tester ((ignore &key presentation input-context)
	    (when (not (null input-context))
	      (let ((desired-type (presentation-input-context-presentation-type
				    input-context)))
		(presentation-type-applies-p (presentation-type presentation) desired-type
					     (presentation-object presentation))))))
  (object &key presentation input-context)
  (if (command-name-input-context-p
	(presentation-input-context-presentation-type input-context))
      (values object (presentation-type presentation)
	      :activate nil :dont-quote t :suffix " ")
    (values object
	    (presentation-type presentation))))