      (selected-window) 
      (get-buffer-create (format "*rdebug-breakpoints-%s*" script-name)))
     (other-window 1)
-    (goto-char (point-max)))))
+    (goto-char (point-max))
+    (rdebug-set-window-configuration-state 'debugger))))
   
 (defun rdebug-restore-windows ()
   "Equivalent of `gdb-restore-windows' for rdebug."

            (goto-char (point-max))
            ;; 32 = space.
            (insert (make-string (* 4 rdebug-debug-depth) 32))
            (insert (apply #'format args)))))))


(defmacro rdebug-debug-enter (str &rest body)
  (declare (indent 1) (debug t))
  `(progn
     (rdebug-debug-message "--> %s\n" ,str)
     (setq rdebug-debug-depth (+ rdebug-debug-depth 1))
     (unwind-protect
         (progn
           ,@body)
       (setq rdebug-debug-depth (max 0 (- rdebug-debug-depth 1)))
       (rdebug-debug-message "<-- %s\n" ,str))))


;; Interface to gud.

						sep)))))))
)


;; Set the window configuration state (and make sure we log this).
(defun rdebug-set-window-configuration-state (state)
  (rdebug-debug-message "Setting state to %s (was %s)"
                        state rdebug-window-configuration-state)
  (setq rdebug-window-configuration-state state))


;;;###autoload
(defun rdebug (command-line)
  "Run rdebug on program FILE in buffer *rdebug-cmd-FILE*.
