Skip to content
This repository

fix "--colors=<color>" option in py-python-command-args. #766

Closed
wants to merge 1 commit into from

1 participant

Kefu Chai
Kefu Chai

fix "--colors=" option in py-python-command-args. otherwise ipython fails to launch with "-i --colors LightBG" arguments.

Kefu Chai fix "--colors=<color>" option in py-python-command-args. otherwise ip…
…ython fails to launch with "-i --colors LightBG" arguments.
1ce6212
Kefu Chai

thanks, i will be reusing PR #764 for this fix.

Kefu Chai tchaikov closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Sep 07, 2011
Kefu Chai fix "--colors=<color>" option in py-python-command-args. otherwise ip…
…ython fails to launch with "-i --colors LightBG" arguments.
1ce6212
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 13 additions and 12 deletions. Show diff stats Hide diff stats

  1. 25  docs/emacs/ipython.el
25  docs/emacs/ipython.el
@@ -36,7 +36,7 @@
36 36
 ;; always in ``pylab`` mode with hardcoded light-background colors, you can
37 37
 ;; use::
38 38
 ;;
39  
-;; (setq py-python-command-args '("-pylab" "--colors" "LightBG"))
  39
+;; (setq py-python-command-args '("-pylab" "--colors=LightBG"))
40 40
 ;;
41 41
 ;;
42 42
 ;; NOTE: This mode is currently somewhat alpha and although I hope that it
@@ -217,17 +217,18 @@ the second for a 'normal' command, and the third for a multiline command.")
217 217
     (setq py-shell-input-prompt-1-regexp "^In \\[[0-9]+\\]: *"
218 218
           py-shell-input-prompt-2-regexp "^   [.][.][.]+: *" )
219 219
     ;; select a suitable color-scheme
220  
-    (unless (member "--colors" py-python-command-args)
221  
-      (setq py-python-command-args
222  
-            (nconc py-python-command-args
223  
-                   (list "--colors"
224  
-                         (cond
225  
-                           ((eq frame-background-mode 'dark)
226  
-                            "Linux")
227  
-                           ((eq frame-background-mode 'light)
228  
-                            "LightBG")
229  
-                           (t ; default (backg-mode isn't always set by XEmacs)
230  
-                            "LightBG"))))))
  220
+    (unless (delq nil
  221
+                  (mapcar (lambda (x) (eq (string-match "^--colors=*" x) 0))
  222
+                          py-python-command-args))
  223
+      (push (format "--colors=%s"
  224
+            (cond
  225
+             ((eq frame-background-mode 'dark)
  226
+              "Linux")
  227
+             ((eq frame-background-mode 'light)
  228
+              "LightBG")
  229
+             (t ; default (backg-mode isn't always set by XEmacs)
  230
+              "LightBG")))
  231
+        py-python-command-args))
231 232
     (unless (equal ipython-backup-of-py-python-command py-python-command)
232 233
       (setq ipython-backup-of-py-python-command py-python-command))
233 234
     (setq py-python-command ipython-command))
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.