Henrik Lissner 2023-02-18 15:52:45 -05:00
parent 7c1c1f52bb
commit 81268cc5cf
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
4 changed files with 15 additions and 18 deletions

View file

@ -31,6 +31,11 @@
:config
(setq undo-fu-session-incompatible-files '("\\.gpg$" "/COMMIT_EDITMSG\\'" "/git-rebase-todo\\'"))
(when (executable-find "zstd")
;; There are other algorithms available, but zstd is the fastest, and speed
;; is our priority within Emacs
(setq undo-fu-session-compression 'zst))
;; HACK Fix #4993: we've advised `make-backup-file-name-1' to produced SHA1'ed
;; filenames to prevent file paths that are too long, so we force
;; `undo-fu-session--make-file-name' to use it instead of its own
@ -38,17 +43,9 @@
;; TODO PR this upstream; should be a universal issue
(defadvice! +undo-fu-make-hashed-session-file-name-a (file)
:override #'undo-fu-session--make-file-name
(let ((backup-directory-alist `(("." . ,undo-fu-session-directory))))
(concat (make-backup-file-name-1 file)
(if undo-fu-session-compression ".gz" ".el"))))
;; HACK Use the faster zstd to compress undo files instead of gzip
(when (executable-find "zstd")
(defadvice! +undo--append-zst-extension-to-file-name-a (filename)
:filter-return #'undo-fu-session--make-file-name
(if undo-fu-session-compression
(concat (file-name-sans-extension filename) ".zst")
filename))))
(concat (let ((backup-directory-alist `(("." . ,undo-fu-session-directory))))
(make-backup-file-name-1 file))
(undo-fu-session--file-name-ext))))
(use-package! undo-tree

View file

@ -2,6 +2,6 @@
;;; emacs/undo/packages.el
(if (modulep! +tree)
(package! undo-tree :pin "e326c6135e62f5fe8536528d3acd5e798f847407")
(package! undo-fu :pin "ab8bc10e424bccc847800c31ab41888db789d55d")
(package! undo-fu-session :pin "3e810c7c9ab75d2b6f92c7c876290abbc164e750"))
(package! undo-tree :pin "16f4121032d09ef44b3d7d02c4d02c3c2f18041f")
(package! undo-fu :pin "0e22308de8337a9291ddd589edae167d458fbe77")
(package! undo-fu-session :pin "7b3fd0647dd1fbd02101eec61440e6d44953bcd9"))