changeset 97699:708c29dada1f

Added newsticker-browse-url-item and configurable layout parameters.
author Ulf Jasper <ulf.jasper@web.de>
date Mon, 25 Aug 2008 17:41:53 +0000
parents 19016ceb3a2e
children 34bc23f0b337
files lisp/net/newst-treeview.el
diffstat 1 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/newst-treeview.el	Mon Aug 25 17:41:16 2008 +0000
+++ b/lisp/net/newst-treeview.el	Mon Aug 25 17:41:53 2008 +0000
@@ -7,7 +7,7 @@
 ;; URL:         http://www.nongnu.org/newsticker
 ;; Created:     2007
 ;; Keywords:    News, RSS, Atom
-;; Time-stamp:  "21. Juni 2008, 17:35:21 (ulf)"
+;; Time-stamp:  "25. August 2008, 19:39:28 (ulf)"
 
 ;; ======================================================================
 
@@ -100,10 +100,24 @@
 
 (defcustom newsticker-treeview-own-frame
   nil
-  "Decides whether newsticker creates and uses its own frame."
+  "Decides whether newsticker treeview creates and uses its own frame."
   :type 'boolean
   :group 'newsticker-treeview)
 
+(defcustom newsticker-treeview-treewindow-width
+  30
+  "Width of tree window in treeview layout.
+See also `newsticker-treeview-listwindow-height'."
+  :type 'int
+  :group 'newsticker-treeview)
+
+(defcustom newsticker-treeview-listwindow-height
+  10
+  "Height of list window in treeview layout.
+See also `newsticker-treeview-treewindow-width'."
+  :type 'int
+  :group 'newsticker-treeview)
+
 (defcustom newsticker-treeview-automatically-mark-displayed-items-as-old
   t
   "Decides whether to automatically mark displayed items as old.
@@ -1379,6 +1393,13 @@
                             newsticker--treeview-current-vfeed)
                         (newsticker--treeview-get-selected-item)))
 
+(defun newsticker-treeview-browse-url-item ()
+  "Convert current item to HTML and call `browse-url' on result."
+  (interactive)
+  (newsticker-browse-url-item (or newsticker--treeview-current-feed
+                                  newsticker--treeview-current-vfeed)
+                              (newsticker--treeview-get-selected-item)))
+
 (defun newsticker--treeview-set-current-node (node)
   "Make NODE the current node."
   (save-excursion
@@ -1809,6 +1830,7 @@
   (let ((map (make-sparse-keymap 'newsticker-treeview-mode-map)))
     (define-key map " " 'newsticker-treeview-next-page)
     (define-key map "a" 'newsticker-add-url)
+    (define-key map "b" 'newsticker-treeview-browse-url-item)
     (define-key map "F" 'newsticker-treeview-prev-feed)
     (define-key map "f" 'newsticker-treeview-next-feed)
     (define-key map "g" 'newsticker-treeview-get-news)
@@ -1923,10 +1945,10 @@
   (setq newsticker--treeview-windows nil)
   (setq newsticker--treeview-buffers nil)
   (delete-other-windows)
-  (split-window-horizontally 25)
+  (split-window-horizontally newsticker-treeview-treewindow-width)
   (add-to-list 'newsticker--treeview-windows (selected-window) t)
   (other-window 1)
-  (split-window-vertically 10)
+  (split-window-vertically newsticker-treeview-listwindow-height)
   (add-to-list 'newsticker--treeview-windows (selected-window) t)
   (other-window 1)
   (add-to-list 'newsticker--treeview-windows (selected-window) t)