Skip to content
Snippets Groups Projects
Commit cec30e5c27b2 authored by aidan's avatar aidan
Browse files

This is Steve Youngs change of microsoft-free.87vf7z6dqk.fsf@youngs.au.com ,

moving re-builder to using extents, and fixing a bug related to
reb-color-display-p.
parent 8e38f8912da3
No related branches found
No related tags found
No related merge requests found
2005-03-10 Steve Youngs <steve@sxemacs.org>
* Makefile (REQUIRES): Remove fsf-compat. This package uses
extents natively now.
* re-builder.el: Set up better extent/overlay compatibility.
(reb-delete-overlays): Use it here.
(reb-update-overlays): Ditto.
(reb-color-display-p): Call `device-class' in
XEmacs so this function will DTRT in XEmacs.
2005-03-09 Norbert Koch <viteno@xemacs.org>
* Makefile (VERSION): XEmacs package 1.01 released.
......
......@@ -25,7 +25,7 @@ AUTHOR_VERSION = 1.20
MAINTAINER = Aidan Kehoe <aidan@xemacs.org>
PACKAGE = re-builder
PKG_TYPE = regular
REQUIRES = fsf-compat
REQUIRES =
CATEGORY = standard
STANDARD_DOCS = t
......
......@@ -110,9 +110,17 @@
;;; Code:
;; On XEmacs, load the overlay compatibility library
(if (not (fboundp 'make-overlay))
(require 'overlay))
;; Extent/overlay compatibility
(if (featurep 'xemacs)
;; (S)XEmacs
(progn
(defalias 'reb-delete-overlay 'delete-extent)
(defalias 'reb-make-overlay 'make-extent)
(defalias 'reb-overlay-put 'set-extent-property))
;; GNU/Emacs
(defalias 'reb-delete-overlay 'delete-overlay)
(defalias 'reb-make-overlay 'make-overlay)
(defalias 'reb-overlay-put 'overlay-put))
;; User costomizable variables
(defgroup re-builder nil
......@@ -320,7 +328,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
;; emacs/xemacs compatibility
(if (fboundp 'frame-parameter)
(frame-parameter (selected-frame) 'display-type)
(frame-property (selected-frame) 'display-type))))
(device-class (frame-device (selected-frame))))))
(defsubst reb-lisp-syntax-p ()
"Return non-nil if RE Builder uses a Lisp syntax."
......@@ -532,7 +540,7 @@ optional fourth argument FORCE is non-nil."
"Delete all RE Builder overlays in the `reb-target-buffer' buffer."
(if (buffer-live-p reb-target-buffer)
(with-current-buffer reb-target-buffer
(mapcar 'delete-overlay reb-overlays)
(mapcar 'reb-delete-overlay reb-overlays)
(setq reb-overlays nil))))
(defun reb-assert-buffer-in-window ()
......@@ -661,25 +669,25 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
(or (not reb-auto-match-limit)
(< matches reb-auto-match-limit)))
(if (= 0 (length (match-string 0)))
(error "Empty regular expression!"))
(error "Empty regular expression!"))
(let ((i 0))
(setq matches (1+ matches))
(while (<= i subexps)
(if (and (or (not subexp) (= subexp i))
(match-beginning i))
(let ((overlay (make-overlay (match-beginning i)
(match-end i)))
(let ((overlay (reb-make-overlay (match-beginning i)
(match-end i)))
(face-name (format "reb-match-%d" i)))
(if (not firstmatch)
(setq firstmatch (match-data)))
(setq reb-overlays (cons overlay reb-overlays)
submatches (1+ submatches))
(overlay-put
(reb-overlay-put
overlay 'face
(or (intern-soft face-name)
(error "Too many subexpressions - face `%s' not defined"
face-name )))
(overlay-put overlay 'priority i)))
(reb-overlay-put overlay 'priority i)))
(setq i (1+ i))))))
(let ((count (if subexp submatches matches)))
(message "%s %smatch%s%s"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment