Files
.emacs.d/modules/editor/siren-undo-tree.el
Jim Myhrberg fe6a4e7ce5 fix(elisp): add lexical-binding comment to all files to suppress new Emacs 31 warnings
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress
the warnings introduced in Emacs 31 requiring all elisp files to have a
`lexical-binding` comment.

This retains the default behavior of dynamic binding when no
`lexical-binding` comment is present. With it set to `t` across the
board, various things break, and fixing those is a task for another day.
2025-06-29 12:23:03 +01:00

41 lines
1.1 KiB
EmacsLisp

;;; siren-undo-tree.el --- jimeh's Emacs Siren: undo-tree configuration. -*- lexical-binding: nil; -*-
;;; Commentary:
;; Basic configuration for undo-tree.
;;; Code:
(use-package undo-tree
:demand
:general
(:keymaps 'undo-tree-map
"C-x u" 'undo-tree-visualize
"M--" 'undo-tree-undo
"M-_" 'undo-tree-redo
"s-z" 'undo-tree-undo
"s-Z" 'undo-tree-redo)
:diminish
undo-tree-mode
:custom
(undo-tree-history-directory-alist
`((".*" . ,(siren-cache-dir "undo-tree-history"))))
;; Use undohist package to persist history to disk, it seems more reliable
;; than undo-tree's auto-save feature which randomly fails to restore history
;; for no obvious reason.
(undo-tree-auto-save-history nil)
(undo-tree-incompatible-major-modes '(term-mode vterm-mode))
:config
(global-undo-tree-mode)
;; Unbind keys that I don't use.
(unbind-key "C-/" undo-tree-map)
(unbind-key "C-?" undo-tree-map)
(unbind-key "C-_" undo-tree-map))
(provide 'siren-undo-tree)
;;; siren-undo-tree.el ends here