+2001-11-20 Juanma Barranquero <lektu@terra.es>
+
+ * emacs-lisp/re-builder.el (reb-change-target-buffer): New
+ function.
+ (top-level): Bind it to C-c C-b.
+ (re-builder): Don't re-enter RE Builder Mode.
+
+ * bs.el (bs-delete): Signal an error if the buffer cannot be
+ deleted.
+
2001-11-20 Stefan Monnier <monnier@rum.cs.yale.edu>
* emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Don't move back
"Call up the RE Builder for the current window."
(interactive)
- (if 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)))
- (switch-to-buffer (get-buffer-create reb-buffer))
- (erase-buffer)
- (reb-insert-regexp)
- (goto-char (+ 2 (point-min)))
- (cond
- ((reb-lisp-syntax-p)
- (reb-lisp-mode))
- (t (reb-mode))))
+ (if (and (string= (buffer-name) reb-buffer)
+ (memq major-mode '(reb-mode reb-lisp-mode)))
+ (message "Already in the RE Builder")
+ (if 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)))
+ (switch-to-buffer (get-buffer-create reb-buffer))
+ (erase-buffer)
+ (reb-insert-regexp)
+ (goto-char (+ 2 (point-min)))
+ (cond
+ ((reb-lisp-syntax-p)
+ (reb-lisp-mode))
+ (t (reb-mode)))))
(defun reb-change-target-buffer (buf)
"Change the target buffer and display it in the target window."