summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2008-11-28 23:54:23 +0000
committerJuanma Barranquero <lekktu@gmail.com>2008-11-28 23:54:23 +0000
commit2644eb3f38fb7ded679999f42dc867a98db42e91 (patch)
tree2c8cd2ea739865d19509afe3ee3b5bebe7daebe2 /lisp/emacs-lisp
parent3c00847f067d4e69ca7494f487ad91f4a5700252 (diff)
downloademacs-2644eb3f38fb7ded679999f42dc867a98db42e91.tar.gz
* 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.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/re-builder.el12
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index a0b20375414..63509ec5b0c 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -349,7 +349,8 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
(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 @@ Except for Lisp syntax this is the same as `reb-regexp'.")
(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 @@ optional fourth argument FORCE is non-nil."
(condition-case nil
(progn
(when (or (reb-update-regexp) force)
- (reb-assert-buffer-in-window)
(reb-do-update))
"")
(error " *invalid*"))))