summaryrefslogtreecommitdiff
path: root/lisp/init-python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/init-python.el')
-rw-r--r--lisp/init-python.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/init-python.el b/lisp/init-python.el
index 48c19dd..b27472f 100644
--- a/lisp/init-python.el
+++ b/lisp/init-python.el
@@ -13,12 +13,17 @@
'post-self-insert-hook
#'km/python-indent-post-self-insert-function 'append 'local)))
-
(defun km/python-set-local-vars ()
+ (setq outline-regexp "####* ")
+ (setq outline-level 'km/python-outline-level)
;; Stop semantic from taking over imenu.
(setq imenu-create-index-function #'python-imenu-create-index)
(set (make-local-variable 'compile-command) "py.test"))
+(defun km/python-outline-level ()
+ (and (looking-at (concat "^" outline-regexp))
+ (- (match-end 0) (match-beginning 0) 3)))
+
(defun km/toggle-ipython-shell ()
"Switch between using python and IPython for interactive shell."
(interactive)