emacs: make recentf and format-all quieter
Alan Pearce alan@alanpearce.eu
Sun, 02 Apr 2023 13:09:40 +0200
1 files changed, 12 insertions(+), 1 deletions(-)
jump to
M user/emacs/init.el → user/emacs/init.el
@@ -25,6 +25,12 @@ (require 'use-package) (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 @@ (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 @@ sql-mode-hook 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)))