From 36c7cec4d4730248f9d03dbf50ff4bfdfbd00de7 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 18 Dec 2015 20:48:59 +0100 Subject: Add outline library --- emacs/.emacs.d/init.el | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'emacs/.emacs.d/init.el') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index 82e9305..cccc321 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -141,19 +141,6 @@ MODE1 is enabled and vice-versa." "Set the `disabled' property for each item in FUNCTIONS to nil." (mapc #'(lambda (f) (put f 'disabled nil)) functions)) -(defun oni:set-tab-maybe-toggle-outline () - "Wrap the current function mapped to `TAB'." - (let ((func (or (lookup-key (current-local-map) (kbd "TAB")) - (lookup-key (current-global-map) (kbd "TAB"))))) - (local-set-key (kbd "TAB") - (lambda () - (interactive) - (if (outline-on-heading-p) - (if (outline-invisible-p (line-end-position)) - (outline-show-entry) - (outline-hide-entry)) - (call-interactively func)))))) - (defun oni:current-conkeror-tab (httpcon) "Demonstration function" (elnode-http-start @@ -641,7 +628,10 @@ If no direction is given, don't split." (add-hook 'gnus-exit-group-hook 'oni:update-mailcount) (add-hook 'gnus-exit-gnus-hook 'oni:update-mailcount) (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) -(add-hook 'outline-minor-mode-hook #'oni:set-tab-maybe-toggle-outline) + +;; Make tab toggle outlines on outline headings. +(add-hook 'outline-minor-mode-hook 'oni:set-tab-maybe-toggle-outline) + (add-hook 'scheme-mode-hook (lambda () (setq ac-sources '(ac-source-geiser)))) (add-hook 'slime-mode-hook #'set-up-slime-ac) -- cgit v1.2.3-54-g00ecf