Created
October 28, 2010 04:00
-
-
Save rummelonp/650611 to your computer and use it in GitHub Desktop.
twittering-modeでreply/directmessageが来たときにgrowlを出す設定
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
;; growl | |
(setq growl-program "/usr/local/bin/growlnotify") | |
(defun growl (title message &optional app) | |
(start-process "Growl" "*Growl*" growl-program | |
"-t" title | |
"-m" message | |
"-a" app)) | |
;; twittering mode | |
(require 'twittering-mode) | |
(add-hook 'twittering-new-tweets-hook | |
'(lambda () | |
(let ((spec (car twittering-new-tweets-spec)) | |
(title-format nil)) | |
(cond ((eq spec 'replies) | |
(setq title-format "%sから関連ツイート")) | |
((eq spec 'direct_messages) | |
(setq title-format "%sから新規メッセージ"))) | |
(unless (eq title-format nil) | |
(dolist (el (reverse twittering-new-tweets-statuses)) | |
(growl (format title-format (cdr (assoc 'user-screen-name el))) | |
(format "%s" (cdr (assoc 'text el))) | |
"Emacs")))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment