Created
December 9, 2013 19:09
-
-
Save re5et/7878944 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defun async-command-and-highlight (command highlights &optional output-buffer) | |
(kill-buffer output-buffer) | |
(async-shell-command command output-buffer) | |
(with-current-buffer output-buffer | |
(mapcar | |
(lambda (highlight) | |
(highlight-phrase (car highlight) (cdr highlight))) | |
highlights))) | |
(async-command-and-highlight | |
"ls -la" | |
'(("atom" . hi-pink) | |
("root" . hi-blue) | |
("lrwxrwxrwx" . hi-green)) | |
"*my-test-results*") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment