   :group 'python
   :tag "Pychecker Command Args")
 
+(defvar py-shell-alist
+  '(("jpython" . 'jpython)
+    ("jython" . 'jpython)
+    ("python" . 'cpython))
+  "*Alist of interpreters and python shells. Used by `py-choose-shell'
+to select the appropriate python interpreter mode for a file.")
 
  

				    (point-max) 'move))))
    (nreverse index-alist)))


;;;###autoload

      ))
  ;; Set the default shell if not already set
  (when (null py-which-shell)
    (py-toggle-shells (py-choose-shell))))


(defun jpython-mode ()
  "Major mode for editing JPython/Jython files.
This is a simple wrapper around `python-mode'.
It runs `jpython-mode-hook' then calls `python-mode.'
It is added to `interpreter-mode-alist' and `py-choose-shell'.
"
  (interactive)
  (python-mode)
  (py-toggle-shells 'jpython)
  (when jpython-mode-hook
      (run-hooks 'jpython-mode-hook)))


;; It's handy to add recognition of Python files to the
;; interpreter-mode-alist and to auto-mode-alist.  With the former, we
;; can specify different `derived-modes' based on the #! line, but
;; with the latter, we can't.  So we just won't add them if they're
;; already added.
(let ((modes '(("jpython" . jpython-mode)
	       ("jython" . jpython-mode)
	       ("python" . python-mode))))
  (while modes
    (when (not (assoc (car modes) interpreter-mode-alist))
      (push modes interpreter-mode-alist))
    (setq modes (cdr modes))))

(when (not (or (rassq 'python-mode auto-mode-alist)
	       (rassq 'jpython-mode auto-mode-alist)))
  (push '("\\.py$" . python-mode) auto-mode-alist))



