From 63e25b349d2d8c4491f85882361846e118bb1903 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 16 Oct 2018 02:51:11 -0400 Subject: [PATCH] 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. --- core/core-editor.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 40775e60a..4def0117d 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -241,7 +241,8 @@ savehist file." `(("." . ,(concat doom-cache-dir "undo-tree-hist/")))) (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 (defun doom*undo-tree-make-history-save-file-name (file) @@ -256,7 +257,7 @@ savehist file." (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) + (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)