Skip to content

persistence for various emacs folding systems

License

Notifications You must be signed in to change notification settings

jcs-PR/savefold.el

This branch is up to date with jcfk/savefold.el:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

37983bd · Apr 7, 2025

History

63 Commits
Mar 30, 2025
Apr 7, 2025
Apr 5, 2025
Apr 7, 2025
Mar 18, 2025
Apr 7, 2025
Apr 7, 2025
Apr 7, 2025
Apr 7, 2025
Apr 7, 2025
Apr 7, 2025
Apr 7, 2025
Apr 7, 2025

Repository files navigation

savefold.el https://github.com/jcfk/savefold.el/actions/workflows/test.yml/badge.svg

This package is a family of global minor modes that persist folds made by various existing (mostly) overlay-based folding systems, saving them to the disk and reapplying upon file open. Currently supported:

Rationale: there are billions of different types of folds in emacs, and very few of the packages implement persistence. It makes sense for fold persistence to be abstracted out into a separate package, both for economic reasons and for consistency of usage.

Usage

(use-package savefold
  :init
  (setq savefold-backends '(outline org origami hideshow))
  (setq savefold-directory (locate-user-emacs-file "savefold"))  ;; default

  :config
  (savefold-mode 1))

Notes:

  • Folding systems which are not a part of Emacs (eg. origami) have to be installed separately, if their savefold backend is to be used.
  • For org: setting org-startup-folded to 'showeverything is recommended for proper support.

Configuration:

  • savefold-backends (default: '(outline)) is a list of backends to be enabled by savefold-mode.
  • savefold-directory (default: (locate-user-emacs-file "savefold")) is the directory where fold data is saved.

Development

Please feel free to contribute support for other folding systems. Suggestions and comments are also very welcome.

Development guidelines:

  • Savefold uses Eask for environment management and Buttercup for testing.
  • Savefold supports Emacs versions 28, 29, and 30.
  • If you’re adding new functionality, please also create the relevant tests.

Before sending a PR, ensure (within reason):

  1. All tests pass: eask test buttercup
  2. Compilation without warnings: eask compile
  3. Declarations are true: eask lint declare
  4. Package is well behaved: eask lint package

About

persistence for various emacs folding systems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%