Add suppress-messages
This commit is contained in:
parent
fd5690cd83
commit
f999faf44d
13
lisp/acdw.el
13
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
|
||||
|
|
Loading…
Reference in New Issue