@@ -176,20 +176,27 @@ See `caml-types-location-re' for annotation file format.
176
176
(and (= (car date1) (car date2))
177
177
(< (nth 1 date1) (nth 1 date2)))))
178
178
179
+
180
+ ; we use an obarray for hash-consing the strings within each tree
181
+
182
+ (defun caml-types-make-hash-table ()
183
+ (make-vector 255 0 ))
184
+
185
+ (defun caml-types-hcons (elem table )
186
+ (symbol-name (intern elem table)))
187
+
188
+
179
189
; tree of intervals
180
190
; each node is a vector
181
191
; [ pos-left pos-right type-info child child child... ]
182
192
; type-info =
183
193
; () if this node does not correspond to an annotated interval
184
194
; (type-start . type-end) address of the annotation in the .annot file
185
195
186
- (defun caml-types-hcons (elem table )
187
- (or (cl-gethash elem table) (cl-puthash elem elem table) elem))
188
-
189
196
(defun caml-types-build-tree (target-file )
190
197
(let ((stack ())
191
198
(accu ())
192
- (table (make-hash-table :test 'equal ))
199
+ (table (caml-types- make-hash-table))
193
200
(type-info ()))
194
201
(while (re-search-forward caml-types-location-re () t )
195
202
(let ((l-file (file-name-nondirectory (match-string 1 )))
@@ -389,9 +396,9 @@ and its type is displayed in the minibuffer, until the move is released."
389
396
; (message "Drag the mouse to explore types")
390
397
(unwind-protect
391
398
(caml-track-mouse
392
- (setq region (caml-types-typed-region
393
- target-buf
394
- (caml-event-point-start event)))
399
+ ; (setq region (caml-types-typed-region
400
+ ; target-buf
401
+ ; (caml-event-point-start event)))
395
402
(while (and event
396
403
(integer-or-marker-p
397
404
(setq cnum (caml-event-point-end event))))
@@ -430,8 +437,8 @@ and its type is displayed in the minibuffer, until the move is released."
430
437
)
431
438
)
432
439
(delete-overlay caml-types-expr-ovl)
433
- (if unlocked (font-lock-mode 1 )
434
- (remove-text-properties (car region ) (cdr region ) '(face)))
440
+ ; (if unlocked (font-lock-mode 1)
441
+ ; (remove-text-properties (car region) (cdr region) '(face)))
435
442
)))
436
443
437
444
(defun caml-types-typed-region (target-buf pos )
0 commit comments