Created
November 24, 2011 13:18
-
-
Save ympbyc/1391329 to your computer and use it in GitHub Desktop.
Tweet the first line of the *terminal* buffer on double-clicks. (for nethack)
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
(set-buffer "*terminal*") | |
(defun get-message-and-tweet () | |
(goto-char (point-min)) | |
(let ((point (point))) | |
(goto-char (line-end-position)) | |
(tweet (buffer-substring point (point))))) | |
;;post to twitter. modify this function to use any other programs than tw4sh | |
(defun tweet (text) | |
(if (> (length text) 0) | |
(call-process "tw4sh" nil "*Messages*" nil "-a" "post" text))) | |
;;affects all buffers. who cares?? | |
(local-set-key [double-mouse-1] 'trigger) | |
(defun trigger (click) | |
(interactive "e") | |
(get-message-and-tweet)) |
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
M-x term | |
nethack | |
M-x load-file | |
/path/to/nethackinTwitterer.el |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment