From f999faf44dd374d9456cc299d1a3a60e7f8cf3bb Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 9 Sep 2021 16:40:54 -0500 Subject: Add suppress-messages --- lisp/acdw.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index 1a7e7f2..cdd6cf9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -461,7 +461,7 @@ Prompt only if there are unsaved changes." (repeat 1 2 digit) (: (any ?a ?A ?p ?P) (any ?m ?M))) (* nonl))) - (ss (sunrise-sunset)) + (ss (acdw/supress-messages #'sunrise-sunset)) (_m (string-match times-regex ss)) (sunrise-time (match-string 1 ss)) (sunset-time (match-string 2 ss))) @@ -469,6 +469,17 @@ Prompt only if there are unsaved changes." (run-at-time sunset-time (* 60 60 24) sunset-command) (run-at-time "12:00am" (* 60 60 24) sunset-command))) +(defun acdw/supress-messages (oldfn &rest args) ; from pkal + "Advice wrapper for suppressing `message'. +OLDFN is the wrapped function, that is passed the arguments +ARGS." + (let ((msg (current-message))) + (prog1 + (let ((inhibit-message t)) + (apply oldfn args)) + (when msg + (message "%s" msg))))) + (defun acdw/setup-fringes () "Set up fringes how I likes 'em." (define-fringe-bitmap 'left-curly-arrow -- cgit 1.4.1-21-gabe81