]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/re-builder.el
Merge from trunk.
[gnu-emacs] / lisp / emacs-lisp / re-builder.el
index 59a30d62b021e3ae031b67b9d18b7e48dccdeb20..ebbd6ff1fdff84106724a3b8b22ff21038cf4137 100644 (file)
@@ -1,4 +1,4 @@
-;;; re-builder.el --- building Regexps with visual feedback
+;;; re-builder.el --- building Regexps with visual feedback -*- lexical-binding: t -*-
 
 ;; Copyright (C) 1999-2011 Free Software Foundation, Inc.
 
@@ -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")
@@ -506,7 +511,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions."
   (reb-update-regexp)
   (reb-update-overlays subexp))
 
-(defun reb-auto-update (beg end lenold &optional force)
+(defun reb-auto-update (_beg _end _lenold &optional force)
   "Called from `after-update-functions' to update the display.
 BEG, END and LENOLD are passed in from the hook.
 An actual update is only done if the regexp has changed or if the
@@ -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)