diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-elisp.el | 11 | ||||
-rw-r--r-- | lisp/init-python.el | 7 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lisp/init-elisp.el b/lisp/init-elisp.el index a6cee16..e35a53d 100644 --- a/lisp/init-elisp.el +++ b/lisp/init-elisp.el @@ -1,4 +1,15 @@ (add-hook 'emacs-lisp-mode-hook 'lispy-mode) +(add-hook 'emacs-lisp-mode-hook 'km/elisp-set-outline-vars) +;; This likely breaks lispy's outline functions, but I don't use them. +(add-hook 'lispy-mode-hook 'km/elisp-set-outline-vars) + +(defun km/elisp-outline-level () + (and (looking-at (concat "^" outline-regexp)) + (- (match-end 0) (match-beginning 0) 3))) + +(defun km/elisp-set-outline-vars () + (setq outline-regexp ";;;;* ") + (setq outline-level 'km/elisp-outline-level)) (provide 'init-elisp) 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) |