 			       ))))
     (switch-to-buffer ;; -other-window
      (apply 'make-comint py-which-bufname pyd-which-shell nil args))
+    (make-local-variable 'comint-prompt-regexp)
+    (setq comint-prompt-regexp "^>>> \\|^[.][.][.] \\|^(pdb) ")
+    (add-hook 'comint-output-filter-functions
+	      'py-comint-output-filter-function)
+    (set-syntax-table py-mode-syntax-table)
+    (use-local-map py-shell-map)
+    ))
+
+(defun pyo-shell (&optional argprompt)
+  "This is Jesse's hacked version of py-shell which runs the debug python"
+  (interactive "P")
+  ;; Set the default shell if not already set
+  (when (null pyo-which-shell)
+    (py-toggle-shells py-default-interpreter))
+  (let ((args pyo-which-args))
+    (when (and argprompt
+	       (interactive-p)
+	       (fboundp 'split-string))
+      ;; TBD: Perhaps force "-i" in the final list?
+      (setq args (split-string
+		  (read-string (concat py-which-bufname
+				       " arguments: ")
+			       (concat
+				(mapconcat 'identity py-which-args " ") " ")
+			       ))))
+    (switch-to-buffer ;; -other-window
+     (apply 'make-comint py-which-bufname pyo-which-shell nil args))
     (make-local-variable 'comint-prompt-regexp)
     (setq comint-prompt-regexp "^>>> \\|^[.][.][.] \\|^(pdb) ")
     (add-hook 'comint-output-filter-functions

      (setq py-which-shell py-jpython-command
	    ppy-which-shell ppy-jpython-command
	    pyd-which-shell pyd-python-command
	    py-which-args py-jpython-command-args
	    py-which-bufname "JPython"
	    msg "JPython"

(defvar py-which-shell nil)
(defvar ppy-which-shell nil)
(defvar pyd-which-shell nil)
(defvar pyo-which-shell nil)
(defvar py-which-args  py-python-command-args)
(defvar ppy-which-args  ppy-python-command-args)
(defvar pyd-which-args  pyd-python-command-args)
(defvar pyo-which-args  pyo-python-command-args)
(defvar py-which-bufname "Python")
(make-variable-buffer-local 'py-which-shell)
(make-variable-buffer-local 'ppy-which-shell)
(make-variable-buffer-local 'pyd-which-shell)
(make-variable-buffer-local 'pyo-which-shell)
(make-variable-buffer-local 'py-which-args)
(make-variable-buffer-local 'ppy-which-args)
(make-variable-buffer-local 'pyd-which-args)
(make-variable-buffer-local 'pyo-which-args)
(make-variable-buffer-local 'py-which-bufname)
(make-variable-buffer-local 'ppy-which-bufname)
(make-variable-buffer-local 'pyd-which-bufname)
(make-variable-buffer-local 'pyo-which-bufname)

(defun py-toggle-shells (arg)
  "Toggles between the CPython and JPython shells.
