- fontification like in Org for any mode.
- fixes for Outline mode for jumping such as xref and goto (advices activates at loading)
- configure TAB key It by default bound to
indent-for-tab-command' we useindent-line-function`.
(add-to-list 'load-path "/path/to/this/package/emacs-outline-it")
(require 'outline-it)
(outline-it-advices-activation)
;; configure TAB key and isearch C-M-s key if outline-it or outline-minor-mode activated
(add-hook 'outline-minor-mode-hook 'outline-it-outline-minor-mode-hook-function) ; optional, for .emacs
;; Or without outline-it and outline-minor-mode for any major mode.
;; Variable `outline-regexp' should be set.
(add-hook 'emacs-lisp-mode-hook 'outline-it-any-mode-hook-function)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 . "^;;; ")
(eval . (progn (keymap-local-set "C-c k" #'outline-previous-heading)
(keymap-local-set "C-c n" #'outline-next-heading)
(keymap-local-set "C-c C-e" #'outline-it-hide-others)
(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 . "^# -- ")
(eval . (progn (keymap-local-set "C-c k" #'outline-previous-heading)
(keymap-local-set "C-c n" #'outline-next-heading)
(keymap-local-set "C-c C-e" #'outline-it-hide-others)
(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.
Screenshot - 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
