Subject: bug#24815: 25.1; emacs could hang whith hs-minor-mode and python-mode

From: [email-masked]
Date: Fri, 28 Oct 2016 18:35:11 +0200 (CEST)

Hi, 

In python-mode, emacs could hang if you choose a variable name which ends by "def", 
when you run "hide-all" function (hs-minor-mode menu) 

Code sample 
# 
# -*- coding: utf-8 -*- 
# 

with open("default.conf", 'r') as fdef: 
my_conf = fdef.readlines() 

## 
I had to kill the session. 
The problem seems to come from the regexp for python-mode in the variable 
hs-special-modes-alist : 

(elt (assoc 'python-mode hs-special-modes-alist) 1) 

gives 
"\\s-*\\(?:def\\|class\\)\\>" in version 25.1 
instead of 
"^\\s-*\\(?:def\\|class\\)\\>" in version 24.5 

if I change it by "^\\s-*\\(?:def\\|class\\)\\>" or by 
"\\_<\\(?:def\\|class\\)\\_>" 
hs-minor-mode works fine with python-mode 

sincerely 
Gilles Naulin