 (if (not (executable-find ipython-command))
     (message (format "Can't find executable %s - ipython.el *NOT* activated!!!"
                      ipython-command))
-    ;; XXX load python-mode, so that we can screw around with its variables
-    ;; this has the disadvantage that python-mode is loaded even if no
-    ;; python-file is ever edited etc. but it means that `py-shell' works
-    ;; without loading a python-file first. Obviously screwing around with
-    ;; python-mode's variables like this is a mess, but well.
-    (require 'python-mode)
+    ;; change the default value of py-shell-name to ipython
+    (setq-default py-shell-name ipython-command)
     ;; turn on ansi colors for ipython and activate completion
     (defun ipython-shell-hook ()
       ;; the following is to synchronize dir-changes

(require 'shell)
(require 'executable)
(require 'ansi-color)

(defcustom ipython-command "ipython"
  "*Shell command used to start ipython."

    (unless (delq nil
                  (mapcar (lambda (x) (eq (string-match "^--colors=*" x) 0))
                          py-python-command-args))
      (setq-default py-python-command-args
		    (cons (format "--colors=%s"
				  (cond
				   ((eq frame-background-mode 'dark)
				    "Linux")
				   ((eq frame-background-mode 'light)
				    "LightBG")
				   (t ; default (backg-mode isn't always set by XEmacs)
				    "LightBG")))
			  py-python-command-args)))
    (when (boundp 'py-python-command)
      (unless (equal ipython-backup-of-py-python-command py-python-command)
        (setq ipython-backup-of-py-python-command py-python-command)))
