/[emacs]/emacs/lisp/emacs-lisp/re-builder.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/re-builder.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11.4.4 by miles, Sat Jul 17 02:49:47 2004 UTC revision 1.11.4.5 by miles, Sat Sep 4 09:21:45 2004 UTC
# Line 135  Can either be `read', `string', `sregex' Line 135  Can either be `read', `string', `sregex'
135                   (const :tag "String syntax" string)                   (const :tag "String syntax" string)
136                   (const :tag "`sregex' syntax" sregex)                   (const :tag "`sregex' syntax" sregex)
137                   (const :tag "`lisp-re' syntax" lisp-re)                   (const :tag "`lisp-re' syntax" lisp-re)
138                     (const :tag "`rx' syntax" rx)
139                   (value: string)))                   (value: string)))
140    
141  (defcustom reb-auto-match-limit 200  (defcustom reb-auto-match-limit 200
# Line 261  Except for Lisp syntax this is the same Line 262  Except for Lisp syntax this is the same
262    (cond ((eq reb-re-syntax 'lisp-re)    ; Pull in packages    (cond ((eq reb-re-syntax 'lisp-re)    ; Pull in packages
263           (require 'lisp-re))            ; as needed           (require 'lisp-re))            ; as needed
264          ((eq reb-re-syntax 'sregex)     ; sregex is not autoloaded          ((eq reb-re-syntax 'sregex)     ; sregex is not autoloaded
265           (require 'sregex)))            ; right now..           (require 'sregex))             ; right now..
266            ((eq reb-re-syntax 'rx)         ; rx-to-string is autoloaded
267             (require 'rx)))                ; require rx anyway
268    (reb-mode-common))    (reb-mode-common))
269    
270  ;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from  ;; Use the same "\C-c" keymap as `reb-mode' and use font-locking from
# Line 320  Except for Lisp syntax this is the same Line 323  Except for Lisp syntax this is the same
323    
324  (defsubst reb-lisp-syntax-p ()  (defsubst reb-lisp-syntax-p ()
325    "Return non-nil if RE Builder uses a Lisp syntax."    "Return non-nil if RE Builder uses a Lisp syntax."
326    (memq reb-re-syntax '(lisp-re sregex)))    (memq reb-re-syntax '(lisp-re sregex rx)))
327    
328  (defmacro reb-target-binding (symbol)  (defmacro reb-target-binding (symbol)
329    "Return binding for SYMBOL in the RE Builder target buffer."    "Return binding for SYMBOL in the RE Builder target buffer."
# Line 466  Optional argument SYNTAX must be specifi Line 469  Optional argument SYNTAX must be specifi
469     (list (intern     (list (intern
470            (completing-read "Select syntax: "            (completing-read "Select syntax: "
471                             (mapcar (lambda (el) (cons (symbol-name el) 1))                             (mapcar (lambda (el) (cons (symbol-name el) 1))
472                                     '(read string lisp-re sregex))                                     '(read string lisp-re sregex rx))
473                             nil t (symbol-name reb-re-syntax)))))                             nil t (symbol-name reb-re-syntax)))))
474    
475    (if (memq syntax '(read string lisp-re sregex))    (if (memq syntax '(read string lisp-re sregex rx))
476        (let ((buffer (get-buffer reb-buffer)))        (let ((buffer (get-buffer reb-buffer)))
477          (setq reb-re-syntax syntax)          (setq reb-re-syntax syntax)
478          (if buffer          (if buffer
# Line 604  optional fourth argument FORCE is non-ni Line 607  optional fourth argument FORCE is non-ni
607           (lre-compile-string (eval (car (read-from-string re)))))           (lre-compile-string (eval (car (read-from-string re)))))
608          ((eq reb-re-syntax 'sregex)          ((eq reb-re-syntax 'sregex)
609           (apply 'sregex (eval (car (read-from-string re)))))           (apply 'sregex (eval (car (read-from-string re)))))
610            ((eq reb-re-syntax 'rx)
611             (rx-to-string (eval (car (read-from-string re)))))
612          (t re)))          (t re)))
613    
614  (defun reb-update-regexp ()  (defun reb-update-regexp ()
# Line 670  If SUBEXP is non-nil mark only the corre Line 675  If SUBEXP is non-nil mark only the corre
675                    (overlay-put overlay 'priority i)))                    (overlay-put overlay 'priority i)))
676              (setq i (1+ i))))))              (setq i (1+ i))))))
677      (let ((count (if subexp submatches matches)))      (let ((count (if subexp submatches matches)))
678        (message"%s %smatch%s%s"        (message "%s %smatch%s%s"
679                 (if (= 0 count) "No" (int-to-string count))                 (if (= 0 count) "No" (int-to-string count))
680                 (if subexp "subexpression " "")                 (if subexp "subexpression " "")
681                 (if (= 1 count) "" "es")                 (if (= 1 count) "" "es")

Legend:
Removed from v.1.11.4.4  
changed lines
  Added in v.1.11.4.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26