 ;; always in ``pylab`` mode with hardcoded light-background colors, you can
 ;; use::
 ;;
-;; (setq py-python-command-args '("--pylab" "--colors=LightBG"))
+;; (setq-default py-python-command-args '("--pylab" "--colors=LightBG"))
 ;;
 ;;
 ;; NOTE: This mode is currently somewhat alpha and although I hope that it

;; can be used to convert bits of a ipython session into something that can be
;; used for doctests. To install, put this file somewhere in your emacs
;; `load-path' [1] and add the following line to your ~/.emacs file (the first
;; line only needed if the default (``"ipython"``) is wrong)::
;;
;;   (setq ipython-command "/SOME-PATH/ipython")
;;   (require '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)))
