aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHealfdene Goguen1998-06-02 15:36:51 +0000
committerHealfdene Goguen1998-06-02 15:36:51 +0000
commit88142455e396cc459c631c79cf99e31092008602 (patch)
tree5f5a7ee66365639a7fc81bd49a9f34daf97641ed
parentae555dfe561827c8132f1eff800ea7da902c1d56 (diff)
Corrected comment about this being for emacs19.
-rw-r--r--span-overlay.el46
1 files changed, 26 insertions, 20 deletions
diff --git a/span-overlay.el b/span-overlay.el
index 0527948f..c0f99d1c 100644
--- a/span-overlay.el
+++ b/span-overlay.el
@@ -1,10 +1,13 @@
-;;; This file implements spans in terms of extents, for xemacs.
+;;; This file implements spans in terms of overlays, for emacs19.
;;; Copyright (C) 1998 LFCS Edinburgh
;;; Author: Healfdene Goguen
;; Maintainer: LEGO Team <lego@dcs.ed.ac.uk>
;; $Log$
+;; Revision 1.6 1998/06/02 15:36:51 hhg
+;; Corrected comment about this being for emacs19.
+;;
;; Revision 1.5 1998/05/29 09:50:10 tms
;; o outsourced indentation to proof-indent
;; o support indentation of commands
@@ -49,32 +52,35 @@
(defsubst span-end (span)
(overlay-end span))
-(defun add-span-aux (span l)
- (cond (l (if (or (not (span-start l))
- (and (span-start span)
- (< (span-start span) (span-start l))))
- (progn
- (overlay-put l 'before
- (add-span-aux span (overlay-get l 'before)))
- l)
- (overlay-put span 'before l)
- span))
- (t (overlay-put span 'before nil)
- span)))
+(defsubst span-property (span name)
+ (overlay-get span name))
+
+(defsubst set-span-property (span name value)
+ (overlay-put span name value))
+
+(defun span-lt (s t)
+ (or (not (span-start t))
+ (and (span-start s)
+ (< (span-start s) (span-start t)))))
(defun add-span (span)
- (setq last-span (add-span-aux span last-span))
+ (if last-span
+ (let ((l last-span) (cont (span-lt span l)) tmp)
+ (while (and l cont)
+ (if (not (span-property l 'before))
+ (setq cont nil)
+ (setq l (span-property l 'before))
+ (setq cont (span-lt span l))))
+ (setq tmp (span-property l 'before))
+ (set-span-property l 'before span)
+ (set-span-property span 'before tmp))
+ (setq last-span span)
+ (set-span-property span 'before nil))
span)
(defun make-span (start end)
(add-span (make-overlay start end)))
-(defsubst span-property (span name)
- (overlay-get span name))
-
-(defsubst set-span-property (span name value)
- (overlay-put span name value))
-
(defun remove-span-aux (span l)
(cond ((not l) (error "Bug: removing span from empty list"))
((eq span (span-property l 'before))