Emacs finally folds to my liking
Web page · https://jointhefreeworld.org/blog/articles/emacs/emacs-folding-kirigami
First seen by Oriel on .
AI summary
The author unifies Emacs folding across major modes with kirigami, custom indicators, and optimized Org redraws, making folding consistent and responsive even in large files.
- kirigami dispatches folding commands to the active engine, while reordered kirigami-fold-list ensures Hideshow takes precedence in buffers where Outline is also enabled.
- Tree-sitter guide bitmaps are replaced with line-height brackets and theme-aware subdued colors; Hideshow handles Scheme, Emacs Lisp, XML, and non-Tree-sitter YAML.
- Org indicators redraw only visible or dirty regions when possible, and read fold state directly from Org to avoid stale markers.
- Org uses text-property folding, the element cache, and showeverything at startup; removing org-restart-font-lock avoids a second full-buffer fontification.
- The author reports smooth folding in a 3000-line Org file and tests that folds cover definitions and documented keys are bound uniquely.
#emacs #code folding #tree-sitter #org mode
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Lobsters: 27, latest observation ; +26 over observed period since
Comments
Comment count reported by the source.
- Lobsters: 5, latest observation ; +5 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Lobsters | yccmjm | https://jointhefreeworld.org/blog/articles/emacs/emacs-folding-kirigami/ Read discussion |
| Lobsters | yczems | https://jointhefreeworld.org/blog/articles/emacs/emacs-folding-kirigami/ Read discussion |