diff options
| author | Stefan Monnier | 2013-08-26 22:41:41 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2013-08-26 22:41:41 -0400 |
| commit | 9e89d835b04c20a8cd3dfad452fa827d675b0938 (patch) | |
| tree | b074830bb65218bfa455ad3a5d3fb89936f6c239 /lisp/progmodes/python.el | |
| parent | 12c4970d70ae32fdcc81af55e1b2ff74afe96c93 (diff) | |
| download | emacs-9e89d835b04c20a8cd3dfad452fa827d675b0938.tar.gz emacs-9e89d835b04c20a8cd3dfad452fa827d675b0938.zip | |
* lisp/progmodes/python.el (python-font-lock-keywords): Don't return nil
from a matcher-function unless there's no more matches.
Fixes: debbugs:15161
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 01833ffd70b..7004836e69f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -501,29 +501,24 @@ The type returned can be `comment', `string' or `paren'." | |||
| 501 | (,(lambda (limit) | 501 | (,(lambda (limit) |
| 502 | (let ((re (python-rx (group (+ (any word ?. ?_))) | 502 | (let ((re (python-rx (group (+ (any word ?. ?_))) |
| 503 | (? ?\[ (+ (not (any ?\]))) ?\]) (* space) | 503 | (? ?\[ (+ (not (any ?\]))) ?\]) (* space) |
| 504 | assignment-operator))) | 504 | assignment-operator)) |
| 505 | (when (re-search-forward re limit t) | 505 | (res nil)) |
| 506 | (while (and (python-syntax-context 'paren) | 506 | (while (and (setq res (re-search-forward re limit t)) |
| 507 | (re-search-forward re limit t))) | 507 | (or (python-syntax-context 'paren) |
| 508 | (if (not (or (python-syntax-context 'paren) | 508 | (equal (char-after (point-marker)) ?=)))) |
| 509 | (equal (char-after (point-marker)) ?=))) | 509 | res)) |
| 510 | t | ||
| 511 | (set-match-data nil))))) | ||
| 512 | (1 font-lock-variable-name-face nil nil)) | 510 | (1 font-lock-variable-name-face nil nil)) |
| 513 | ;; support for a, b, c = (1, 2, 3) | 511 | ;; support for a, b, c = (1, 2, 3) |
| 514 | (,(lambda (limit) | 512 | (,(lambda (limit) |
| 515 | (let ((re (python-rx (group (+ (any word ?. ?_))) (* space) | 513 | (let ((re (python-rx (group (+ (any word ?. ?_))) (* space) |
| 516 | (* ?, (* space) (+ (any word ?. ?_)) (* space)) | 514 | (* ?, (* space) (+ (any word ?. ?_)) (* space)) |
| 517 | ?, (* space) (+ (any word ?. ?_)) (* space) | 515 | ?, (* space) (+ (any word ?. ?_)) (* space) |
| 518 | assignment-operator))) | 516 | assignment-operator)) |
| 519 | (when (and (re-search-forward re limit t) | 517 | (res nil)) |
| 520 | (goto-char (nth 3 (match-data)))) | 518 | (while (and (setq res (re-search-forward re limit t)) |
| 521 | (while (and (python-syntax-context 'paren) | 519 | (goto-char (match-end 1)) |
| 522 | (re-search-forward re limit t)) | 520 | (python-syntax-context 'paren))) |
| 523 | (goto-char (nth 3 (match-data)))) | 521 | res)) |
| 524 | (if (not (python-syntax-context 'paren)) | ||
| 525 | t | ||
| 526 | (set-match-data nil))))) | ||
| 527 | (1 font-lock-variable-name-face nil nil)))) | 522 | (1 font-lock-variable-name-face nil nil)))) |
| 528 | 523 | ||
| 529 | (defconst python-syntax-propertize-function | 524 | (defconst python-syntax-propertize-function |