emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110771: * progmodes/python.el (in


From: Fabián Ezequiel Gallina
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r110771: * progmodes/python.el (inferior-python-mode): Fix hang in
Date: Sat, 03 Nov 2012 09:20:02 -0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110771
fixes bug: http://debbugs.gnu.org/12645
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: emacs-24
timestamp: Sat 2012-11-03 09:20:02 -0300
message:
  * progmodes/python.el (inferior-python-mode): Fix hang in
  jit-lock.
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-11-03 10:47:03 +0000
+++ b/lisp/ChangeLog    2012-11-03 12:20:02 +0000
@@ -1,3 +1,8 @@
+2012-11-03  Fabián Ezequiel Gallina  <address@hidden>
+
+       * progmodes/python.el (inferior-python-mode): Fix hang in
+       jit-lock (Bug#12645).
+
 2012-11-03  Martin Rudalics  <address@hidden>
 
        * window.el (switch-to-visible-buffer)

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-10-12 00:07:25 +0000
+++ b/lisp/progmodes/python.el  2012-11-03 12:20:02 +0000
@@ -1733,17 +1733,24 @@
     (set (make-local-variable 'font-lock-defaults)
          '(python-font-lock-keywords nil nil nil nil))
     (set (make-local-variable 'syntax-propertize-function)
-         (syntax-propertize-rules
-          (comint-prompt-regexp
-           (0 (ignore
-               (put-text-property
-                comint-last-input-start end 'syntax-table
-                python-shell-output-syntax-table)
-               (font-lock-unfontify-region comint-last-input-start end))))
-          ((python-rx string-delimiter)
-           (0 (ignore
-               (and (not (eq (get-text-property start 'field) 'output))
-                    (python-syntax-stringify))))))))
+         (eval
+          ;; XXX: Unfortunately eval is needed here to make use of the
+          ;; dynamic value of `comint-prompt-regexp'.
+          `(syntax-propertize-rules
+            (,comint-prompt-regexp
+             (0 (ignore
+                 (put-text-property
+                  comint-last-input-start end 'syntax-table
+                  python-shell-output-syntax-table)
+                 ;; XXX: This might look weird, but it is the easiest
+                 ;; way to ensure font lock gets cleaned up before the
+                 ;; current prompt, which is needed for unclosed
+                 ;; strings to not mess up with current input.
+                 (font-lock-unfontify-region comint-last-input-start end))))
+            (,(python-rx string-delimiter)
+             (0 (ignore
+                 (and (not (eq (get-text-property start 'field) 'output))
+                      (python-syntax-stringify)))))))))
   (compilation-shell-minor-mode 1))
 
 (defun python-shell-make-comint (cmd proc-name &optional pop internal)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]