diff --git a/core/core-editor.el b/core/core-editor.el index e890e1fdf..2dda4dee8 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -209,32 +209,9 @@ fundamental-mode) for performance sake." ;; persistent undo history is known to cause undo history corruption, which ;; can be very destructive! So disable it! - (setq undo-tree-auto-save-history t + (setq undo-tree-auto-save-history nil undo-tree-history-directory-alist - (list (cons "." (concat doom-cache-dir "undo-tree-hist/")))) - - (defun doom|save-undo-history () - (when (and (bound-and-true-p undo-tree-mode) - buffer-file-name - (file-writable-p buffer-file-name) - (not (eq buffer-undo-list t)) - (not revert-buffer-in-progress-p)) - (quiet! - (undo-tree-save-history nil t)))) - - (defun doom|save-all-undo-history () - (dolist (buffer (buffer-list)) - (with-current-buffer buffer - (doom|save-undo-history)))) - - (remove-hook 'write-file-functions #'undo-tree-save-history-hook) - (add-hook 'kill-emacs-hook #'doom|save-all-undo-history) - (add-hook 'kill-buffer-hook #'doom|save-undo-history) - - (defun doom*silence-undo-tree-load (orig-fn &rest args) - "Silence undo-tree load errors." - (quiet! (apply orig-fn args))) - (advice-add #'undo-tree-load-history-hook :around #'doom*silence-undo-tree-load)) + (list (cons "." (concat doom-cache-dir "undo-tree-hist/"))))) ;;