Skip to content

Instantly share code, notes, and snippets.

@re5et
Created December 9, 2013 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save re5et/7878944 to your computer and use it in GitHub Desktop.
Save re5et/7878944 to your computer and use it in GitHub Desktop.
(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