changeset 100018:811c2c99eed5

* emacs-lisp/re-builder.el (reb-auto-update): Remove redundant code. (re-builder): Reuse window displaying the *RE-Builder* buffer, if any. (reb-initialize-buffer): Update matches, in case we're reentering RE Builder mode.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 28 Nov 2008 23:54:23 +0000
parents 545b78accbad
children b25e28d70fad
files lisp/ChangeLog lisp/emacs-lisp/re-builder.el
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 28 22:39:06 2008 +0000
+++ b/lisp/ChangeLog	Fri Nov 28 23:54:23 2008 +0000
@@ -1,3 +1,10 @@
+2008-11-28  Juanma Barranquero  <lekktu@gmail.com>
+
+	* emacs-lisp/re-builder.el (reb-auto-update): Remove redundant code.
+	(re-builder): Reuse window displaying the *RE-Builder* buffer, if any.
+	(reb-initialize-buffer): Update matches, in case we're reentering
+	RE Builder mode.
+
 2008-11-28  Chong Yidong  <cyd@stupidchicken.com>
 
 	* complete.el (PC-do-complete-and-exit): Synch to 2008-11-24
--- a/lisp/emacs-lisp/re-builder.el	Fri Nov 28 22:39:06 2008 +0000
+++ b/lisp/emacs-lisp/re-builder.el	Fri Nov 28 23:54:23 2008 +0000
@@ -349,7 +349,8 @@
   (goto-char (+ 2 (point-min)))
   (cond ((reb-lisp-syntax-p)
          (reb-lisp-mode))
-        (t (reb-mode))))
+        (t (reb-mode)))
+  (reb-do-update))
 
 (defun reb-mode-buffer-p ()
   "Return non-nil if the current buffer is a RE Builder buffer."
@@ -370,9 +371,11 @@
     (when reb-target-buffer
       (reb-delete-overlays))
     (setq reb-target-buffer (current-buffer)
-          reb-target-window (selected-window)
-          reb-window-config (current-window-configuration))
-    (select-window (split-window (selected-window) (- (window-height) 4)))
+          reb-target-window (selected-window))
+    (select-window (or (get-buffer-window reb-buffer)
+		       (progn
+			 (setq reb-window-config (current-window-configuration))
+			 (split-window (selected-window) (- (window-height) 4)))))
     (switch-to-buffer (get-buffer-create reb-buffer))
     (reb-initialize-buffer)))
 
@@ -524,7 +527,6 @@
 	 (condition-case nil
 	     (progn
 	       (when (or (reb-update-regexp) force)
-		 (reb-assert-buffer-in-window)
 		 (reb-do-update))
 	       "")
 	   (error " *invalid*"))))