add undo-tree package

This commit is contained in:
Peter Tillemans 2024-11-11 17:10:55 +01:00
parent 1705e1b55f
commit eb2557255f

View file

@ -60,6 +60,10 @@ accident instead of the source in the org-mode file.
Also immediately set lexical binding mode. Also immediately set lexical binding mode.
** Set the garbage collector threshold, to avoid collections ** Set the garbage collector threshold, to avoid collections
The emacs history goes back to times where memory was counted in
bytes, not gigabytes. We can afford to be a bit more generous with the
garbage collector settings.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq gc-cons-percentage 0.5 (setq gc-cons-percentage 0.5
gc-cons-threshold (* 128 1024 1024)) gc-cons-threshold (* 128 1024 1024))
@ -116,6 +120,31 @@ Needs to load early so the ~:general~ keyword is available for ~use-package~.
#+END_SRC #+END_SRC
*** Enable Undo Tree
undo-tree is my preferred way of undoing and redoing stuff. The main reason is it doesnt create a linear undo/redo history, but rather a complete tree you can navigate to see your complete editing history. One of the two obvious things to do are to tell Emacs to save all its undo history fies in a dedicated directory, otherwise wed risk littering all of our directories. The second thing is to simply globally enable its mode.
(use-package undo-tree
:defer t
:straight (:build t)
:custom
(undo-tree-history-directory-alist
`(("." . ,(expand-file-name (file-name-as-directory "undo-tree-hist")
user-emacs-directory))))
:init
(global-undo-tree-mode)
:config
<<undo-tree-ignore-text-properties>>
<<undo-tree-compress-files>>
(setq undo-tree-visualizer-diff t
undo-tree-auto-save-history t
undo-tree-enable-undo-in-region t
undo-limit (* 800 1024)
undo-strong-limit (* 12 1024 1024)
undo-outer-limit (* 128 1024 1024)))
** Utility Functions ** Utility Functions
@ -1128,12 +1157,6 @@ gicrisf has [[https://github.com/gicrisf/ox-zola][created a package]] to export
#+END_SRC #+END_SRC
#+RESULTS: #+RESULTS:
<<<<<<< HEAD
: [nil 26302 34728 837190 nil elpaca-process-queues nil nil 651000 nil]
||||||| parent of 48b03fc (add the general package)
: [nil 26301 59789 776924 nil elpaca-process-queues nil nil 824000 nil]
=======
>>>>>>> 48b03fc (add the general package)
It is a wrapper around ~ox-hugo~ to export org files to Zola. It It is a wrapper around ~ox-hugo~ to export org files to Zola. It
supports most features of it and directs the user to the [[https://ox-hugo.scripter.co/][the hugo supports most features of it and directs the user to the [[https://ox-hugo.scripter.co/][the hugo