[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 0b6b815: Fix python-mode hideshow regexp
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] emacs-25 0b6b815: Fix python-mode hideshow regexp |
Date: |
Sun, 6 Nov 2016 14:18:42 +0000 (UTC) |
branch: emacs-25
commit 0b6b8151186e2d8d48aff8182a66aee21a6edb53
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
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.
---
lisp/progmodes/python.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 8ec9feb..9091289 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -5136,7 +5136,7 @@ returned as is."
(add-to-list
'hs-special-modes-alist
`(python-mode
- "\\s-*\\(?:def\\|class\\)\\>"
+ "\\s-*\\_<\\(?:def\\|class\\)\\_>"
;; Use the empty string as end regexp so it doesn't default to
;; "\\s)". This way parens at end of defun are properly hidden.
""
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 0b6b815: Fix python-mode hideshow regexp,
Noam Postavsky <=