Add doom*shut-up advisor to core-lib

This commit is contained in:
Henrik Lissner 2018-04-23 00:03:28 -04:00
parent 35e5dbcb11
commit aef9724324
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 8 additions and 7 deletions

View file

@ -297,9 +297,7 @@
(when (bound-and-true-p doom-modules) (when (bound-and-true-p doom-modules)
(section! "test-modules") (section! "test-modules")
(let ((indent 4)) (let ((indent 4))
(defun --quiet-require (orig-fn &rest args) (advice-add #'require :around #'doom*shut-up)
(quiet! (apply orig-fn args)))
(advice-add #'require :around #'--quiet-require)
(maphash (maphash
(lambda (key plist) (lambda (key plist)
(condition-case ex (condition-case ex

View file

@ -97,6 +97,10 @@ compilation."
(save-silently t)) (save-silently t))
,@forms)))) ,@forms))))
(defun doom*shut-up (orig-fn &rest args)
"Generic advisor for silencing noisy functions."
(quiet! (apply orig-fn args)))
(defvar doom--transient-counter 0) (defvar doom--transient-counter 0)
(defmacro add-transient-hook! (hook &rest forms) (defmacro add-transient-hook! (hook &rest forms)
"Attaches transient forms to a HOOK. "Attaches transient forms to a HOOK.

View file

@ -51,6 +51,7 @@ MODES should be one major-mode symbol or a list of them."
(def-package! company-statistics (def-package! company-statistics
:hook (company-mode . company-statistics-mode) :hook (company-mode . company-statistics-mode)
:init (advice-add #'company-statistics-mode :around #'doom*shut-up)
:config (setq company-statistics-file (concat doom-cache-dir "company-stats-cache.el"))) :config (setq company-statistics-file (concat doom-cache-dir "company-stats-cache.el")))

View file

@ -28,10 +28,8 @@
(nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1)))) (nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1))))
sh-imenu-generic-expression) sh-imenu-generic-expression)
(defun +sh*silence-messages (orig-fn &rest args) ;; `sh-set-shell' is chatty about setting up indentation rules
"`sh-set-shell' is chatty about it setting up indentation rules. Shut up." (advice-add #'sh-set-shell :around #'doom*shut-up)
(quiet! (apply orig-fn args)))
(advice-add #'sh-set-shell :around #'+sh*silence-messages)
;; 1. Fontifies variables in double quotes ;; 1. Fontifies variables in double quotes
;; 2. Fontify command substitution in double quotes ;; 2. Fontify command substitution in double quotes