From a7ed888cc820832b0f41e7d280c5fa38b103d9d8 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 31 Jul 2015 21:46:00 -0400 Subject: Set up outline-minor-mode for python and elisp --- lisp/init-python.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/init-python.el') 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) -- cgit v1.2.3