   (message
    "Type `M-x rdebug-display-original-window-configuration RET' to restore."))
 
-(defun rdebug-set-windows (&optional name)
-  "Rename the processor buffer to correspond to script name NAME.
-
-When `rdebug-many-windows' is non-nil, the initial debugger
-window layout is used."
-  (interactive "sProgram name: ")
-  (when name
-    (setq gud-target-name name)
-    (setq gud-comint-buffer (current-buffer)))
-  (when gud-last-frame
-    (setq gud-last-last-frame gud-last-frame))
-  (rename-buffer (format "*rdebug-cmd-%s*" gud-target-name))
-  (when rdebug-many-windows
-    (rdebug-setup-windows)))
 
 ;; Fontification and keymaps for secondary buffers (breakpoints, stack)
 

  "Populate the Rdebug 'Debugger' menu."
  (let ((menu (make-sparse-keymap))
        (common-map (make-sparse-keymap)))
    ;; Use a simple common map to find the best key sequence to display in menu.
    (rdebug-populate-common-keys common-map)

    (define-key map [menu-bar debugger] (cons "Debugger" menu))

    (define-key menu [break-delete]
      (rdebug-menu-item common-map "Delete breakpoint" 'gud-remove))

    (define-key menu [break]
      (rdebug-menu-item common-map "Set breakpoint" 'gud-break))

    (define-key menu [finish] (rdebug-menu-item common-map "Step out" 'gud-finish))
    (define-key menu [step]   (rdebug-menu-item common-map "Step into" 'gud-step))
    (define-key menu [next]   (rdebug-menu-item common-map "Step over" 'gud-next))
    (define-key menu [cont]   (rdebug-menu-item common-map "Continue" 'gud-cont))
    (define-key menu [start]
      (rdebug-menu-item common-map "Start the debugger" 'rdebug))

    (define-key menu [placeholder] nil)

    ;; --------------------


      (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist)
              rdebug-debugger-support-minor-mode-map-when-active)
      (when rdebug-many-windows
        (rdebug-setup-windows-initially))

      (run-hooks 'rdebug-mode-hook))))


(defun rdebug-set-windows (&optional name)
  "Rename the processor buffer to correspond to script name NAME.

When `rdebug-many-windows' is non-nil, the initial debugger
window layout is used."
  (interactive "sProgram name: ")
  (rdebug-debug-enter "rdebug-set-windows"
    (rdebug-set-window-configuration-state 'debugger t)
    (rdebug-common-initialization)
    (when name
      (setq gud-target-name name)
      (setq gud-comint-buffer (current-buffer)))
    (when gud-last-frame
      (setq gud-last-last-frame gud-last-frame))
    (rename-buffer (format "*rdebug-cmd-%s*" gud-target-name))

    (setcdr (assq 'rdebug-debugger-support-minor-mode minor-mode-map-alist)
            rdebug-debugger-support-minor-mode-map-when-active)
    (when rdebug-many-windows
      (rdebug-setup-windows))))


(defun rdebug-quit ()
