comparison lisp/emacs-lisp/re-builder.el @ 90203:187d6a1f84f7

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-71 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 485-492) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 92-94) - Merge from emacs--cvs-trunk--0 - Update from CVS
author Miles Bader <miles@gnu.org>
date Fri, 22 Jul 2005 08:27:27 +0000
parents f9a65d7ebd29 c68bf82df188
children 890cc78a5a24
comparison
equal deleted inserted replaced
90202:7597b4a23c3b 90203:187d6a1f84f7
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
329 "Return binding for SYMBOL in the RE Builder target buffer." 330 "Return binding for SYMBOL in the RE Builder target buffer."
330 `(with-current-buffer reb-target-buffer ,symbol)) 331 `(with-current-buffer reb-target-buffer ,symbol))
331 332
332 ;;; This is to help people find this in Apropos. 333 ;;; This is to help people find this in Apropos.
333 ;;;###autoload 334 ;;;###autoload
334 (defun regexp-builder () 335 (defalias 'regexp-builder 're-builder)
335 "Alias for `re-builder': Construct a regexp interactively."
336 (interactive)
337 (re-builder))
338 336
339 ;;;###autoload 337 ;;;###autoload
340 (defun re-builder () 338 (defun re-builder ()
341 "Construct a regexp interactively." 339 "Construct a regexp interactively."
342 (interactive) 340 (interactive)
608 (reb-empty-regexp))))))) 606 (reb-empty-regexp)))))))
609 607
610 (defun reb-cook-regexp (re) 608 (defun reb-cook-regexp (re)
611 "Return RE after processing it according to `reb-re-syntax'." 609 "Return RE after processing it according to `reb-re-syntax'."
612 (cond ((eq reb-re-syntax 'lisp-re) 610 (cond ((eq reb-re-syntax 'lisp-re)
613 (lre-compile-string (eval (car (read-from-string re))))) 611 (if (fboundp 'lre-compile-string)
612 (lre-compile-string (eval (car (read-from-string re))))))
614 ((eq reb-re-syntax 'sregex) 613 ((eq reb-re-syntax 'sregex)
615 (apply 'sregex (eval (car (read-from-string re))))) 614 (apply 'sregex (eval (car (read-from-string re)))))
616 ((eq reb-re-syntax 'rx) 615 ((eq reb-re-syntax 'rx)
617 (rx-to-string (eval (car (read-from-string re))))) 616 (rx-to-string (eval (car (read-from-string re)))))
618 (t re))) 617 (t re)))