mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Silence undo-tree a little less destructively
undo-tree-load-history was formerly advised with doom*shut-up, which uses the quiet! macro to suppress output. quiet! accomplishes this by temporarily redefining message to a no-op function. However, if a fatal error occurs while this binding is active, in some cases, message will remain redefined, perpetually silencing all output to the minibuffer. This tries to mitigate that, at least where undo-tree is concerned. Also sharp-quotes an unquoted function.
This commit is contained in:
@ -241,7 +241,8 @@ savehist file."
|
|||||||
`(("." . ,(concat doom-cache-dir "undo-tree-hist/"))))
|
`(("." . ,(concat doom-cache-dir "undo-tree-hist/"))))
|
||||||
(global-undo-tree-mode +1)
|
(global-undo-tree-mode +1)
|
||||||
|
|
||||||
(advice-add #'undo-tree-load-history :around #'doom*shut-up)
|
(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
|
;; compress undo history with xz
|
||||||
(defun doom*undo-tree-make-history-save-file-name (file)
|
(defun doom*undo-tree-make-history-save-file-name (file)
|
||||||
@ -256,7 +257,7 @@ savehist file."
|
|||||||
(and (consp item)
|
(and (consp item)
|
||||||
(stringp (car item))
|
(stringp (car item))
|
||||||
(setcar item (substring-no-properties (car item))))))
|
(setcar item (substring-no-properties (car item))))))
|
||||||
(advice-add 'undo-list-transfer-to-tree :before #'doom*strip-text-properties-from-undo-history)
|
(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)
|
(defun doom*compress-undo-tree-history (orig-fn &rest args)
|
||||||
(cl-letf* ((jka-compr-verbose nil)
|
(cl-letf* ((jka-compr-verbose nil)
|
||||||
|
Reference in New Issue
Block a user