 
 
 (defun rdebug-restore-windows ()
-  "Equivalent of `gdb-restore-windows' for rdebug."
+  "Display the initial ruby debugger window layout."
   (interactive)
   (when rdebug-many-windows
     (rdebug-setup-windows)))


(defvar rdebug-original-window-configuration nil
  "The window layout rdebug should restore when the debugger exits.")

;; This is used to ensure that the original frame configuration is
;; restored even when the user re-starts the debugger several times.



;; Set the window configuration state (and make sure we log this).
(defun rdebug-set-window-configuration-state (state &optional dont-restore)
  (rdebug-debug-message "Setting state to %s (was %s)"
                        state rdebug-window-configuration-state)
  (when (not (eq state rdebug-window-configuration-state))
    ;; Save the previous state.
    (cond ((eq rdebug-window-configuration-state 'debugger)
           (setq rdebug-debugger-window-configuration
                 (current-window-configuration)))
          ((eq rdebug-window-configuration-state 'original)
           (setq rdebug-original-window-configuration
                 (current-window-configuration))))
    (unless dont-restore
      ;; Switch to the saved state,
      (cond
       ((eq state 'debugger)
        (if rdebug-debugger-window-configuration
            (set-window-configuration rdebug-debugger-window-configuration)))
       ((eq state 'original)
        (if rdebug-original-window-configuration
            (set-window-configuration rdebug-original-window-configuration)))))
    (setq rdebug-window-configuration-state state)))


;; -- Common key support.
