Guest User

Untitled

a guest
Jul 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. (add-hook 'twittering-new-tweets-hook
  2. #'(lambda ()
  3. (let ((n twittering-new-tweets-count)
  4. (statuses twittering-new-tweets-statuses))
  5. (start-process "twittering-notify" nil "notify-send"
  6. "-i" "/usr/share/pixmaps/gnome-emacs.png"
  7. (format "New %d tweet%s"
  8. n (if (> n 1) "s" ""))
  9. (let ((func (lambda (stat)
  10. (concat (cdr (assq 'user-screen-name stat))
  11. ": "
  12. (let ((text (cdr (assq 'text stat))))
  13. (if (> (length text) 20)
  14. (concat (substring text 0 20) "...")
  15. text))))))
  16. (if (< n 4)
  17. (mapconcat func statuses "\n")
  18. (concat (mapconcat func (butlast statuses (- n 3)) "\n") "\n...")))))))
Add Comment
Please, Sign In to add comment