From 896f1e6e11ea1c5692e3eeadcdc91dec391b8ad3 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 2 Apr 2023 13:09:40 +0200 Subject: emacs: make recentf and format-all quieter --- user/emacs/init.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/user/emacs/init.el b/user/emacs/init.el index d7aad0fa..530eec90 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -25,6 +25,12 @@ (setq use-package-expand-minimally t)) (setq use-package-always-demand (daemonp)) +(defmacro quietly (&rest body) + `(let ((inhibit-message t)) + ,@body)) +(defun quiet (original-function &rest args) + (quietly (apply original-function args))) + ;;; Customize (setq custom-file (expand-file-name "custom.el" user-emacs-directory)) @@ -214,7 +220,9 @@ With two prefix arguments, write out the day and month name." (use-package recentf :defer 1 :custom (recentf-auto-cleanup 1800) - :config (recentf-mode +1)) + :config (progn + (quietly (recentf-mode +1)) + (advice-add 'recentf-cleanup :around #'quiet))) (use-package savehist :init (savehist-mode +1) @@ -1085,6 +1093,9 @@ _p_rev _u_pper _=_: upper/lower _r_esolve toml-mode-hook typescript-mode-hook)) :gfhook #'format-all-ensure-formatter + :init (progn + (advice-add 'format-all-ensure-formatter + :around #'quiet)) :config (progn (setq format-all-show-errors 'never))) -- cgit 1.4.1