Version 0.1
Emacs package, provide starter for outline-minor-mode and enhancements and fixes, that don't require activation of mode.
- fontification like in Org for any mode.
- fixes for Outline mode for jumping such as xref and goto (advices activates at loading)
- better keys or main commans, TAB key bound to
indent-for-tab-commandwe useindent-line-function.
Theare are tree types of usage that may be mixed.
- by M-x outline-it, or with prepared (outline-it "regex") elisp call, that activate `outline-minor-mode' for current buffer.
- to enhance `outline-minor-mode', we add hook to it
- enhance outline related functionality globally
Configuration for 1,2,3)
- for manual activation by `outline-it'
(add-to-list 'load-path "/path/to/this/package/emacs-outline-it")
(require 'outline-it)- for all outline-minor modes or per some major mode:
(add-hook 'outline-minor-mode-hook 'outline-it-outline-minor-mode-hook-function)
(outline-it-advices-activation)- for enhancing outline functionality that works without any activation
(add-hook 'isearch-mode-hook #'outline-it--header-search)
(outline-it-advices-activation)To use, defune your outline-it-your function same way like outline-it-python and outline-it-githubactionlog at
Then use M-x outline-it-your
;; from: [[file:outline-it.el::426::(defun outline-it-python ()]]
(defun outline-it-githubactionlog ()
"For Github Action Melpazoid log of run.
Where is goups with substring ##[group].
To check use: (search-forward-regexp (regexp-quote \"##[group]\"))"
(interactive)
(setq-local outline-it-heading-alist '(("##\\[group]" . 1) ("⸺ " . 2)))
(outline-it ".*##\\[group]\\|.*⸺ "))
Create file in the same directory.
For Elisp files:
((emacs-lisp-mode
. (
(outline-regexp . "^;;; ")
(outline-heading-alist . ((";;; " . 1)))
(eval . (progn (keymap-local-set "C-c k" #'outline-previous-heading)
(keymap-local-set "C-c n" #'outline-next-heading)
(when (featurep 'outline-it)
(keymap-local-set "C-c C-e" #'outline-it-hide-other))
(keymap-local-set "<backtab>" #'outline-cycle-buffer)
(keymap-local-set "C-<tab>" #'outline-toggle-children)
(outline-hide-body)
)) ; noqa
)))For Bash files:
((sh-mode
. (
(outline-regexp . "^# -- ")
(outline-heading-alist . (("# -- " . 1)))
(eval . (progn (keymap-local-set "C-c k" #'outline-previous-heading)
(keymap-local-set "C-c n" #'outline-next-heading)
(when (featurep 'outline-it)
(keymap-local-set "C-c C-e" #'outline-it-hide-other))
(keymap-local-set "<backtab>" #'outline-cycle-buffer)
(keymap-local-set "C-<tab>" #'outline-toggle-children)
(outline-hide-body) ;; or (outline-cycle-buffer 5) ;; narrow by building levels by 5 first characters
))
)))Activation of outline-minor-mode is not required for simple working.
By calling outline-it we configure outline.el by setting its variables and bind keys.
To toggle header by TAB key we wrap indent-line-function function.
We replace outline-level function because it match outline-heading-alist incorrectly by full string match instead of searching substring.
For searching in headers we add hook to isearch-mode-hook' that add template to C-M-s isearch-forward-regexpcommand byoutline-regexp' variable. We do this globally without calling `outline-it' function.
Conf-mode with with forced fontification of 3 headers ("^# -- " . 1) ("##\\[group]" . 2) ("⸺ " . 3)
It uses two variables:
- outline-regexp - to search for header
- outline-heading-alist - is optional, to determinate level.
alist used in by outline-level function used by many others.
Function outline-back-to-heading -> outline-level ( used by outline-hide-sublevels and outline-hide-entry) uses functions:
- outline-back-to-heading use var outline-regexp
- outline-level uses var alist
(revert-buffer nil t t) not working.
- 2w https://github.com/jdtsmith/outli (font-lock)
- 7y https://github.com/tj64/outline-magic
- 3y https://github.com/alphapapa/outshine (font-lock)
- 4d https://github.com/jamescherti/outline-indent.el (font-lock)
- Navigation in Dired, Packages, Buffers modes https://github.com/Anoncheg1/firstly-search
- Search with Chinese https://github.com/Anoncheg1/pinyin-isearch
- Ediff fix https://github.com/Anoncheg1/ediffnw
- Dired history https://github.com/Anoncheg1/dired-hist
- Selected window contrast https://github.com/Anoncheg1/selected-window-contrast
- Copy link to clipboard https://github.com/Anoncheg1/emacs-org-links
- Solution for "callback hell" https://github.com/Anoncheg1/emacs-async1
- Call LLMs and AI agents from Org-mode ai block. https://github.com/Anoncheg1/emacs-oai
- Restore buffer state https://github.com/Anoncheg1/emacs-unmodified-buffer1
You can sponsor author crypto money directly with crypto currencies:
- BTC (Bitcoin) address: 1CcDWSQ2vgqv5LxZuWaHGW52B9fkT5io25
- USDT (Tether) address: TVoXfYMkVYLnQZV3mGZ6GvmumuBfGsZzsN
- TON (Telegram) address: UQC8rjJFCHQkfdp7KmCkTZCb5dGzLFYe2TzsiZpfsnyTFt9D
