diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b168b62c291..634c297957d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -2600,18 +2600,19 @@ goes wrong and syntax highlighting in the shell gets messed up." | |||
| 2600 | 2600 | ||
| 2601 | (defun python-shell-font-lock-comint-output-filter-function (output) | 2601 | (defun python-shell-font-lock-comint-output-filter-function (output) |
| 2602 | "Clean up the font-lock buffer after any OUTPUT." | 2602 | "Clean up the font-lock buffer after any OUTPUT." |
| 2603 | (if (let ((output (ansi-color-filter-apply output))) | 2603 | (unless (string= output "") ;; See Bug#33959. |
| 2604 | (and (python-shell-comint-end-of-output-p output) | 2604 | (if (let ((output (ansi-color-filter-apply output))) |
| 2605 | ;; Assume "..." represents a continuation prompt. | 2605 | (and (python-shell-comint-end-of-output-p output) |
| 2606 | (not (string-match "\\.\\.\\." output)))) | 2606 | ;; Assume "..." represents a continuation prompt. |
| 2607 | ;; If output ends with an initial (not continuation) input prompt | 2607 | (not (string-match "\\.\\.\\." output)))) |
| 2608 | ;; then the font-lock buffer must be cleaned up. | 2608 | ;; If output ends with an initial (not continuation) input prompt |
| 2609 | (python-shell-font-lock-cleanup-buffer) | 2609 | ;; then the font-lock buffer must be cleaned up. |
| 2610 | ;; Otherwise just add a newline. | 2610 | (python-shell-font-lock-cleanup-buffer) |
| 2611 | (python-shell-font-lock-with-font-lock-buffer | 2611 | ;; Otherwise just add a newline. |
| 2612 | (goto-char (point-max)) | 2612 | (python-shell-font-lock-with-font-lock-buffer |
| 2613 | (newline))) | 2613 | (goto-char (point-max)) |
| 2614 | output) | 2614 | (newline))) |
| 2615 | output)) | ||
| 2615 | 2616 | ||
| 2616 | (defun python-shell-font-lock-post-command-hook () | 2617 | (defun python-shell-font-lock-post-command-hook () |
| 2617 | "Fontifies current line in shell buffer." | 2618 | "Fontifies current line in shell buffer." |