[outline] toggle children if on heading, else indent

This commit is contained in:
contrapunctus 2021-06-06 07:57:59 +05:30
parent cf70eed1aa
commit 1534d70644
1 changed files with 11 additions and 1 deletions

View File

@ -2920,12 +2920,22 @@ pjb suggested a different approach [[http://paste.lisp.org/display/10157][here]]
(use-package outline
:hook (adoc-mode . outline-minor-mode)
:bind (:map outline-minor-mode-map
("TAB" . outline-toggle-children)
("TAB" . contrapunctus-outline-indent-or-toggle-children)
;; this (rather than `outline-show-children') seems to
;; be the equivalent of `org-show-subtree'
("C-c C-k" . outline-show-branches)))
#+END_SRC
#+BEGIN_SRC emacs-lisp
(defun contrapunctus-outline-indent-or-toggle-children ()
(interactive)
(if (save-excursion
(goto-char (point-at-bol))
(looking-at-p outline-regexp))
(outline-toggle-children)
(indent-for-tab-command)))
#+END_SRC
** custom.el
#+BEGIN_SRC emacs-lisp
(setq custom-file "~/.emacs.d/custom.el")