aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2012-11-03 09:20:02 -0300
committerFabián Ezequiel Gallina2012-11-03 09:20:02 -0300
commit12fd5ee1ae617b212e4d00e2ed4c196d3656f615 (patch)
tree4e1477e30f663c119c6241db4d24fcd18b2e4fcf /lisp/progmodes/python.el
parentad10696b8922e6b876fcd94f732c37136711f920 (diff)
downloademacs-12fd5ee1ae617b212e4d00e2ed4c196d3656f615.tar.gz
emacs-12fd5ee1ae617b212e4d00e2ed4c196d3656f615.zip
* progmodes/python.el (inferior-python-mode): Fix hang in
jit-lock. Fixes: debbugs:12645
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el29
1 files changed, 18 insertions, 11 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index ff805d64024..ee98feaef5e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1733,17 +1733,24 @@ variable.
1733 (set (make-local-variable 'font-lock-defaults) 1733 (set (make-local-variable 'font-lock-defaults)
1734 '(python-font-lock-keywords nil nil nil nil)) 1734 '(python-font-lock-keywords nil nil nil nil))
1735 (set (make-local-variable 'syntax-propertize-function) 1735 (set (make-local-variable 'syntax-propertize-function)
1736 (syntax-propertize-rules 1736 (eval
1737 (comint-prompt-regexp 1737 ;; XXX: Unfortunately eval is needed here to make use of the
1738 (0 (ignore 1738 ;; dynamic value of `comint-prompt-regexp'.
1739 (put-text-property 1739 `(syntax-propertize-rules
1740 comint-last-input-start end 'syntax-table 1740 (,comint-prompt-regexp
1741 python-shell-output-syntax-table) 1741 (0 (ignore
1742 (font-lock-unfontify-region comint-last-input-start end)))) 1742 (put-text-property
1743 ((python-rx string-delimiter) 1743 comint-last-input-start end 'syntax-table
1744 (0 (ignore 1744 python-shell-output-syntax-table)
1745 (and (not (eq (get-text-property start 'field) 'output)) 1745 ;; XXX: This might look weird, but it is the easiest
1746 (python-syntax-stringify)))))))) 1746 ;; way to ensure font lock gets cleaned up before the
1747 ;; current prompt, which is needed for unclosed
1748 ;; strings to not mess up with current input.
1749 (font-lock-unfontify-region comint-last-input-start end))))
1750 (,(python-rx string-delimiter)
1751 (0 (ignore
1752 (and (not (eq (get-text-property start 'field) 'output))
1753 (python-syntax-stringify)))))))))
1747 (compilation-shell-minor-mode 1)) 1754 (compilation-shell-minor-mode 1))
1748 1755
1749(defun python-shell-make-comint (cmd proc-name &optional pop internal) 1756(defun python-shell-make-comint (cmd proc-name &optional pop internal)