comparison lisp/hyperbole/kotl/kprop-xe.el @ 104:cf808b4c4290 r20-1b4

Import from CVS: tag r20-1b4
author cvs
date Mon, 13 Aug 2007 09:16:51 +0200
parents 4be1180a9e89
children
comparison
equal deleted inserted replaced
103:30eda07fe280 104:cf808b4c4290
4 ;; SUMMARY: Koutline text property handling under XEmacs. 4 ;; SUMMARY: Koutline text property handling under XEmacs.
5 ;; USAGE: XEmacs Lisp Library 5 ;; USAGE: XEmacs Lisp Library
6 ;; KEYWORDS: outlines, wp 6 ;; KEYWORDS: outlines, wp
7 ;; 7 ;;
8 ;; AUTHOR: Bob Weiner 8 ;; AUTHOR: Bob Weiner
9 ;; ORG: InfoDock Associates
9 ;; 10 ;;
10 ;; ORIG-DATE: 7/27/93 11 ;; ORIG-DATE: 7/27/93
11 ;; LAST-MOD: 30-Oct-95 at 21:21:20 by Bob Weiner 12 ;; LAST-MOD: 28-Feb-97 at 23:41:02 by Bob Weiner
12 ;; 13 ;;
13 ;; This file is part of Hyperbole. 14 ;; This file is part of Hyperbole.
14 ;; Available for use and distribution under the same terms as GNU Emacs. 15 ;; Available for use and distribution under the same terms as GNU Emacs.
15 ;; 16 ;;
16 ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. 17 ;; Copyright (C) 1993, 1994, 1995, 1997 Free Software Foundation, Inc.
17 ;; Developed with support from Motorola Inc. 18 ;; Developed with support from Motorola Inc.
18 ;; 19 ;;
19 ;; DESCRIPTION: 20 ;; DESCRIPTION:
20 ;; DESCRIP-END. 21 ;; DESCRIP-END.
21 22
90 "From START to END, add PROPERTY-LIST properties to the text. 91 "From START to END, add PROPERTY-LIST properties to the text.
91 The optional fourth argument, OBJECT, is the string or buffer containing the 92 The optional fourth argument, OBJECT, is the string or buffer containing the
92 text. Text inserted before or after this region does not inherit the added 93 text. Text inserted before or after this region does not inherit the added
93 properties." 94 properties."
94 ;; Don't use text properties internally because they don't work as desired 95 ;; Don't use text properties internally because they don't work as desired
95 ;; when copied to a string and then reinserted. 96 ;; when copied to a string and then reinserted, at least in some versions
97 ;; of XEmacs.
96 (let ((extent (make-extent start end object))) 98 (let ((extent (make-extent start end object)))
97 (if (null extent) 99 (if (null extent)
98 (error "(kproperty:put): No extent at %d-%d to add properties %s" 100 (error "(kproperty:put): No extent at %d-%d to add properties %s"
99 start end property-list)) 101 start end property-list))
100 (if (/= (mod (length property-list) 2) 0) 102 (if (/= (mod (length property-list) 2) 0)
101 (error "(kproperty:put): Property-list has odd number of elements, %s" 103 (error "(kproperty:put): Property-list has odd number of elements, %s"
102 property-list)) 104 property-list))
103 (set-extent-property extent 'text-prop t) 105 (set-extent-property extent 'text-prop (car property-list))
104 (set-extent-property extent 'duplicable t) 106 (set-extent-property extent 'duplicable t)
105 (set-extent-property extent 'start-open t) 107 (set-extent-property extent 'start-open t)
106 (set-extent-property extent 'end-open t) 108 (set-extent-property extent 'end-open t)
107 (while property-list 109 (while property-list
108 (set-extent-property 110 (set-extent-property