aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorDavid Aspinall2000-09-23 14:35:18 +0000
committerDavid Aspinall2000-09-23 14:35:18 +0000
commit66d26d3666ea534f7f2dde67981a089d24ec71e2 (patch)
treeb6f4b897f8f244f17fa10a602d3b892bb9efb164 /generic
parentc0cd4087fa6520119c3c8e4bd46fe797675c894c (diff)
Always activate bug fix -- this file only loaded for FSF Emacs.
Diffstat (limited to 'generic')
-rw-r--r--generic/span-overlay.el38
1 files changed, 20 insertions, 18 deletions
diff --git a/generic/span-overlay.el b/generic/span-overlay.el
index 7b313ed4..e3243e52 100644
--- a/generic/span-overlay.el
+++ b/generic/span-overlay.el
@@ -265,24 +265,26 @@ A span is before PT if it covers the character before PT."
(find-span-aux prev-prop-p (span-property span 'before))))
; overlays are [start, end)
-; Then test is for a dirty bug fix with FSF Emacs with next-span not
-; advancing the span !
-(if proof-running-on-XEmacs
- (defun next-span (span prop)
- "Return span after SPAN with property PROP. If there are two spans overlapping then this won't work."
- (let ((l (member-if (lambda (span) (span-property span prop))
- (overlays-at
- (next-overlay-change (overlay-start span))))))
- (car-safe l)))
- (defun next-span (span prop)
- "Return span after SPAN with property PROP. If there are two spans overlapping then this won't work."
- (let (spanres (l (member-if (lambda (span) (span-property span prop))
- (overlays-at
- (next-overlay-change (overlay-start span))))))
- (setq spanres (car-safe l))
- (if (and spanres (<= (span-start spanres) (span-start span)))
- nil spanres))))
-
+
+; Since Emacs 20.6 or so, next-span started being buggy.
+; Original version:
+;(defun next-span (span prop)
+; "Return span after SPAN with property PROP. If there are two spans overlapping then this won't work."
+; (let ((l (member-if (lambda (span) (span-property span prop))
+; (overlays-at
+; (next-overlay-change (overlay-start span))))))
+; (car-safe l)))
+; Hacked version by Christophe Raffalli:
+(defun next-span (span prop)
+ "Return span after SPAN with property PROP. If there are two spans overlapping then this won't work."
+ (let (spanres (l (member-if (lambda (span) (span-property span prop))
+ (overlays-at
+ (next-overlay-change (overlay-start span))))))
+ (setq spanres (car-safe l))
+ ;; The test is for a dirty bug fix with FSF Emacs with next-span not
+ ;; advancing the span!
+ (if (and spanres (<= (span-start spanres) (span-start span)))
+ nil spanres)))
(defsubst span-live-p (span)
"Return non-nil if SPAN is in a live buffer."