diff --git a/core/core-editor.el b/core/core-editor.el index 35eac8e18..c7ef92c04 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -233,32 +233,19 @@ savehist file." `(("." . ,(concat doom-cache-dir "undo-tree-hist/")))) (global-undo-tree-mode +1) - (defun doom*shut-up-undo-tree (&rest _) (message "")) - (advice-add #'undo-tree-load-history :after #'doom*shut-up-undo-tree) - ;; 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) + (and (fset 'doom*undo-tree-make-history-save-file-name + (cond ((executable-find "zstd") (lambda (file) (concat file ".zst"))) + ((executable-find "gzip") (lambda (file) (concat file ".gz"))))) + (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 (&rest _) (dolist (item buffer-undo-list) (and (consp item) (stringp (car item)) (setcar item (substring-no-properties (car item)))))) - (advice-add #'undo-list-transfer-to-tree :before #'doom*strip-text-properties-from-undo-history) - - (defun doom*compress-undo-tree-history (orig-fn &rest args) - (cl-letf* ((jka-compr-verbose nil) - (old-write-region (symbol-function #'write-region)) - ((symbol-function #'write-region) - (lambda (start end filename &optional append _visit &rest args) - (apply old-write-region start end filename append 0 args)))) - (apply orig-fn args))) - (advice-add #'undo-tree-save-history :around #'doom*compress-undo-tree-history)) + (advice-add #'undo-list-transfer-to-tree :before #'doom*strip-text-properties-from-undo-history)) (def-package! command-log-mode diff --git a/core/core.el b/core/core.el index 997dada7a..1c04086b8 100644 --- a/core/core.el +++ b/core/core.el @@ -142,6 +142,7 @@ Doom was setup, which can cause problems.") auto-mode-case-fold nil autoload-compute-prefixes nil debug-on-error doom-debug-mode + jka-compr-verbose doom-debug-mode ; silence compression messages ffap-machine-p-known 'reject ; don't ping things that look like domain names find-file-visit-truename t ; resolve symlinks when opening files idle-update-delay 2 ; update ui less often