annotate lisp/hyperbole/kotl/kotl.el @ 123:c77884c6318d

Added tag r20-1b14 for changeset d2f30a177268
author cvs
date Mon, 13 Aug 2007 09:26:04 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: kotl.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Internal representation of outline kcells used by kviews.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: outlines, wp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Kellie Clark & Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; ORIG-DATE: 5/1/93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; LAST-MOD: 29-Oct-95 at 11:13:47 by Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; This file is part of Hyperbole.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; Available for use and distribution under the same terms as GNU Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; Developed with support from Motorola Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; DESCRIPTION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; DESCRIP-END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (mapcar 'require '(klabel knode hinit htz))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (defvar kcell:read-only-attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 '(idstamp creator create-time modifier mod-time)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 "List of kcell attributes which may not be modified by a user.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 Add to this list but don't remove any of the default elements.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;;; kcell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (fset 'kcell:contents 'knode:contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (defun kcell:copy (kcell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 "Return a copy of KCELL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (knode:copy kcell))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (defun kcell:create (contents idstamp &optional plist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "Return a new kcell which stores CONTENTS (a string or nil), has permanent IDSTAMP (an integer), and optional additional property list, PLIST.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 User id of `creator' of cell and `create-time' are added to cell's PLIST if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 not already there."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (and contents (not (stringp contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (error "(kcell:create): Invalid `contents' argument: %s" contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (if (or (not (integerp idstamp)) (< idstamp 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (error "(kcell:create): Invalid `idstamp' argument: %s" idstamp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (knode:create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 contents (nconc (list 'idstamp idstamp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (if (memq 'creator plist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (list 'creator (concat (user-login-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 hyperb:host-domain)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 'create-time (htz:date-sortable-gmt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 plist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (defun kcell:create-top (&optional file counter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 "Return a new koutline top cell optionally attached to FILE with current idstamp COUNTER."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (kcell:create nil 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;; id-counter = max idstamp value given out in this kotl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (list 'id-counter (or counter 0) 'file file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defun kcell:get-attr (kcell attribute)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "Return the value of KCELL's ATTRIBUTE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (knode:get-attr (kcell:plist kcell) attribute))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (defun kcell:idstamp (kcell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 "Return permanent idstamp of KCELL as an integer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (kcell:get-attr kcell 'idstamp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (fset 'kcell:is-p 'knode:is-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (defun kcell:plist (kcell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (knode:get-attr kcell 'plist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (defun kcell:ref-to-id (cell-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 "Returns a CELL-REF string converted to a cell identifier string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 If CELL-REF contains both a relative and a permanent id, the permanent id is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 returned. If CELL-REF is invalid, nil is returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 CELL-REF may be of any of the following forms:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 1b - relative id, augment style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 1.2 - relative id, legal style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 012 - permanent idstamp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 1a=012 - both relative and permanent ids (in that order) separated by =
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 |viewspec - a viewspec setting, rather than a cell reference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 :viewspec - an augment viewspec, ignored for now.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 Optionally, any of the above id forms may be followed by a period and some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 alpha characters indicating a location relative to the id.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 Optionally, any of these id forms (or the relative form) may be followed by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 zero or more whitespace characters, a | and some view specification
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 characters. Augment viewspec characters preceded by a colon are ignored, for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 now."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (if (not (stringp cell-ref))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (setq cell-ref (hypb:replace-match-string "\\s +" cell-ref "" t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (let ((specs) result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;; Ignore Augment :viewspecs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (if (string-match ":" cell-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (setq cell-ref (substring cell-ref 0 (match-beginning 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;; Separate koutline |viewspecs from cell id.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (if (string-match "\\(\\.[a-zA-Z]\\||\\)" cell-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (setq specs (substring cell-ref (match-beginning 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 cell-ref (substring cell-ref 0 (match-beginning 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (setq result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ((string-match "[^.= \t\n0-9a-zA-Z]" cell-ref) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ((string-match "^\\([.0-9a-zA-Z]+\\)=\\(0[0-9]*\\)$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 cell-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (substring cell-ref (match-beginning 2) (match-end 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ((string-match "^\\([.0-9a-zA-Z]+\\)$" cell-ref)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (substring cell-ref (match-beginning 1) (match-end 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (cond (result
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (if specs (concat result specs) result))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (specs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (if (= ?| (aref specs 0)) specs))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (defun kcell:remove-attr (kcell attribute)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 "Remove KCELL's ATTRIBUTE, if any, return modified KCELL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (knode:set-attr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 kcell 'plist (knode:remove-attr (kcell:plist kcell) attribute)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (defun kcell:set-attr (kcell attribute value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 "Set KCELL's ATTRIBUTE to VALUE and return modified KCELL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (knode:set-attr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 kcell 'plist (knode:set-attr (kcell:plist kcell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 attribute value)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (defun kcell:set-create-time (kcell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 "Store the time of creation of KCELL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (kcell:set-attr kcell 'create-time (htz:date-sortable-gmt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (defun kcell:set-creator (kcell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 "Store the current user's id as the creator of KCELL."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (kcell:set-attr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 kcell 'creator (concat (user-login-name) hyperb:host-domain)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (defun kcell:set-idstamp (kcell idstamp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "Set KCELL's permanent IDSTAMP (an integer) and return IDSTAMP."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (kcell:set-attr kcell 'idstamp idstamp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (kcell:idstamp kcell))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;;; kotl-data - Persistent representation of kotl cells (written to files).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (defun kotl-data:create (cell)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 "Given a kotl CELL, return a kotl-data structure to write to a file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 If CELL, its idstamp, or its property list are nil, this repairs the cell by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 assuming it is the cell at point and filling in the missing information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (let ((idstamp (kcell:idstamp cell))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (plist (nthcdr 2 (kcell:plist cell))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (if (and cell idstamp plist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (vector idstamp plist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (kotl-data:create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (kcell:create nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (or idstamp (kview:id-increment kview))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 plist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (defun kotl-data:idstamp (kotl-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (aref kotl-data 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (defun kotl-data:plist-v2 (kotl-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (aref kotl-data 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (defun kotl-data:plist-v3 (kotl-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (aref kotl-data 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (defun kotl-data:to-kcell-v2 (kotl-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (if (vectorp kotl-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (kcell:create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ;; Cell contents are no longer put into cells themselves by default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ;; when a file is read. The contents are stored within the kview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;; buffer, so use nil as a place-holder.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ;; Repair invalid idstamps on the fly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (or (kotl-data:idstamp kotl-data) (kview:id-increment kview))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (kotl-data:plist-v2 kotl-data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ;; Repair invalid cells on the fly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (kcell:create nil (kview:id-increment kview))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defun kotl-data:to-kcell-v3 (kotl-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (if (vectorp kotl-data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (kcell:create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ;; Cell contents are no longer put into cells themselves by default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ;; when a file is read. The contents are stored within the kview
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ;; buffer, so use nil as a place-holder.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ;; Repair invalid idstamps on the fly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (or (kotl-data:idstamp kotl-data) (kview:id-increment kview))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (kotl-data:plist-v3 kotl-data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ;; Repair invalid cells on the fly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (kcell:create nil (kview:id-increment kview))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (provide 'kotl)