comparison lisp/emacs-lisp/re-builder.el @ 64382:c16c027014c6

(reb-cook-regexp): Avoid warning calling lre-compile-string. (reb-color-display-p): Avoid warning.
author Richard M. Stallman <rms@gnu.org>
date Sat, 16 Jul 2005 17:35:09 +0000
parents 18a818a2ee7c
children c68bf82df188
comparison
equal deleted inserted replaced
64381:c25db06be8ca 64382:c16c027014c6
317 "Return t if display is capable of displaying colors." 317 "Return t if display is capable of displaying colors."
318 (eq 'color 318 (eq 'color
319 ;; emacs/xemacs compatibility 319 ;; emacs/xemacs compatibility
320 (if (fboundp 'frame-parameter) 320 (if (fboundp 'frame-parameter)
321 (frame-parameter (selected-frame) 'display-type) 321 (frame-parameter (selected-frame) 'display-type)
322 (frame-property (selected-frame) 'display-type)))) 322 (if (fboundp 'frame-property)
323 (frame-property (selected-frame) 'display-type)))))
323 324
324 (defsubst reb-lisp-syntax-p () 325 (defsubst reb-lisp-syntax-p ()
325 "Return non-nil if RE Builder uses a Lisp syntax." 326 "Return non-nil if RE Builder uses a Lisp syntax."
326 (memq reb-re-syntax '(lisp-re sregex rx))) 327 (memq reb-re-syntax '(lisp-re sregex rx)))
327 328
608 (reb-empty-regexp))))))) 609 (reb-empty-regexp)))))))
609 610
610 (defun reb-cook-regexp (re) 611 (defun reb-cook-regexp (re)
611 "Return RE after processing it according to `reb-re-syntax'." 612 "Return RE after processing it according to `reb-re-syntax'."
612 (cond ((eq reb-re-syntax 'lisp-re) 613 (cond ((eq reb-re-syntax 'lisp-re)
613 (lre-compile-string (eval (car (read-from-string re))))) 614 (if (fboundp 'lre-compile-string)
615 (lre-compile-string (eval (car (read-from-string re))))))
614 ((eq reb-re-syntax 'sregex) 616 ((eq reb-re-syntax 'sregex)
615 (apply 'sregex (eval (car (read-from-string re))))) 617 (apply 'sregex (eval (car (read-from-string re)))))
616 ((eq reb-re-syntax 'rx) 618 ((eq reb-re-syntax 'rx)
617 (rx-to-string (eval (car (read-from-string re))))) 619 (rx-to-string (eval (car (read-from-string re)))))
618 (t re))) 620 (t re)))