summaryrefslogtreecommitdiff
path: root/lisp/init-python.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-07-31 21:46:00 -0400
committerKyle Meyer <kyle@kyleam.com>2015-07-31 21:46:00 -0400
commita7ed888cc820832b0f41e7d280c5fa38b103d9d8 (patch)
tree93fe51c61c987136c56ee722b74fdfd8ae655661 /lisp/init-python.el
parent24b9c5ddfde46614158048febf53cd5b5586c4e1 (diff)
downloademacs.d-a7ed888cc820832b0f41e7d280c5fa38b103d9d8.tar.gz
Set up outline-minor-mode for python and elisp
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)