# HG changeset patch # User Ulf Jasper # Date 1219686076 0 # Node ID 19016ceb3a2e467fe8fb858e6fa0ad89b77766d7 # Parent 04fe7f4789dad430a9dc5ddacd7482fa1734ef6d Added newsticker-browse-url-item. diff -r 04fe7f4789da -r 19016ceb3a2e lisp/net/newst-reader.el --- a/lisp/net/newst-reader.el Mon Aug 25 17:40:49 2008 +0000 +++ b/lisp/net/newst-reader.el Mon Aug 25 17:41:16 2008 +0000 @@ -6,7 +6,7 @@ ;; Author: Ulf Jasper ;; Filename: newst-reader.el ;; URL: http://www.nongnu.org/newsticker -;; Time-stamp: "15. Juni 2008, 09:42:01 (ulf)" +;; Time-stamp: "25. August 2008, 19:35:45 (ulf)" ;; ====================================================================== @@ -1152,6 +1152,32 @@ 'xpm t)) "Image for the browse button.") +(defun newsticker-browse-url-item (feed item) + "Convert FEED ITEM to html and call `browse-url' on result." + (interactive) + (let ((t-file (make-temp-file "newsticker"))) + (with-temp-file t-file + (insert " + + + ") + (insert "

" feed ": " (newsticker--title item) "

") + (insert (format-time-string newsticker-date-format + (newsticker--time item))) + (insert "
") + (insert (or (newsticker--desc item) "[No Description]")) + (when (newsticker--enclosure item) + (insert "

") + (newsticker--insert-enclosure item nil) + (insert "")) + (when (newsticker--extra item) + (insert "

") + (newsticker--print-extra-elements item nil) + (insert "")) + (insert "")) + (browse-url t-file))) + (provide 'newsticker-reader) ;; arch-tag: c604b701-bdf1-4fc1-8d05-5fabd1939533