summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index f110828d602..5e645535a23 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1744,6 +1744,14 @@ lines count as headers.
#'python-eldoc-function)
(add-hook 'eldoc-mode-hook
'(lambda () (run-python nil t)) nil t) ; need it running
+ (unless (assoc 'python-mode hs-special-modes-alist)
+ (setq
+ hs-special-modes-alist
+ (cons (list
+ 'python-mode "^\\s-*def\\>" nil "#"
+ (lambda (arg)(python-end-of-defun)(skip-chars-backward " \t\n"))
+ nil)
+ hs-special-modes-alist)))
(if (featurep 'hippie-exp)
(set (make-local-variable 'hippie-expand-try-functions-list)
(cons 'python-try-complete hippie-expand-try-functions-list)))