all repos — nixfiles @ 896f1e6e11ea1c5692e3eeadcdc91dec391b8ad3

System and user configuration, managed by nix and home-manager

emacs: make recentf and format-all quieter
Alan Pearce alan@alanpearce.eu
Sun, 02 Apr 2023 13:09:40 +0200
commit

896f1e6e11ea1c5692e3eeadcdc91dec391b8ad3

parent

df6737ebdb7926de959038ea96178aebd1a432cb

1 files changed, 12 insertions(+), 1 deletions(-)

jump to
M user/emacs/init.eluser/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)))