diff options
| author | Noam Postavsky | 2016-11-01 23:24:33 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2016-11-06 09:14:12 -0500 |
| commit | 0b6b8151186e2d8d48aff8182a66aee21a6edb53 (patch) | |
| tree | c80f91ae1bc61b4390b6b0519be61b6f23caef29 /lisp/progmodes/python.el | |
| parent | dc152c54f4e44f5f2040883b03f71ff6aa66c893 (diff) | |
| download | emacs-0b6b8151186e2d8d48aff8182a66aee21a6edb53.tar.gz emacs-0b6b8151186e2d8d48aff8182a66aee21a6edb53.zip | |
Fix python-mode hideshow regexp
2015-02-07 "Fix hideshow integration[...]" changed the regexp added to
`hs-special-modes-alist' so that it worked when not searching from the
beginning of the line. However, this allows matching tokens ending in
"def" or "class", not just those keywords. This results in an infinite
loop in hs-hide-all (Bug #24815).
* lisp/progmodes/python.el (python-mode): Add symbol boundaries around
the def|class matching part of the regexp added to
hs-special-modes-alist.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8ec9febe5c9..9091289b62e 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -5136,7 +5136,7 @@ returned as is." | |||
| 5136 | (add-to-list | 5136 | (add-to-list |
| 5137 | 'hs-special-modes-alist | 5137 | 'hs-special-modes-alist |
| 5138 | `(python-mode | 5138 | `(python-mode |
| 5139 | "\\s-*\\(?:def\\|class\\)\\>" | 5139 | "\\s-*\\_<\\(?:def\\|class\\)\\_>" |
| 5140 | ;; Use the empty string as end regexp so it doesn't default to | 5140 | ;; Use the empty string as end regexp so it doesn't default to |
| 5141 | ;; "\\s)". This way parens at end of defun are properly hidden. | 5141 | ;; "\\s)". This way parens at end of defun are properly hidden. |
| 5142 | "" | 5142 | "" |