* progmodes/python.el (python-shell-output-filter): Handle extra
authorFabián Ezequiel Gallina <fgallina@gnu.org>
Mon, 8 Oct 2012 21:51:02 +0000 (18:51 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Mon, 8 Oct 2012 21:51:02 +0000 (18:51 -0300)
carriage return in OSX.

Fixes: debbugs:12409

lisp/ChangeLog
lisp/progmodes/python.el

index 1d7d2af..d3275ce 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-08  Fabián Ezequiel Gallina  <fgallina@cuca>
+
+       * progmodes/python.el (python-shell-output-filter): Handle extra
+       carriage return in OSX (Bug#12409).
+
 2012-10-08  Fabián Ezequiel Gallina  <fgallina@cuca>
 
        Fix shell handling of unbalanced quotes and parens in output.
index d35dbc6..018d6a7 100644 (file)
@@ -1866,7 +1866,9 @@ detecting a prompt at the end of the buffer."
    python-shell-output-filter-buffer
    (concat python-shell-output-filter-buffer string))
   (when (string-match
-         (format "\n\\(?:%s\\|%s\\|%s\\)$"
+         ;; XXX: It seems on OSX an extra carriage return is attached
+         ;; at the end of output, this handles that too.
+         (format "\r?\n\\(?:%s\\|%s\\|%s\\)$"
                  python-shell-prompt-regexp
                  python-shell-prompt-block-regexp
                  python-shell-prompt-pdb-regexp)