emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/net/newst-reader.el,v


From: Ulf Jasper
Subject: [Emacs-diffs] Changes to emacs/lisp/net/newst-reader.el,v
Date: Mon, 25 Aug 2008 17:41:16 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Ulf Jasper <u11>        08/08/25 17:41:16

Index: newst-reader.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/net/newst-reader.el,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- newst-reader.el     15 Jun 2008 08:04:13 -0000      1.3
+++ newst-reader.el     25 Aug 2008 17:41:16 -0000      1.4
@@ -6,7 +6,7 @@
 ;; Author:      Ulf Jasper <address@hidden>
 ;; 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 "<?xml version=\"1.0\" encoding=\"utf-8\"?>
+               <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
+               \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\";>
+               <html xmlns=\"http://www.w3.org/1999/xhtml\";>
+               <body>")
+      (insert "<h1>" feed ": " (newsticker--title item) "</h1>")
+      (insert (format-time-string newsticker-date-format
+                                  (newsticker--time item)))
+      (insert "<br/>")
+      (insert (or (newsticker--desc item) "[No Description]"))
+      (when (newsticker--enclosure item)
+        (insert "<br/><hr/><i>")
+        (newsticker--insert-enclosure item nil)
+        (insert "</i>"))
+      (when (newsticker--extra item)
+        (insert "<br/><hr/><tt>")
+        (newsticker--print-extra-elements item nil)
+        (insert "</tt>"))
+      (insert "</body></html>"))
+    (browse-url t-file)))
+
 (provide 'newsticker-reader)
 
 ;; arch-tag: c604b701-bdf1-4fc1-8d05-5fabd1939533




reply via email to

[Prev in Thread] Current Thread [Next in Thread]