Created
April 19, 2013 14:53
-
-
Save pnkfelix/5420850 to your computer and use it in GitHub Desktop.
Make emacs say when compilations are finished.
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 terminal-notify (msg &optional title subtitle group) | |
| "Sends a message to the Mac OS X message center" | |
| (let ((infile nil) | |
| (buffer "*terminal-notifier*") | |
| (display t)) | |
| (apply 'call-process | |
| "terminal-notifier" infile buffer display | |
| "-message" msg | |
| (append (if title (list "-title" title) nil) | |
| (if subtitle (list "-subtitle" subtitle) nil) | |
| (if group (list "-group" group) nil)) | |
| ))) | |
| (defun say-when-compilation-finished (buffer string) | |
| "Sends a compile-done message to Mac OS X message center." | |
| ; (terminal-notify string "Compile finished" buffer) | |
| (terminal-notify string "Compile finished" (buffer-name buffer))) | |
| (add-to-list 'compilation-finish-functions 'say-when-compilation-finished) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment