2022-01-23 20:38:27 +01:00
|
|
|
← [[doom-module-index:][Back to module index]] ! [[doom-module-issues:::emacs undo][Issues]] ↖ [[doom-repo:tree/develop/modules/emacs/undo/][Github]] ± [[doom-suggest-edit:][Suggest edits]] ? [[doom-help-modules:][Help]]
|
2021-10-16 01:23:04 +02:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
#+TITLE: :emacs undo
|
|
|
|
#+SUBTITLE: Persistent, smarter undo for your inevitable mistakes
|
|
|
|
#+CREATED: April 14, 2020
|
|
|
|
#+SINCE: 21.12.0
|
|
|
|
|
|
|
|
* Description :unfold:
|
2020-05-09 15:39:37 -04:00
|
|
|
This module augments Emacs' built-in undo system to be more intuitive and to
|
|
|
|
persist across Emacs sessions.
|
2020-04-13 18:44:16 -04:00
|
|
|
|
|
|
|
** Maintainers
|
2021-10-16 01:23:04 +02:00
|
|
|
- [[doom-user:][@hlissner]]
|
|
|
|
|
|
|
|
[[doom-contrib-maintainer:][Become a maintainer?]]
|
2020-04-13 18:44:16 -04:00
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
** Module flags
|
|
|
|
- +tree ::
|
|
|
|
Uses [[doom-package:][undo-tree]] instead of [[doom-package:][undo-fu]], which is a little less stable, but offers
|
|
|
|
branching undo history and a visualizer for navigating it.
|
2020-04-13 18:44:16 -04:00
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
** Packages
|
|
|
|
- [[doom-package:][undo-fu]]
|
|
|
|
- [[doom-package:][undo-fu-session]]
|
|
|
|
- [[doom-package:][undo-tree]] if [[doom-module:][+tree]]
|
2020-04-13 18:44:16 -04:00
|
|
|
|
|
|
|
** Hacks
|
2021-10-16 01:23:04 +02:00
|
|
|
- Both undo-fu and undo-tree have been modified to use =zstd= to compress undo
|
2020-04-13 18:44:16 -04:00
|
|
|
history if it is available.
|
2021-10-16 01:23:04 +02:00
|
|
|
- undo-tree only
|
|
|
|
- Text properties are stripped from undo history to shrink it.
|
|
|
|
- Undo-tree is too chatty about saving its history files. This has be
|
2020-04-13 18:44:16 -04:00
|
|
|
"silenced". i.e. It's visible in \*Messages\*, but won't appear in your
|
|
|
|
minibuffer.
|
2021-10-16 01:23:04 +02:00
|
|
|
- unfo-fu only
|
|
|
|
- Doom defines ~undo-fu-mode~ to make it easier to add hooks/mode-local
|
2020-04-13 18:44:16 -04:00
|
|
|
keybinds.
|
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
** TODO Changelog
|
|
|
|
# This section will be machine generated. Don't edit it by hand.
|
|
|
|
/This module does not have a changelog yet./
|
2020-04-13 18:44:16 -04:00
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
* Installation
|
|
|
|
[[id:01cffea4-3329-45e2-a892-95a384ab2338][Enable this module in your ~doom!~ block.]]
|
2020-04-13 18:44:16 -04:00
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
/This module has no external requirements./
|
|
|
|
|
|
|
|
* TODO Usage
|
|
|
|
#+begin_quote
|
|
|
|
🔨 This module has no usage documentation yet. [[doom-contrib-module:][Write some?]]
|
|
|
|
#+end_quote
|
|
|
|
|
|
|
|
* TODO Configuration
|
|
|
|
#+begin_quote
|
|
|
|
🔨 /This module's configuration documentation is incomplete./ [[doom-contrib-module:][Complete it?]]
|
|
|
|
#+end_quote
|
2020-05-09 15:39:37 -04:00
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
** Disabling persistent undo history
|
|
|
|
- If you are using [[doom-module:][+tree]]:
|
|
|
|
#+begin_src emacs-lisp
|
2020-05-09 15:39:37 -04:00
|
|
|
(after! undo-tree
|
|
|
|
(setq undo-tree-auto-save-history nil))
|
2021-10-16 01:23:04 +02:00
|
|
|
#+end_src
|
2020-05-09 15:39:37 -04:00
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
- If you aren't:
|
|
|
|
#+begin_src emacs-lisp
|
2020-05-09 15:39:37 -04:00
|
|
|
(remove-hook 'undo-fu-mode-hook #'global-undo-fu-session-mode)
|
2021-10-16 01:23:04 +02:00
|
|
|
#+end_src
|
|
|
|
|
|
|
|
* Troubleshooting
|
|
|
|
[[doom-report:][Report an issue?]]
|
|
|
|
|
|
|
|
** undo-tree
|
|
|
|
- Has been known to truncate undo history unpredictably, due to Emacs' undo
|
|
|
|
cleanup imposing linear undo limits on non-linear undo tree data. Doom already
|
|
|
|
sets ~undo-limit~, ~undo-strong-limit~, and ~undo-outer-limit~ absurdly high
|
|
|
|
to mitigate this somewhat.
|
|
|
|
|
|
|
|
* Frequently asked questions
|
|
|
|
/This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]]
|
2020-04-13 18:44:16 -04:00
|
|
|
|
2021-10-16 01:23:04 +02:00
|
|
|
* TODO Appendix
|
|
|
|
#+begin_quote
|
|
|
|
🔨 This module has no appendix yet. [[doom-contrib-module:][Write one?]]
|
|
|
|
#+end_quote
|