[outline] toggle children if on heading, else indent
This commit is contained in:
parent
cf70eed1aa
commit
1534d70644
12
init.org
12
init.org
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue