remove undo-tree mode to get rid of the bugs in that module

This commit is contained in:
Peter Tillemans 2025-05-04 00:02:31 +02:00
parent 18cf690ec7
commit 589e25de8b

View file

@ -487,65 +487,6 @@ up, which a totally different can of worms). A function
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))
#+END_SRC
** Enable undo-tree
see [[https://elpa.gnu.org/packages/undo-tree.html][undo-tree web page]]. There is a lot of background info there to
explain the problems and solutions.
Emacs actually maintains undo/redo information is an way that any
state can be restored. Both undo and redo is remembered in contrast to
many apps which essentially reset after doing a redo operation. It is
very hard to keep track of the state using the
normal undo/redo machinery to restore a specific state by tracking the
branching naturranching nature.
The *undo-tree* package solves this by redefining the undo/redo bindings
and offering a visualization of the undo/redo state and allow
navigation with real-time updates of the state in the original buffer.
When undo-tree-mode is active the following bindings are available:
- C-_ : undo
- M-_: redo
- C-/ : undo
- C-? : redo
- C-x u : undo-tree-vizualizer
- C-x r u : store undo-tree state in the given register
- C-x r U : restore undo-tree state from the given register
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.
#+BEGIN_SRC emacs-lisp
(use-package undo-tree
:defer t
:ensure 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
(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)))
#+END_SRC
#+RESULTS:
: [nil 26433 42993 909143 nil elpaca-process-queues nil nil 187000 nil]
In the visualizer you can navigate the undo/redo state with:
- p : navigate to the previous node in the graph
- n : navigate to the next node in the graph
- q : quit window
- C-q : abort undo tree visualizer
- C-b : switch branch left
- C-f : switch branch right
- M-{ or C-<up> : undo to X where X is a stored register or a branch point
- M-} or C-<down> : redo to X where X is a stored register or a branch point
** Save history over sessions
Persist history over Emacs restarts. Vertico sorts by history
@ -2188,6 +2129,33 @@ it in the same context. Hmmm.... sounds even better.
(class (append mlx-latex-classes snm-latex-classes))
(add-to-list 'org-latex-classes class)))
#+END_SRC
**** Export to Confluence
#+BEGIN_SRC emacs-lisp
(use-package org-contrib
:ensure t)
#+END_SRC
#+RESULTS:
: [nil 26576 2769 688869 nil elpaca-process-queues nil nil 120000 nil]
#+BEGIN_SRC emacs-lisp
(use-package ox-confluence
:after org-contrib
:ensure nil)
#+END_SRC
#+RESULTS:
#+BEGIN_SRC emacs-lisp
(use-package ox-confluence-en
:after ox-confluence
:ensure (ox-confluence-en :host github :repo "correl/ox-confluence-en"))
#+END_SRC
#+RESULTS:
: [nil 26576 2809 520906 nil elpaca-process-queues nil nil 290000 nil]
**** Blogging with Zola
gicrisf has [[https://github.com/gicrisf/ox-zola][created a package]] to export org files to Zola.
@ -2657,7 +2625,7 @@ As many tools require API keys, I better define them once and reuse
them in the configuration of the individual tools.
#+BEGIN_SRC emacs-lisp
(setq openai-api-key (auth-source-pass-get 'secret "snamellit/anthropic-api-key"))
(setq openai-api-key (auth-source-pass-get 'secret "snamellit/openai-api-key"))
(setq anthropic-api-key (auth-source-pass-get 'secret "snamellit/anthropic-api-key"))
(setq gemini-api-key (auth-source-pass-get 'secret "snamellit/gemini-api-key"))
@ -2680,7 +2648,7 @@ whether to put it under writing, comms or programming as it is equally
#+RESULTS:g
#+BEGIN_SRC emacs-lisp :tangle no
#+BEGIN_SRC emacs-lisp :tangle no
(use-package ellama
:ensure t
:defer t
@ -2884,7 +2852,7 @@ integration in Emacs.
#+END_SRC
#+RESULTS:
: [nil 26557 40411 880967 nil elpaca-process-queues nil nil 794000 nil]
: [nil 26626 15252 706789 nil elpaca-process-queues nil nil 969000 nil]
** Copilot Support