mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Fix advice for `undo-tree-make-history-save-file-name'
Inspired by #786: `:filter-return' expects a function to be given. If neither "zstd" or "gzip" are found on the executable path, then it gets given nil instead, which results in sadness when trying to save files.
This commit is contained in:
@ -221,13 +221,16 @@ savehist file."
|
||||
`(("." . ,(concat doom-cache-dir "undo-tree-hist/"))))
|
||||
(global-undo-tree-mode +1)
|
||||
|
||||
;; compress undo with xz
|
||||
(advice-add #'undo-tree-make-history-save-file-name :filter-return
|
||||
(cond ((executable-find "zstd") (lambda (file) (concat file ".zst")))
|
||||
((executable-find "gzip") (lambda (file) (concat file ".gz")))))
|
||||
|
||||
(advice-add #'undo-tree-load-history :around #'doom*shut-up)
|
||||
|
||||
;; compress undo history with xz
|
||||
(defun doom*undo-tree-make-history-save-file-name (file)
|
||||
(cond ((executable-find "zstd") (concat file ".zst"))
|
||||
((executable-find "gzip") (concat file ".gz"))
|
||||
(file)))
|
||||
(advice-add #'undo-tree-make-history-save-file-name :filter-return
|
||||
#'doom*undo-tree-make-history-save-file-name)
|
||||
|
||||
(defun doom*strip-text-properties-from-undo-history (orig-fn &rest args)
|
||||
(dolist (item buffer-undo-list)
|
||||
(and (consp item)
|
||||
|
Reference in New Issue
Block a user