Skip to content

Instantly share code, notes, and snippets.

@jwinder
Created January 26, 2014 20:41
Show Gist options
  • Save jwinder/8639211 to your computer and use it in GitHub Desktop.
Save jwinder/8639211 to your computer and use it in GitHub Desktop.
Emacs -- filtering out echoed message patterns
(setq echo-area-silenced-patterns '("Desktop saved"
"Auto saving"
"No changes need to be saved"
"You can run the command"))
(defadvice message (before ignorable-message activate compile)
"Do not echo any messages matching a pattern in `echo-area-silenced-patterns`."
(let ((current-echo (current-message))
(incoming-echo (apply 'format (cons format-string args))))
(when (member-if '(lambda (pattern) (search pattern incoming-echo)) echo-area-silenced-patterns)
(ad-set-arg 0 current-echo))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment