I'd especially like Hrvoje to comment on this...
After removing the fsf-compat package from my system this is the first
thing that gave me problems (because I have reftex stuff in my init
files). Anyway, I think the following patch fixes reftex properly so
it doesn't need fsf-compat.
I'm posting it here for discussion before I submit it to -patches and
to Carsten.
cvs server: Diffing .
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/reftex/ChangeLog,v
retrieving revision 1.37
diff -u -r1.37 ChangeLog
--- ChangeLog 31 Oct 2003 17:05:11 -0000 1.37
+++ ChangeLog 31 Jan 2004 23:45:57 -0000
@@ -1,3 +1,15 @@
+2004-02-01 Steve Youngs <sryoungs(a)bigpond.net.au>
+
+ * 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(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.33 released.
Index: reftex-sel.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/reftex/reftex-sel.el,v
retrieving revision 1.10
diff -u -r1.10 reftex-sel.el
--- reftex-sel.el 11 Aug 2003 12:37:46 -0000 1.10
+++ reftex-sel.el 31 Jan 2004 23:45:58 -0000
@@ -418,7 +418,7 @@
(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)
@@ -604,12 +604,12 @@
(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 'before-string
(if separator
(format "*%c%d* " separator
(length reftex-select-marked))
@@ -639,7 +639,7 @@
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
@@ -647,7 +647,7 @@
(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) 'before-string
(if sep
(format "*%c%d* " sep (decf cnt))
(format "*%d* " (decf cnt)))))
Index: reftex.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/reftex/reftex.el,v
retrieving revision 1.18
diff -u -r1.18 reftex.el
--- reftex.el 11 Aug 2003 12:37:46 -0000 1.18
+++ reftex.el 31 Jan 2004 23:46:00 -0000
@@ -2327,30 +2327,41 @@
(if (facep face) (throw 'exit face)))))))
;; Highlighting uses overlays. For XEmacs, we need the emulation.
-(if (featurep 'xemacs) (require 'overlay))
+;(if (featurep 'xemacs) (require 'overlay))
+
+(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.
--
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
| XEmacs - The only _______ you'll ever need. |
| Fill in the blank, yes, it's THAT good! |
|------------------------------<sryoungs(a)bigpond.net.au>---|
Show replies by date
Steve Youngs <sryoungs(a)bigpond.net.au> writes:
(if (featurep 'xemacs)
;; before-string property is broken in Emacs
- (overlay-put ovl 'before-string
+ (reftex-overlay-put ovl 'before-string
If we're using the extents API in a direct way, `before-string' should
be `begin-glyph'. (The overlay-put in fsf-compat translates one to
the other.)
Otherwise, the patch looks good to me.