From xemacs-m  Sat Mar  1 02:19:49 1997
Received: from venus.Sun.COM (venus.Sun.COM [192.9.25.5])
	by xemacs.org (8.8.5/8.8.5) with SMTP id CAA19192
	for <xemacs-beta@xemacs.org>; Sat, 1 Mar 1997 02:19:48 -0600 (CST)
Received: from infodock.com (wave.infodock.com [206.13.40.192]) by venus.Sun.COM (SMI-8.6/mail.byaddr) with ESMTP id AAA15062; Sat, 1 Mar 1997 00:18:43 -0800
Received: (from weiner@localhost) by infodock.com (8.7.4/8.7.3) id AAA04284; Sat, 1 Mar 1997 00:17:19 -0800
Date: Sat, 1 Mar 1997 00:17:19 -0800
From: Bob Weiner <weiner@infodock.com>
Message-Id: <199703010817.AAA04284@infodock.com>
To: sperber@informatik.uni-tuebingen.de
CC: hyperbole@infodock.com, xemacs-beta@xemacs.org, wing@666.com
In-reply-to: <y9lzpwp5qvv.fsf@modas.informatik.uni-tuebingen.de> (sperber@informatik.uni-tuebingen.de)
Subject: Re: kotl-mode broken in Hyperbole distributed with XEmacs 20.1-b3


>>>>> "MS" == Michael Sperber <sperber@informatik.uni-tuebingen.de> writes:

   MS> The following patch was submitted several times (originally by Mats
   MS> Lidell, I believe).  Without it, kotl-mode does not work on XEmacs.

   MS> Bob?

I looked into this further and found that as I suggested, using
get-text-property should work.  The problem is that for some strange reason,
the internals of put-text-property were changed in an incompatible way.  The
test to determine whether an extent has text-properties is no longer simply
to test if the extent contains a non-nil 'text-prop value.  Now its value
must be the symbol for another property of the extent and that property value
must be non-nil.

The Koutliner, which was forced to use the internals of put-text-property
because text-properties in XEmacs were not copied properly to strings, was
never updated to reflect this incompatible change, so breakage ensued.

The fix is simple, however. Do NOT apply the quoted patch from Mike included
immediately below (unapply it if you have applied it already).  Instead apply
the unified patch at the END of this message to fix the problem.

Personally, however, I think it is an internal XEmacs bug that if an extent
has a 'text-prop property with the value `t', it is still not considered a
text-property.  The more restrictive test used, whereby the value of
'text-prop must be the name of another property of the extent and the value
of this property must be non-nil value, seems to limit the implementation to
a single text-property per extent whereas I think all properties of an
extent with the 'text-prop property should be considered text-properties (it
makes sense if you read it slowly).

Maybe this was done to implement some way out feature set, but I doubt it.
If Steve wants to regress the behavior to the more logical and safer route,
two changes are needed:

       1. In put_text_prop of extents.c, the line:

	      Fset_extent_property (extent, Qtext_prop, prop);

          should be changed to:

	      Fset_extent_property (extent, Qtext_prop, Qt);


       2. get_text_property_bytind of extents.c must be rewritten
          to not try to match the value of 'text-prop to a property
          of the extent.


None of these problems exist in InfoDock, our turn-key integrated environment
built atop XEmacs, so if you'd rather not deal with patching your own stuff
and wading through stuff like this, consider contacting us at
<info@infodock.com> for commercial-quality solutions and support.

Bob


   MS> Cheers =8-} Mike

   MS> *** lisp/hyperbole/kotl/kprop-xe.el~	Fri Feb 21 04:24:00 1997
   MS> --- lisp/hyperbole/kotl/kprop-xe.el	Fri Feb 28 08:21:14 1997
   MS> ***************
   MS> *** 29,39 ****
   MS>   ;;; Public functions
   MS>   ;;; ************************************************************************
  
   MS> ! ;; (get-text-property (pos prop &optional object))
   MS> ! ;; Return the value of position POS's property PROP, in OBJECT.
   MS> ! ;; OBJECT is optional and defaults to the current buffer.
   MS> ! ;; If POSITION is at the end of OBJECT, the value is nil.
   MS> ! (fset 'kproperty:get 'get-text-property)
  
   MS>   (if (and hyperb:xemacs-p (or (>= emacs-minor-version 12)
   MS>   			     (> emacs-major-version 19)))
   MS> --- 29,39 ----
   MS>   ;;; Public functions
   MS>   ;;; ************************************************************************
  
   MS> ! (defun kproperty:get (pos prop &optional object)
   MS> !   "Return the value of position POS's property PROP, in OBJECT.
   MS> ! OBJECT is optional and defaults to the current buffer.
   MS> ! If POSITION is at the end of OBJECT, the value is nil."
   MS> !    (extent-property (extent-at pos object) prop))
  
   MS>   (if (and hyperb:xemacs-p (or (>= emacs-minor-version 12)
   MS>   			     (> emacs-major-version 19)))



---------------------------------
Patch to apply in lisp/hyperbole/kotl/:


--- kprop-xe.el~	Mon Oct 30 19:20:53 1995
+++ kprop-xe.el	Fri Feb 28 23:41:02 1997
@@ -6,14 +6,15 @@
 ;; KEYWORDS:     outlines, wp
 ;;
 ;; AUTHOR:       Bob Weiner
+;; ORG:          InfoDock Associates
 ;;
 ;; ORIG-DATE:    7/27/93
-;; LAST-MOD:     30-Oct-95 at 21:21:20 by Bob Weiner
+;; LAST-MOD:     28-Feb-97 at 23:41:02 by Bob Weiner
 ;;
 ;; This file is part of Hyperbole.
 ;; Available for use and distribution under the same terms as GNU Emacs.
 ;;
-;; Copyright (C) 1993, 1994, 1995  Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1994, 1995, 1997  Free Software Foundation, Inc.
 ;; Developed with support from Motorola Inc.
 ;;
 ;; DESCRIPTION:  
@@ -92,7 +93,8 @@
 text.  Text inserted before or after this region does not inherit the added
 properties."
   ;; Don't use text properties internally because they don't work as desired
-  ;; when copied to a string and then reinserted.
+  ;; when copied to a string and then reinserted, at least in some versions
+  ;; of XEmacs.
   (let ((extent (make-extent start end object)))
     (if (null extent)
 	(error "(kproperty:put): No extent at %d-%d to add properties %s" 
@@ -100,7 +102,7 @@
     (if (/= (mod (length property-list) 2) 0)
 	(error "(kproperty:put): Property-list has odd number of elements, %s"
 	       property-list))
-    (set-extent-property extent 'text-prop t)
+    (set-extent-property extent 'text-prop (car property-list))
     (set-extent-property extent 'duplicable t)
     (set-extent-property extent 'start-open t)
     (set-extent-property extent 'end-open t)

