Commits

Anonymous committed db443c1

2004-03-15 Steve Youngs <sryoungs@bigpond.net.au>

* Makefile (REQUIRES): Remove fsf-compat.

* reftex-sel.el (reftex-select-item):
* reftex-sel.el (reftex-select-mark):
* reftex-sel.el (reftex-select-unmark):
* reftex.el:
* reftex.el (reftex-highlight-overlays):
* reftex.el (reftex-highlight):

Set up compatibility code - overlays -> extents without using the
fsf-compat XEmacs package.

Comments (0)

Files changed (4)

+2004-03-15  Steve Youngs  <sryoungs@bigpond.net.au>
+
+	* Makefile (REQUIRES): Remove fsf-compat.
+
+	* reftex-sel.el (reftex-select-item):
+	* reftex-sel.el (reftex-select-mark):
+	* reftex-sel.el (reftex-select-unmark):
+	* reftex.el:
+	* reftex.el (reftex-highlight-overlays):
+	* reftex.el (reftex-highlight):
+
+	Set up compatibility code - overlays -> extents without using the
+	fsf-compat XEmacs package.
+
 2003-10-31  Norbert Koch  <viteno@xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.33 released.
 MAINTAINER = Carsten Dominik <dominik@science.uva.nl>
 PACKAGE = reftex
 PKG_TYPE = regular
-REQUIRES = fsf-compat xemacs-base
+REQUIRES = xemacs-base
 CATEGORY = standard
 
 LISPFILES  = reftex-vars.el reftex.el reftex-auc.el reftex-cite.el\
           (remove-hook 'post-command-hook 
                        'reftex-select-post-command-hook t))
         ;; Kill the mark overlays
-        (mapcar (lambda (c) (delete-overlay (nth 1 c)))
+        (mapcar (lambda (c) (reftex-delete-overlay (nth 1 c)))
                 reftex-select-marked)))))
 
     (set (make-local-variable 'reftex-last-line)
     (setq boe (or (previous-single-property-change (1+ (point)) :data)
                   (point-min))
           eoe (or (next-single-property-change (point) :data) (point-max)))
-    (setq ovl (make-overlay boe eoe))
+    (setq ovl (reftex-make-overlay boe eoe))
     (push (list data ovl separator) reftex-select-marked)
-    (overlay-put ovl 'face reftex-select-mark-face)
+    (reftex-overlay-put ovl 'face reftex-select-mark-face)
     (if (featurep 'xemacs)
-        ;; before-string property is broken in Emacs
-        (overlay-put ovl 'before-string
+        (reftex-overlay-put ovl 'begin-glyph
                      (if separator
                          (format "*%c%d* " separator
                                  (length reftex-select-marked))
          sep)
     (unless cell
       (error "No marked entry at point"))
-    (and ovl (delete-overlay ovl))
+    (and ovl (reftex-delete-overlay ovl))
     (setq reftex-select-marked (delq cell reftex-select-marked))
     (if (featurep 'xemacs)
-        ;; before-string property is broken in Emacs
         (progn
           (setq cnt (1+ (length reftex-select-marked)))
           (mapcar (lambda (c)
                     (setq sep (nth 2 c))
-                    (overlay-put (nth 1 c) 'before-string
+                    (reftex-overlay-put (nth 1 c) 'begin-glyph
                                  (if sep
                                      (format "*%c%d* " sep (decf cnt))
                                    (format "*%d*  " (decf cnt)))))
             (if (find-face face) (throw 'exit face))
           (if (facep face) (throw 'exit face)))))))
 
-;; Highlighting uses overlays.  For XEmacs, we need the emulation.
-(if (featurep 'xemacs) (require 'overlay))
+;; Highlighting uses overlays.  For XEmacs, we use extents.
+(if (featurep 'xemacs)
+    (progn
+      (defalias 'reftex-make-overlay 'make-extent)
+      (defalias 'reftex-overlay-put 'set-extent-property)
+      (defalias 'reftex-move-overlay 'set-extent-endpoints)
+      (defalias 'reftex-delete-overlay 'detach-extent))
+  (defalias 'reftex-make-overlay 'make-overlay)
+  (defalias 'reftex-overlay-put 'overlay-put)
+  (defalias 'reftex-move-overlay 'move-overlay)
+  (defalias 'reftex-delete-overlay 'delete-overlay))
 
 ;; We keep a vector with several different overlays to do our highlighting.
 (defvar reftex-highlight-overlays [nil nil nil])
 
 ;; Initialize the overlays
-(aset reftex-highlight-overlays 0 (make-overlay 1 1))
-(overlay-put (aref reftex-highlight-overlays 0) 
+(aset reftex-highlight-overlays 0 (reftex-make-overlay 1 1))
+(reftex-overlay-put (aref reftex-highlight-overlays 0) 
              'face 'highlight)
-(aset reftex-highlight-overlays 1 (make-overlay 1 1))
-(overlay-put (aref reftex-highlight-overlays 1)
+(aset reftex-highlight-overlays 1 (reftex-make-overlay 1 1))
+(reftex-overlay-put (aref reftex-highlight-overlays 1)
              'face reftex-cursor-selected-face)
-(aset reftex-highlight-overlays 2 (make-overlay 1 1))
-(overlay-put (aref reftex-highlight-overlays 2)
+(aset reftex-highlight-overlays 2 (reftex-make-overlay 1 1))
+(reftex-overlay-put (aref reftex-highlight-overlays 2)
              'face reftex-cursor-selected-face)
 
 ;; Two functions for activating and deactivation highlight overlays
 (defun reftex-highlight (index begin end &optional buffer)
   "Highlight a region with overlay INDEX."
-  (move-overlay (aref reftex-highlight-overlays index)
+  (reftex-move-overlay (aref reftex-highlight-overlays index)
                 begin end (or buffer (current-buffer))))
 (defun reftex-unhighlight (index)
   "Detach overlay INDEX."
-  (delete-overlay (aref reftex-highlight-overlays index)))
+  (reftex-delete-overlay (aref reftex-highlight-overlays index)))
 
 (defun reftex-highlight-shall-die ()
   ;; Function used in pre-command-hook to remove highlights.