]> code.delx.au - gnu-emacs/blobdiff - lisp/net/newst-reader.el
Merge from emacs-24; up to 2012-12-23T02:41:17Z!rgm@gnu.org
[gnu-emacs] / lisp / net / newst-reader.el
index 1fbba29ec14ab2d3013741a75d07e2ef40c8e972..21bb890f742ddd97cf5b3f8de7457c473f6daf1e 100644 (file)
@@ -1,11 +1,11 @@
 ;;; newst-reader.el --- Generic RSS reader functions.
 
-;; Copyright (C) 2003-201 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2013 Free Software Foundation, Inc.
 
 ;; Author:      Ulf Jasper <ulf.jasper@web.de>
 ;; Filename:    newst-reader.el
 ;; URL:         http://www.nongnu.org/newsticker
-;; Time-stamp:  "13. Mai 2011, 20:55:24 (ulf)"
+;; Time-stamp:  "24. September 2011, 15:47:49 (ulf)"
 ;; Package:     newsticker
 
 ;; ======================================================================
@@ -103,28 +103,11 @@ window is used when filling.  See also `newsticker-justification'."
 (defcustom newsticker-html-renderer
   nil
   "Function for rendering HTML contents.
-If non-nil, newsticker.el will call this function whenever it finds
-HTML-like tags in item descriptions.  Possible functions are, for
-example, `w3m-region', `w3-region', and (if you have htmlr.el installed)
-`newsticker-htmlr-render'.
-
-In order to make sure that the HTML renderer is loaded when you
-run newsticker, you should add one of the following statements to
-your .emacs.  If you use w3m,
-
-  (autoload 'w3m-region \"w3m\"
-    \"Render region in current buffer and replace with result.\" t)
-
-  (autoload 'w3m-toggle-inline-image \"w3m\"
-    \"Toggle the visibility of an image under point.\" t)
-
-or, if you use w3,
-
-  (require 'w3-auto)
-
-or, if you use htmlr
-
-  (require 'htmlr)"
+If non-nil, newsticker.el will call this function whenever it
+finds HTML-like tags in item descriptions.  Possible functions
+are `w3m-region', `w3-region', and `newsticker-htmlr-render'.
+Newsticker automatically loads the respective package w3m, w3, or
+htmlr if this option is set."
   :type '(choice :tag "Function"
                  (const :tag "None" nil)
                  (const :tag "w3" w3-region)
@@ -146,26 +129,23 @@ See `format-time-string' for a list of valid specifiers."
   :group 'newsticker-reader)
 
 (defface newsticker-feed-face
-  '((((class color) (background dark))
-     (:family "sans" :bold t :height 1.2 :foreground "white"))
-    (((class color) (background light))
-     (:family "sans" :bold t :height 1.2 :foreground "black")))
+  '((default :weight bold :height 1.2)
+    (((class color) (background dark))  :foreground "white")
+    (((class color) (background light)) :foreground "black"))
   "Face for news feeds."
   :group 'newsticker-faces)
 
 (defface newsticker-extra-face
-  '((((class color) (background dark))
-     (:italic t :foreground "gray50" :height 0.8))
-    (((class color) (background light))
-     (:italic t :foreground "gray50" :height 0.8)))
+  '((default :slant italic :height 0.8)
+    (((class color) (background dark))  :foreground "gray50")
+    (((class color) (background light)) :foreground "gray50"))
   "Face for newsticker dates."
   :group 'newsticker-faces)
 
 (defface newsticker-enclosure-face
-  '((((class color) (background dark))
-     (:bold t :background "orange"))
-    (((class color) (background light))
-     (:bold t :background "orange")))
+  '((default :weight bold)
+    (((class color) (background dark))  :background "orange")
+    (((class color) (background light)) :background "orange"))
   "Face for enclosed elements."
   :group 'newsticker-faces)
 
@@ -286,6 +266,14 @@ Return the image."
   "Start reading news.  You may want to bind this to a key."
   (interactive)
   (newsticker-start t) ;; will start only if not running
+  ;; Load the html rendering packages
+  (if newsticker-html-renderer
+      (cond ((eq newsticker-html-renderer 'w3m-region)
+             (require 'w3m))
+            ((eq newsticker-html-renderer 'w3-region)
+             (require 'w3-auto))
+            ((eq newsticker-html-renderer 'newsticker-htmlr-render)
+             (require 'htmlr))))
   (funcall newsticker-frontend))
 
 ;; ======================================================================