]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/re-builder.el
Update copyright year to 2015
[gnu-emacs] / lisp / emacs-lisp / re-builder.el
index 50a65eb6bbb55531eb2543fb458d2746653b84a8..a499b038b9327b6ef3ea83c8865e5019368c4024 100644 (file)
@@ -1,6 +1,6 @@
 ;;; re-builder.el --- building Regexps with visual feedback -*- lexical-binding: t -*-
 
-;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2015 Free Software Foundation, Inc.
 
 ;; Author: Detlev Zundel <dzu@gnu.org>
 ;; Keywords: matching, lisp, tools
@@ -38,7 +38,7 @@
 ;; the target buffer are marked automatically with colored overlays
 ;; (for non-color displays see below) giving you feedback over the
 ;; extents of the matched (sub) expressions.  The (non-)validity is
-;; shown only in the modeline without throwing the errors at you.  If
+;; shown only in the mode line without throwing the errors at you.  If
 ;; you want to know the reason why RE Builder considers it as invalid
 ;; call `reb-force-update' ("\C-c\C-u") which should reveal the error.
 
@@ -319,7 +319,7 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
   (eq 'color
       ;; emacs/xemacs compatibility
       (if (fboundp 'frame-parameter)
-         (frame-parameter (selected-frame) 'display-type)
+         (frame-parameter nil 'display-type)
        (if (fboundp 'frame-property)
            (frame-property (selected-frame) 'display-type)))))
 
@@ -351,9 +351,14 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
 
 ;;;###autoload
 (defun re-builder ()
-  "Construct a regexp interactively."
-  (interactive)
+  "Construct a regexp interactively.
+This command makes the current buffer the \"target\" buffer of
+the regexp builder.  It displays a buffer named \"*RE-Builder*\"
+in another window, initially containing an empty regexp.
 
+As you edit the regexp in the \"*RE-Builder*\" buffer, the
+matching parts of the target buffer will be highlighted."
+  (interactive)
   (if (and (string= (buffer-name) reb-buffer)
           (reb-mode-buffer-p))
       (message "Already in the RE Builder")
@@ -709,8 +714,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
       (remove-hook 'after-change-functions 'reb-auto-update t)
       (remove-hook 'kill-buffer-hook 'reb-kill-buffer t)
       (when (reb-mode-buffer-p)
-       (reb-delete-overlays)
-       (funcall (or (default-value 'major-mode) 'fundamental-mode)))))
+       (reb-delete-overlays))))
   ;; continue standard unloading
   nil)