Created
January 26, 2014 20:41
-
-
Save jwinder/8639211 to your computer and use it in GitHub Desktop.
Emacs -- filtering out echoed message patterns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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