Show
Ignore:
Timestamp:
05/13/06 11:07:13 (3 years ago)
Author:
miyoshi
Message:

Load emacs-to-svn into vendor/emacs-CVS_HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/emacs-CVS_HEAD/lisp/emacs-lisp/re-builder.el

    r4035 r4077  
    113113    (require 'overlay)) 
    114114 
    115 ;; User costomizable variables 
     115;; User customizable variables 
    116116(defgroup re-builder nil 
    117117  "Options for the RE Builder." 
     
    628628    i)) 
    629629 
    630  
    631630(defun reb-update-overlays (&optional subexp) 
    632631  "Switch to `reb-target-buffer' and mark all matches of `reb-regexp'. 
    633632If SUBEXP is non-nil mark only the corresponding sub-expressions." 
    634  
    635633  (let* ((re (reb-target-binding reb-regexp)) 
    636634         (subexps (reb-count-subexps re)) 
     
    646644                      (< matches reb-auto-match-limit))) 
    647645        (if (= 0 (length (match-string 0))) 
    648           (error "Empty regular expression!")) 
    649         (let ((i 0)) 
     646            (error "Empty regular expression!")) 
     647        (let ((i 0) 
     648              suffix max-suffix) 
    650649          (setq matches (1+ matches)) 
    651650          (while (<= i subexps) 
     
    654653                (let ((overlay (make-overlay (match-beginning i) 
    655654                                             (match-end i))) 
    656                       (face-name (format "reb-match-%d" i))) 
    657                   (if (not firstmatch) 
    658                       (setq firstmatch (match-data))) 
     655                      ;; When we have exceeded the number of provided faces, 
     656                      ;; cycle thru them where `max-suffix' denotes the maximum 
     657                      ;; suffix for `reb-match-*' that has been defined and 
     658                      ;; `suffix' the suffix calculated for the current match. 
     659                      (face 
     660                       (cond 
     661                        (max-suffix 
     662                         (if (= suffix max-suffix) 
     663                             (setq suffix 1) 
     664                           (setq suffix (1+ suffix))) 
     665                         (intern-soft (format "reb-match-%d" suffix))) 
     666                        ((intern-soft (format "reb-match-%d" i))) 
     667                        ((setq max-suffix (1- i)) 
     668                         (setq suffix 1) 
     669                         ;; `reb-match-1' must exist. 
     670                         'reb-match-1)))) 
     671                  (unless firstmatch (setq firstmatch (match-data))) 
    659672                  (setq reb-overlays (cons overlay reb-overlays) 
    660673                        submatches (1+ submatches)) 
    661                   (overlay-put 
    662                    overlay 'face 
    663                    (or (intern-soft face-name) 
    664                        (error "Too many subexpressions - face `%s' not defined" 
    665                               face-name ))) 
     674                  (overlay-put overlay 'face face) 
    666675                  (overlay-put overlay 'priority i))) 
    667676            (setq i (1+ i))))))