annotate lisp/net/newst-treeview.el @ 107024:6eaa332dd1b5

Revert code for bug #3643. xfns.c (Fx_create_frame): Remove window size matching code from 2010-01-15. (x_get_current_desktop, x_get_desktop_workarea): Remove
author Jan D. <jan.h.d@swipnet.se>
date Thu, 28 Jan 2010 08:13:47 +0100
parents 1d1d5d9bd884
children 280c8ae2476d 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1 ;;; newst-treeview.el --- Treeview frontend for newsticker.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 106460
diff changeset
3 ;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
4
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
5 ;; Author: Ulf Jasper <ulf.jasper@web.de>
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
6 ;; Filename: newst-treeview.el
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
7 ;; URL: http://www.nongnu.org/newsticker
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
8 ;; Created: 2007
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
9 ;; Keywords: News, RSS, Atom
106460
e341c53bc4af Fixed Bug#5096.
Ulf Jasper <ulf.jasper@web.de>
parents: 106408
diff changeset
10 ;; Time-stamp: "6. Dezember 2009, 19:17:28 (ulf)"
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
11
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
12 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
13
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
14 ;; This file is part of GNU Emacs.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
15
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
16 ;; GNU Emacs is free software: you can redistribute it and/or modify
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
17 ;; it under the terms of the GNU General Public License as published by
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
18 ;; the Free Software Foundation, either version 3 of the License, or
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
19 ;; (at your option) any later version.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
20
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
21 ;; GNU Emacs is distributed in the hope that it will be useful,
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
24 ;; GNU General Public License for more details.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
25
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
26 ;; You should have received a copy of the GNU General Public License
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
27 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
28
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
29 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
30 ;;; Commentary:
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
31
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
32 ;; See newsticker.el
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
33
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
34 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
35 ;;; History:
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
36 ;;
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
37
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
38
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
39 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
40 ;;; Code:
106460
e341c53bc4af Fixed Bug#5096.
Ulf Jasper <ulf.jasper@web.de>
parents: 106408
diff changeset
41 (require 'newst-reader)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
42 (require 'widget)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
43 (require 'tree-widget)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
44 (require 'wid-edit)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
45
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
46 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
47 ;;; Customization
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
48 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
49 (defgroup newsticker-treeview nil
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
50 "Settings for the tree view reader."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
51 :group 'newsticker-reader)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
52
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
53 (defface newsticker-treeview-face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
54 '((((class color) (background dark))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
55 (:family "helvetica" :foreground "misty rose" :bold nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
56 (((class color) (background light))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
57 (:family "helvetica" :foreground "black" :bold nil)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
58 "Face for newsticker tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
59 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
60
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
61 (defface newsticker-treeview-new-face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
62 '((((class color) (background dark))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
63 (:inherit newsticker-treeview-face :bold t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
64 (((class color) (background light))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
65 (:inherit newsticker-treeview-face :bold t)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
66 "Face for newsticker tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
67 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
68
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
69 (defface newsticker-treeview-old-face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
70 '((((class color) (background dark))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
71 (:inherit newsticker-treeview-face))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
72 (((class color) (background light))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
73 (:inherit newsticker-treeview-face)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
74 "Face for newsticker tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
75 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
76
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
77 (defface newsticker-treeview-immortal-face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
78 '((((class color) (background dark))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
79 (:inherit newsticker-treeview-face :foreground "orange" :italic t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
80 (((class color) (background light))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
81 (:inherit newsticker-treeview-face :foreground "blue" :italic t)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
82 "Face for newsticker tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
83 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
84
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
85 (defface newsticker-treeview-obsolete-face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
86 '((((class color) (background dark))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
87 (:inherit newsticker-treeview-face :strike-through t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
88 (((class color) (background light))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
89 (:inherit newsticker-treeview-face :strike-through t)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
90 "Face for newsticker tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
91 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
92
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
93 (defface newsticker-treeview-selection-face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
94 '((((class color) (background dark))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
95 (:background "#bbbbff"))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
96 (((class color) (background light))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
97 (:background "#bbbbff")))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
98 "Face for newsticker selection."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
99 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
100
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
101 (defcustom newsticker-treeview-own-frame
96120
2dfe9a37940f newsticker-treeview-own-frame turned off, tooltips
Ulf Jasper <ulf.jasper@web.de>
parents: 95960
diff changeset
102 nil
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
103 "Decides whether newsticker treeview creates and uses its own frame."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
104 :type 'boolean
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
105 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
106
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
107 (defcustom newsticker-treeview-treewindow-width
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
108 30
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
109 "Width of tree window in treeview layout.
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
110 See also `newsticker-treeview-listwindow-height'."
106111
2a70bc301f41 (newsticker-treeview-treewindow-width)
Glenn Morris <rgm@gnu.org>
parents: 106083
diff changeset
111 :type 'integer
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
112 :group 'newsticker-treeview)
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
113
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
114 (defcustom newsticker-treeview-listwindow-height
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
115 10
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
116 "Height of list window in treeview layout.
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
117 See also `newsticker-treeview-treewindow-width'."
106111
2a70bc301f41 (newsticker-treeview-treewindow-width)
Glenn Morris <rgm@gnu.org>
parents: 106083
diff changeset
118 :type 'integer
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
119 :group 'newsticker-treeview)
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
120
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
121 (defcustom newsticker-treeview-automatically-mark-displayed-items-as-old
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
122 t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
123 "Decides whether to automatically mark displayed items as old.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
124 If t an item is marked as old as soon as it is displayed. This
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
125 applies to newsticker only."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
126 :type 'boolean
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
127 :group 'newsticker-treeview)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
128
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
129 (defvar newsticker-groups
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
130 '("Feeds")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
131 "List of feed groups, used in the treeview frontend.
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
132 First element is a string giving the group name. Remaining
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
133 elements are either strings giving a feed name or lists having
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
134 the same structure as `newsticker-groups'. (newsticker-groups :=
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
135 groupdefinition, groupdefinition := groupname groupcontent*,
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
136 groupcontent := feedname | groupdefinition)
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
137
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
138 Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\")
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
139 \"feed3\")")
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
140
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
141 (defcustom newsticker-groups-filename
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
142 "~/.newsticker-groups"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
143 "Name of the newsticker groups settings file."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
144 :type 'string
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
145 :group 'newsticker-treeview)
104395
df3d3d6c4426 * net/newst-treeview.el (newsticker-groups-filename):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 102979
diff changeset
146 (make-obsolete 'newsticker-groups-filename 'newsticker-dir "23.1")
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
147
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
148 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
149 ;;; internal variables
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
150 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
151 (defvar newsticker--treeview-windows nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
152 (defvar newsticker--treeview-buffers nil)
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
153 (defvar newsticker--treeview-current-feed nil
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
154 "Feed name of currently shown item.")
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
155 (defvar newsticker--treeview-current-vfeed nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
156 (defvar newsticker--treeview-list-show-feed nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
157 (defvar newsticker--saved-window-config nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
158 (defvar newsticker--selection-overlay nil
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
159 "Highlight the selected tree node.")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
160 (defvar newsticker--tree-selection-overlay nil
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
161 "Highlight the selected list item.")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
162 (defvar newsticker--frame nil "Special frame for newsticker windows.")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
163 (defvar newsticker--treeview-list-sort-order 'sort-by-time)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
164 (defvar newsticker--treeview-current-node-id nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
165 (defvar newsticker--treeview-current-tree nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
166 (defvar newsticker--treeview-feed-tree nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
167 (defvar newsticker--treeview-vfeed-tree nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
168
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
169 ;; maps for the clickable portions
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
170 (defvar newsticker--treeview-url-keymap
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
171 (let ((map (make-sparse-keymap 'newsticker--treeview-url-keymap)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
172 (define-key map [mouse-1] 'newsticker-treeview-mouse-browse-url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
173 (define-key map [mouse-2] 'newsticker-treeview-mouse-browse-url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
174 (define-key map "\n" 'newsticker-treeview-browse-url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
175 (define-key map "\C-m" 'newsticker-treeview-browse-url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
176 (define-key map [(control return)] 'newsticker-handle-url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
177 map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
178 "Key map for click-able headings in the newsticker treeview buffers.")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
179
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
180
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
181 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
182 ;;; short cuts
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
183 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
184 (defsubst newsticker--treeview-tree-buffer ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
185 "Return the tree buffer of the newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
186 (nth 0 newsticker--treeview-buffers))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
187 (defsubst newsticker--treeview-list-buffer ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
188 "Return the list buffer of the newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
189 (nth 1 newsticker--treeview-buffers))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
190 (defsubst newsticker--treeview-item-buffer ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
191 "Return the item buffer of the newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
192 (nth 2 newsticker--treeview-buffers))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
193 (defsubst newsticker--treeview-tree-window ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
194 "Return the tree window of the newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
195 (nth 0 newsticker--treeview-windows))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
196 (defsubst newsticker--treeview-list-window ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
197 "Return the list window of the newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
198 (nth 1 newsticker--treeview-windows))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
199 (defsubst newsticker--treeview-item-window ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
200 "Return the item window of the newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
201 (nth 2 newsticker--treeview-windows))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
202
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
203 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
204 ;;; utility functions
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
205 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
206 (defun newsticker--treeview-get-id (parent i)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
207 "Create an id for a newsticker treeview node.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
208 PARENT is the node's parent, I is an integer."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
209 ;;(message "newsticker--treeview-get-id %s"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
210 ;; (format "%s-%d" (widget-get parent :nt-id) i))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
211 (format "%s-%d" (widget-get parent :nt-id) i))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
212
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
213 (defun newsticker--treeview-ids-eq (id1 id2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
214 "Return non-nil if ids ID1 and ID2 are equal."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
215 ;;(message "%s/%s" (or id1 -1) (or id2 -1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
216 (and id1 id2 (string= id1 id2)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
217
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
218 (defun newsticker--treeview-nodes-eq (node1 node2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
219 "Compare treeview nodes NODE1 and NODE2 for equality.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
220 Nodes are equal if the have the same newsticker-id. Note that
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
221 during re-tagging and collapsing/expanding nodes change, while
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
222 their id stays constant."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
223 (let ((id1 (widget-get node1 :nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
224 (id2 (widget-get node2 :nt-id)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
225 ;;(message "%s/%s %s/%s" (widget-get node1 :tag) (widget-get node2 :tag)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
226 ;; (or id1 -1) (or id2 -1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
227 (or (newsticker--treeview-ids-eq id1 id2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
228 (string= (widget-get node1 :tag) (widget-get node2 :tag)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
229
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
230 (defun newsticker--treeview-do-get-node-of-feed (feed-name startnode)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
231 "Recursivly search node for feed FEED-NAME starting from STARTNODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
232 ;;(message "%s/%s" feed-name (widget-get startnode :nt-feed))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
233 (if (string= feed-name (or (widget-get startnode :nt-feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
234 (widget-get startnode :nt-vfeed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
235 (throw 'found startnode)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
236 (let ((children (widget-get startnode :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
237 (dolist (w children)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
238 (newsticker--treeview-do-get-node-of-feed feed-name w)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
239
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
240 (defun newsticker--treeview-get-node-of-feed (feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
241 "Return node for feed FEED-NAME in newsticker treeview tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
242 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
243 (newsticker--treeview-do-get-node-of-feed feed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
244 newsticker--treeview-feed-tree)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
245 (newsticker--treeview-do-get-node-of-feed feed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
246 newsticker--treeview-vfeed-tree)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
247
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
248 (defun newsticker--treeview-do-get-node (id startnode)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
249 "Recursivly search node with ID starting from STARTNODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
250 (if (newsticker--treeview-ids-eq id (widget-get startnode :nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
251 (throw 'found startnode)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
252 (let ((children (widget-get startnode :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
253 (dolist (w children)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
254 (newsticker--treeview-do-get-node id w)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
255
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
256 (defun newsticker--treeview-get-node (id)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
257 "Return node with ID in newsticker treeview tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
258 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
259 (newsticker--treeview-do-get-node id newsticker--treeview-feed-tree)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
260 (newsticker--treeview-do-get-node id newsticker--treeview-vfeed-tree)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
261
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
262 (defun newsticker--treeview-get-current-node ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
263 "Return current node in newsticker treeview tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
264 (newsticker--treeview-get-node newsticker--treeview-current-node-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
265
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
266 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
267
98692
51d93fabb7cf newsticker: declare-function compatibility
Ulf Jasper <ulf.jasper@web.de>
parents: 98614
diff changeset
268 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
269 (declare-function w3m-toggle-inline-images "ext:w3m" (&optional force no-cache))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
270
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
271 (defun newsticker--treeview-render-text (start end)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
272 "Render text between markers START and END."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
273 (if newsticker-html-renderer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
274 (condition-case error-data
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
275 (save-excursion
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
276 (set-marker-insertion-type end t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
277 ;; check whether it is necessary to call html renderer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
278 ;; (regexp inspired by htmlr.el)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
279 (goto-char start)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
280 (when (re-search-forward
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
281 "</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" end t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
282 ;; (message "%s" (newsticker--title item))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
283 (let ((w3m-fill-column (if newsticker-use-full-width
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
284 -1 fill-column))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
285 (w3-maximum-line-length
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
286 (if newsticker-use-full-width nil fill-column)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
287 (save-excursion
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
288 (funcall newsticker-html-renderer start end)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
289 ;;(cond ((eq newsticker-html-renderer 'w3m-region)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
290 ;; (add-text-properties start end (list 'keymap
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
291 ;; w3m-minor-mode-map)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
292 ;;((eq newsticker-html-renderer 'w3-region)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
293 ;;(add-text-properties start end (list 'keymap w3-mode-map))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
294 (if (eq newsticker-html-renderer 'w3m-region)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
295 (w3m-toggle-inline-images t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
296 t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
297 (error
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
298 (message "Error: HTML rendering failed: %s, %s"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
299 (car error-data) (cdr error-data))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
300 nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
301 nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
302
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
303 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
304 ;;; List window
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
305 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
306 (defun newsticker--treeview-list-add-item (item feed &optional show-feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
307 "Add news ITEM for FEED to newsticker treeview list window.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
308 If string SHOW-FEED is non-nil it is shown in the item string."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
309 (setq newsticker--treeview-list-show-feed show-feed)
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
310 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
311 (let* ((inhibit-read-only t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
312 pos1 pos2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
313 (goto-char (point-max))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
314 (setq pos1 (point-marker))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
315 (insert " ")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
316 (insert (propertize " " 'display '(space :align-to 2)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
317 (insert (if show-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
318 (concat
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
319 (substring
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
320 (format "%-10s" (newsticker--real-feed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
321 feed))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
322 0 10)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
323 (propertize " " 'display '(space :align-to 12)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
324 ""))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
325 (insert (format-time-string "%d.%m.%y, %H:%M"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
326 (newsticker--time item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
327 (insert (propertize " " 'display
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
328 (list 'space :align-to (if show-feed 28 18))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
329 (setq pos2 (point-marker))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
330 (insert (newsticker--title item))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
331 (insert "\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
332 (newsticker--treeview-render-text pos2 (point-marker))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
333 (goto-char pos2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
334 (while (search-forward "\n" nil t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
335 (replace-match " "))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
336 (let ((map (make-sparse-keymap)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
337 (define-key map [mouse-1] 'newsticker-treeview-tree-click)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
338 (define-key map "\n" 'newsticker-treeview-show-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
339 (define-key map "\C-m" 'newsticker-treeview-show-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
340 (add-text-properties pos1 (point-max)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
341 (list :nt-item item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
342 :nt-feed feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
343 :nt-link (newsticker--link item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
344 'mouse-face 'highlight
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
345 'keymap map
96120
2dfe9a37940f newsticker-treeview-own-frame turned off, tooltips
Ulf Jasper <ulf.jasper@web.de>
parents: 95960
diff changeset
346 'help-echo (buffer-substring pos2
2dfe9a37940f newsticker-treeview-own-frame turned off, tooltips
Ulf Jasper <ulf.jasper@web.de>
parents: 95960
diff changeset
347 (point-max)))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
348 (insert "\n"))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
349
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
350 (defun newsticker--treeview-list-clear ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
351 "Clear the newsticker treeview list window."
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
352 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
353 (let ((inhibit-read-only t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
354 (erase-buffer)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
355 (kill-all-local-variables)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
356 (remove-overlays))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
357
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
358 (defun newsticker--treeview-list-items-with-age-callback (widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
359 changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
360 &rest ages)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
361 "Fill newsticker treeview list window with items of certain age.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
362 This is a callback function for the treeview nodes.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
363 Argument WIDGET is the calling treeview widget.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
364 Argument CHANGED-WIDGET is the widget that actually has changed.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
365 Optional argument AGES is the list of ages that are to be shown."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
366 (newsticker--treeview-list-clear)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
367 (widget-put widget :nt-selected t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
368 (apply 'newsticker--treeview-list-items-with-age ages))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
369
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
370 (defun newsticker--treeview-list-items-with-age (&rest ages)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
371 "Actually fill newsticker treeview list window with items of certain age.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
372 AGES is the list of ages that are to be shown."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
373 (mapc (lambda (feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
374 (let ((feed-name-symbol (intern (car feed))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
375 (mapc (lambda (item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
376 (when (memq (newsticker--age item) ages)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
377 (newsticker--treeview-list-add-item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
378 item feed-name-symbol t)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
379 (newsticker--treeview-list-sort-items
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
380 (cdr (newsticker--cache-get-feed feed-name-symbol))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
381 (append newsticker-url-list-defaults newsticker-url-list))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
382 (newsticker--treeview-list-update nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
383
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
384 (defun newsticker--treeview-list-new-items (widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
385 &optional event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
386 "Fill newsticker treeview list window with new items.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
387 This is a callback function for the treeview nodes.
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
388 Argument WIDGET is the calling treeview widget.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
389 Argument CHANGED-WIDGET is the widget that actually has changed.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
390 Optional argument EVENT is the mouse event that triggered this action."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
391 (newsticker--treeview-list-items-with-age-callback widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
392 'new)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
393 (newsticker--treeview-item-show-text
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
394 "New items"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
395 "This is a virtual feed containing all new items"))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
396
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
397 (defun newsticker--treeview-list-immortal-items (widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
398 &optional event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
399 "Fill newsticker treeview list window with immortal items.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
400 This is a callback function for the treeview nodes.
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
401 Argument WIDGET is the calling treeview widget.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
402 Argument CHANGED-WIDGET is the widget that actually has changed.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
403 Optional argument EVENT is the mouse event that triggered this action."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
404 (newsticker--treeview-list-items-with-age-callback widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
405 'immortal)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
406 (newsticker--treeview-item-show-text
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
407 "Immortal items"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
408 "This is a virtual feed containing all immortal items."))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
409
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
410 (defun newsticker--treeview-list-obsolete-items (widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
411 &optional event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
412 "Fill newsticker treeview list window with obsolete items.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
413 This is a callback function for the treeview nodes.
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
414 Argument WIDGET is the calling treeview widget.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
415 Argument CHANGED-WIDGET is the widget that actually has changed.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
416 Optional argument EVENT is the mouse event that triggered this action."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
417 (newsticker--treeview-list-items-with-age-callback widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
418 'obsolete)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
419 (newsticker--treeview-item-show-text
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
420 "Obsolete items"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
421 "This is a virtual feed containing all obsolete items."))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
422
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
423 (defun newsticker--treeview-list-all-items (widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
424 &optional event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
425 "Fill newsticker treeview list window with all items.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
426 This is a callback function for the treeview nodes.
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
427 Argument WIDGET is the calling treeview widget.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
428 Argument CHANGED-WIDGET is the widget that actually has changed.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
429 Optional argument EVENT is the mouse event that triggered this action."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
430 (newsticker--treeview-list-items-with-age-callback widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
431 event 'new 'old
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
432 'obsolete 'immortal)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
433 (newsticker--treeview-item-show-text
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
434 "All items"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
435 "This is a virtual feed containing all items."))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
436
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
437 (defun newsticker--treeview-list-items-v (vfeed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
438 "List items for virtual feed VFEED-NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
439 (when vfeed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
440 (cond ((string-match "\\*new\\*" vfeed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
441 (newsticker--treeview-list-items-with-age 'new))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
442 ((string-match "\\*immortal\\*" vfeed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
443 (newsticker--treeview-list-items-with-age 'immortal))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
444 ((string-match "\\*old\\*" vfeed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
445 (newsticker--treeview-list-items-with-age 'old nil)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
446 (newsticker--treeview-list-update nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
447 ))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
448
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
449 (defun newsticker--treeview-list-items (feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
450 "List items for feed FEED-NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
451 (when feed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
452 (if (newsticker--treeview-virtual-feed-p feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
453 (newsticker--treeview-list-items-v feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
454 (mapc (lambda (item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
455 (if (eq (newsticker--age item) 'feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
456 (newsticker--treeview-item-show item (intern feed-name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
457 (newsticker--treeview-list-add-item item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
458 (intern feed-name))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
459 (newsticker--treeview-list-sort-items
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
460 (cdr (newsticker--cache-get-feed (intern feed-name)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
461 (newsticker--treeview-list-update nil))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
462
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
463 (defun newsticker--treeview-list-feed-items (widget changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
464 &optional event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
465 "Callback function for listing feed items.
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
466 Argument WIDGET is the calling treeview widget.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
467 Argument CHANGED-WIDGET is the widget that actually has changed.
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
468 Optional argument EVENT is the mouse event that triggered this action."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
469 (newsticker--treeview-list-clear)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
470 (widget-put widget :nt-selected t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
471 (let ((feed-name (widget-get widget :nt-feed))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
472 (vfeed-name (widget-get widget :nt-vfeed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
473 (if feed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
474 (newsticker--treeview-list-items feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
475 (newsticker--treeview-list-items-v vfeed-name))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
476
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
477 (defun newsticker--treeview-list-compare-item-by-age (item1 item2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
478 "Compare two news items ITEM1 and ITEM2 wrt age."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
479 (catch 'result
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
480 (let ((age1 (newsticker--age item1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
481 (age2 (newsticker--age item2)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
482 (cond ((eq age1 'new)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
483 t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
484 ((eq age1 'immortal)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
485 (cond ((eq age2 'new)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
486 t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
487 ((eq age2 'immortal)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
488 t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
489 (t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
490 nil)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
491 ((eq age1 'old)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
492 (cond ((eq age2 'new)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
493 nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
494 ((eq age2 'immortal)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
495 nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
496 ((eq age2 'old)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
497 nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
498 (t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
499 t)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
500 (t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
501 nil)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
502
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
503 (defun newsticker--treeview-list-compare-item-by-age-reverse (item1 item2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
504 "Compare two news items ITEM1 and ITEM2 wrt age in reverse order."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
505 (newsticker--treeview-list-compare-item-by-age item2 item1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
506
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
507 (defun newsticker--treeview-list-compare-item-by-time (item1 item2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
508 "Compare two news items ITEM1 and ITEM2 wrt time values."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
509 (newsticker--cache-item-compare-by-time item1 item2))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
510
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
511 (defun newsticker--treeview-list-compare-item-by-time-reverse (item1 item2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
512 "Compare two news items ITEM1 and ITEM2 wrt time values in reverse order."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
513 (newsticker--cache-item-compare-by-time item2 item1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
514
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
515 (defun newsticker--treeview-list-compare-item-by-title (item1 item2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
516 "Compare two news items ITEM1 and ITEM2 wrt title."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
517 (newsticker--cache-item-compare-by-title item1 item2))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
518
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
519 (defun newsticker--treeview-list-compare-item-by-title-reverse (item1 item2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
520 "Compare two news items ITEM1 and ITEM2 wrt title in reverse order."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
521 (newsticker--cache-item-compare-by-title item2 item1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
522
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
523 (defun newsticker--treeview-list-sort-items (items)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
524 "Return sorted copy of list ITEMS.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
525 The sort function is chosen according to the value of
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
526 `newsticker--treeview-list-sort-order'."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
527 (let ((sort-fun
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
528 (cond ((eq newsticker--treeview-list-sort-order 'sort-by-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
529 'newsticker--treeview-list-compare-item-by-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
530 ((eq newsticker--treeview-list-sort-order
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
531 'sort-by-age-reverse)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
532 'newsticker--treeview-list-compare-item-by-age-reverse)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
533 ((eq newsticker--treeview-list-sort-order 'sort-by-time)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
534 'newsticker--treeview-list-compare-item-by-time)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
535 ((eq newsticker--treeview-list-sort-order
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
536 'sort-by-time-reverse)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
537 'newsticker--treeview-list-compare-item-by-time-reverse)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
538 ((eq newsticker--treeview-list-sort-order 'sort-by-title)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
539 'newsticker--treeview-list-compare-item-by-title)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
540 ((eq newsticker--treeview-list-sort-order
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
541 'sort-by-title-reverse)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
542 'newsticker--treeview-list-compare-item-by-title-reverse)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
543 (t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
544 'newsticker--treeview-list-compare-item-by-title))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
545 (sort (copy-sequence items) sort-fun)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
546
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
547 (defun newsticker--treeview-list-update-faces ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
548 "Update faces in the treeview list buffer."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
549 (let (pos-sel)
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
550 (with-current-buffer (newsticker--treeview-list-buffer)
106083
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
551 (save-excursion
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
552 (let ((inhibit-read-only t))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
553 (goto-char (point-min))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
554 (while (not (eobp))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
555 (let* ((pos (point-at-eol))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
556 (item (get-text-property (point) :nt-item))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
557 (age (newsticker--age item))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
558 (selected (get-text-property (point) :nt-selected))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
559 (face (cond ((eq age 'new)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
560 'newsticker-treeview-new-face)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
561 ((eq age 'old)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
562 'newsticker-treeview-old-face)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
563 ((eq age 'immortal)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
564 'newsticker-treeview-immortal-face)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
565 ((eq age 'obsolete)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
566 'newsticker-treeview-obsolete-face)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
567 (t
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
568 'bold))))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
569 (put-text-property (point) pos 'face face)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
570 (if selected
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
571 (move-overlay newsticker--selection-overlay (point)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
572 (1+ pos) ;include newline
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
573 (current-buffer)))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
574 (if selected (setq pos-sel (point)))
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
575 (forward-line 1)
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
576 (beginning-of-line)))))) ;; FIXME!?
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
577 (when pos-sel
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
578 (if (window-live-p (newsticker--treeview-list-window))
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
579 (set-window-point (newsticker--treeview-list-window) pos-sel)))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
580
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
581 (defun newsticker--treeview-list-clear-highlight ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
582 "Clear the highlight in the treeview list buffer."
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
583 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
584 (let ((inhibit-read-only t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
585 (put-text-property (point-min) (point-max) :nt-selected nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
586 (newsticker--treeview-list-update-faces)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
587
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
588 (defun newsticker--treeview-list-update-highlight ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
589 "Update the highlight in the treeview list buffer."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
590 (newsticker--treeview-list-clear-highlight)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
591 (let (pos num-lines)
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
592 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
593 (let ((inhibit-read-only t))
106083
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
594 (put-text-property (point-at-bol) (point-at-eol) :nt-selected t))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
595 (newsticker--treeview-list-update-faces))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
596
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
597 (defun newsticker--treeview-list-highlight-start ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
598 "Return position of selection in treeview list buffer."
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
599 (with-current-buffer (newsticker--treeview-list-buffer)
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
600 (save-excursion
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
601 (goto-char (point-min))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
602 (next-single-property-change (point) :nt-selected))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
603
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
604 (defun newsticker--treeview-list-update (clear-buffer)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
605 "Update the faces and highlight in the treeview list buffer.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
606 If CLEAR-BUFFER is non-nil the list buffer is completely erased."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
607 (save-excursion
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
608 (if (window-live-p (newsticker--treeview-list-window))
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
609 (set-window-buffer (newsticker--treeview-list-window)
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
610 (newsticker--treeview-list-buffer)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
611 (set-buffer (newsticker--treeview-list-buffer))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
612 (if clear-buffer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
613 (let ((inhibit-read-only t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
614 (erase-buffer)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
615 (newsticker-treeview-list-mode)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
616 (newsticker--treeview-list-update-faces)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
617 (goto-char (point-min))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
618
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
619 (defvar newsticker-treeview-list-sort-button-map
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
620 (let ((map (make-sparse-keymap)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
621 (define-key map [header-line mouse-1]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
622 'newsticker--treeview-list-sort-by-column)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
623 (define-key map [header-line mouse-2]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
624 'newsticker--treeview-list-sort-by-column)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
625 map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
626 "Local keymap for newsticker treeview list window sort buttons.")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
627
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
628 (defun newsticker--treeview-list-sort-by-column (&optional event)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
629 "Sort the newsticker list window buffer by the column clicked on.
96153
04289a261fac newsticker: window config fix, doc fixes
Ulf Jasper <ulf.jasper@web.de>
parents: 96120
diff changeset
630 Optional argument EVENT is the mouse event that triggered this action."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
631 (interactive (list last-input-event))
98614
4890ebba8627 newsticker--treeview-list-sort-by-column: variable name e vs. event
Ulf Jasper <ulf.jasper@web.de>
parents: 97699
diff changeset
632 (if event (mouse-select-window event))
4890ebba8627 newsticker--treeview-list-sort-by-column: variable name e vs. event
Ulf Jasper <ulf.jasper@web.de>
parents: 97699
diff changeset
633 (let* ((pos (event-start event))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
634 (obj (posn-object pos))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
635 (sort-order (if obj
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
636 (get-text-property (cdr obj) 'sort-order (car obj))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
637 (get-text-property (posn-point pos) 'sort-order))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
638 (setq newsticker--treeview-list-sort-order
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
639 (cond ((eq sort-order 'sort-by-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
640 (if (eq newsticker--treeview-list-sort-order 'sort-by-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
641 'sort-by-age-reverse
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
642 'sort-by-age))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
643 ((eq sort-order 'sort-by-time)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
644 (if (eq newsticker--treeview-list-sort-order 'sort-by-time)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
645 'sort-by-time-reverse
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
646 'sort-by-time))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
647 ((eq sort-order 'sort-by-title)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
648 (if (eq newsticker--treeview-list-sort-order 'sort-by-title)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
649 'sort-by-title-reverse
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
650 'sort-by-title))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
651 (newsticker-treeview-update)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
652
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
653 (defun newsticker-treeview-list-make-sort-button (name sort-order)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
654 "Create propertized string for headerline button.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
655 NAME is the button text, SORT-ORDER is the associated sort order
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
656 for the button."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
657 (let ((face (if (string-match (symbol-name sort-order)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
658 (symbol-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
659 newsticker--treeview-list-sort-order))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
660 'bold
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
661 'header-line)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
662 (propertize name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
663 'sort-order sort-order
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
664 'help-echo (concat "Sort by " name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
665 'mouse-face 'highlight
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
666 'face face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
667 'keymap newsticker-treeview-list-sort-button-map)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
668
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
669 (defun newsticker--treeview-list-select (item)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
670 "Select ITEM in treeview's list buffer."
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
671 (newsticker--treeview-list-clear-highlight)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
672 (let (pos num-lines)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
673 (save-current-buffer
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
674 (set-buffer (newsticker--treeview-list-buffer))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
675 (goto-char (point-min))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
676 (catch 'found
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
677 (while t
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
678 (let ((it (get-text-property (point) :nt-item)))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
679 (when (eq it item)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
680 (newsticker--treeview-list-update-highlight)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
681 (newsticker--treeview-list-update-faces)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
682 (newsticker--treeview-item-show
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
683 item (get-text-property (point) :nt-feed))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
684 (throw 'found t)))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
685 (forward-line 1)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
686 (when (eobp)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
687 (goto-char (point-min))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
688 (throw 'found nil)))))))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
689
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
690 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
691 ;;; item window
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
692 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
693 (defun newsticker--treeview-item-show-text (title description)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
694 "Show text in treeview item buffer consisting of TITLE and DESCRIPTION."
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
695 (with-current-buffer (newsticker--treeview-item-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
696 (when (fboundp 'w3m-process-stop)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
697 (w3m-process-stop (current-buffer)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
698 (let ((inhibit-read-only t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
699 (erase-buffer)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
700 (kill-all-local-variables)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
701 (remove-overlays)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
702 (insert title)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
703 (put-text-property (point-min) (point) 'face 'newsticker-feed-face)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
704 (insert "\n\n" description)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
705 (when newsticker-justification
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
706 (fill-region (point-min) (point-max) newsticker-justification))
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
707 (newsticker-treeview-item-mode)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
708 (goto-char (point-min)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
709
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
710 (defun newsticker--treeview-item-show (item feed-name-symbol)
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
711 "Show news ITEM coming from FEED-NAME-SYMBOL in treeview item buffer."
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
712 (setq newsticker--treeview-current-feed (symbol-name feed-name-symbol))
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
713 (with-current-buffer (newsticker--treeview-item-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
714 (when (fboundp 'w3m-process-stop)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
715 (w3m-process-stop (current-buffer)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
716 (let ((inhibit-read-only t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
717 (is-rendered-HTML nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
718 pos
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
719 (marker1 (make-marker))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
720 (marker2 (make-marker)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
721 (erase-buffer)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
722 (kill-all-local-variables)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
723 (remove-overlays)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
724
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
725 (when (and item feed-name-symbol)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
726 (let ((wwidth (1- (window-width (newsticker--treeview-item-window)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
727 (if newsticker-use-full-width
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
728 (set (make-local-variable 'fill-column) wwidth))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
729 (set (make-local-variable 'fill-column) (min fill-column
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
730 wwidth)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
731 (let ((desc (newsticker--desc item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
732 (insert "\n" (or desc "[No Description]")))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
733 (set-marker marker1 (1+ (point-min)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
734 (set-marker marker2 (point-max))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
735 (setq is-rendered-HTML (newsticker--treeview-render-text marker1
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
736 marker2))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
737 (when (and newsticker-justification
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
738 (not is-rendered-HTML))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
739 (fill-region marker1 marker2 newsticker-justification))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
740
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
741 (newsticker-treeview-item-mode)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
742 (goto-char (point-min))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
743 ;; insert logo at top
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
744 (let* ((newsticker-enable-logo-manipulations nil)
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
745 (img (newsticker--image-read feed-name-symbol nil)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
746 (if (and (display-images-p) img)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
747 (newsticker--insert-image img (car item))
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
748 (insert (newsticker--real-feed-name feed-name-symbol))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
749 (add-text-properties (point-min) (point)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
750 (list 'face 'newsticker-feed-face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
751 'mouse-face 'highlight
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
752 'help-echo "Visit in web browser."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
753 :nt-link (newsticker--link item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
754 'keymap newsticker--treeview-url-keymap))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
755 (setq pos (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
756
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
757 (insert "\n\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
758 ;; insert title
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
759 (setq pos (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
760 (insert (newsticker--title item) "\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
761 (set-marker marker1 pos)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
762 (set-marker marker2 (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
763 (newsticker--treeview-render-text marker1 marker2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
764 (put-text-property pos (point) 'face 'newsticker-treeview-new-face)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
765 (goto-char marker2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
766 (delete-char -1)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
767 (insert "\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
768 (put-text-property marker2 (point) 'face 'newsticker-treeview-face)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
769 (set-marker marker2 (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
770 (when newsticker-justification
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
771 (fill-region marker1 marker2 newsticker-justification))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
772 (goto-char marker2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
773 (add-text-properties marker1 (1- (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
774 (list 'mouse-face 'highlight
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
775 'help-echo "Visit in web browser."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
776 :nt-link (newsticker--link item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
777 'keymap newsticker--treeview-url-keymap))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
778 (insert (format-time-string newsticker-date-format
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
779 (newsticker--time item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
780 (insert "\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
781 (setq pos (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
782 (insert "\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
783 ;; insert enclosures and rest at bottom
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
784 (goto-char (point-max))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
785 (insert "\n\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
786 (setq pos (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
787 (newsticker--insert-enclosure item newsticker--treeview-url-keymap)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
788 (put-text-property pos (point) 'face 'newsticker-enclosure-face)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
789 (setq pos (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
790 (insert "\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
791 (newsticker--print-extra-elements item newsticker--treeview-url-keymap)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
792 (put-text-property pos (point) 'face 'newsticker-extra-face)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
793 (goto-char (point-min)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
794 (if (and newsticker-treeview-automatically-mark-displayed-items-as-old
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
795 item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
796 (memq (newsticker--age item) '(new obsolete)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
797 (let ((newsticker-treeview-automatically-mark-displayed-items-as-old nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
798 (newsticker-treeview-mark-item-old t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
799 (newsticker--treeview-list-update-faces)))
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
800 (if (window-live-p (newsticker--treeview-item-window))
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
801 (set-window-point (newsticker--treeview-item-window) 1)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
802
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
803 (defun newsticker--treeview-item-update ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
804 "Update the treeview item buffer and window."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
805 (save-excursion
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
806 (if (window-live-p (newsticker--treeview-item-window))
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
807 (set-window-buffer (newsticker--treeview-item-window)
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
808 (newsticker--treeview-item-buffer)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
809 (set-buffer (newsticker--treeview-item-buffer))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
810 (let ((inhibit-read-only t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
811 (erase-buffer))
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
812 (newsticker-treeview-item-mode)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
813
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
814 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
815 ;;; Tree window
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
816 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
817 (defun newsticker--treeview-tree-expand (tree)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
818 "Expand TREE.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
819 Callback function for tree widget that adds nodes for feeds and subgroups."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
820 (tree-widget-set-theme "folder")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
821 (let ((group (widget-get tree :nt-group))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
822 (i 0)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
823 (nt-id ""))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
824 (mapcar (lambda (g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
825 (setq nt-id (newsticker--treeview-get-id tree i))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
826 (setq i (1+ i))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
827 (if (listp g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
828 (let* ((g-name (car g)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
829 `(tree-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
830 :tag ,(newsticker--treeview-tree-get-tag g-name nil nt-id)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
831 :expander newsticker--treeview-tree-expand
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
832 :expander-p (lambda (&rest ignore) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
833 :nt-group ,(cdr g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
834 :nt-feed ,g-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
835 :nt-id ,nt-id
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
836 :keep (:nt-feed :num-new :nt-id :open);; :nt-group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
837 :open nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
838 (let ((tag (newsticker--treeview-tree-get-tag g nil nt-id)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
839 `(item :tag ,tag
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
840 :leaf-icon newsticker--tree-widget-leaf-icon
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
841 :nt-feed ,g
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
842 :action newsticker--treeview-list-feed-items
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
843 :nt-id ,nt-id
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
844 :keep (:nt-id)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
845 :open t))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
846 group)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
847
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
848 (defun newsticker--treeview-tree-expand-status (tree &optional changed-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
849 event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
850 "Expand the vfeed TREE.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
851 Optional arguments CHANGED-WIDGET and EVENT are ignored."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
852 (tree-widget-set-theme "folder")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
853 (list `(item :tag ,(newsticker--treeview-tree-get-tag nil "new")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
854 :nt-vfeed "new"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
855 :action newsticker--treeview-list-new-items
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
856 :nt-id ,(newsticker--treeview-get-id tree 0)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
857 :keep (:nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
858 `(item :tag ,(newsticker--treeview-tree-get-tag nil "immortal")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
859 :nt-vfeed "immortal"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
860 :action newsticker--treeview-list-immortal-items
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
861 :nt-id ,(newsticker--treeview-get-id tree 1)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
862 :keep (:nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
863 `(item :tag ,(newsticker--treeview-tree-get-tag nil "obsolete")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
864 :nt-vfeed "obsolete"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
865 :action newsticker--treeview-list-obsolete-items
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
866 :nt-id ,(newsticker--treeview-get-id tree 2)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
867 :keep (:nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
868 `(item :tag ,(newsticker--treeview-tree-get-tag nil "all")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
869 :nt-vfeed "all"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
870 :action newsticker--treeview-list-all-items
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
871 :nt-id ,(newsticker--treeview-get-id tree 3)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
872 :keep (:nt-id))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
873
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
874 (defun newsticker--treeview-virtual-feed-p (feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
875 "Return non-nil if FEED-NAME is a virtual feed."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
876 (string-match "\\*.*\\*" feed-name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
877
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
878 (define-widget 'newsticker--tree-widget-leaf-icon 'tree-widget-icon
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
879 "Icon for a tree-widget leaf node."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
880 :tag "O"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
881 :glyph-name "leaf"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
882 :button-face 'default)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
883
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
884 (defun newsticker--treeview-tree-update ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
885 "Update treeview tree buffer and window."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
886 (save-excursion
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
887 (if (window-live-p (newsticker--treeview-tree-window))
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
888 (set-window-buffer (newsticker--treeview-tree-window)
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
889 (newsticker--treeview-tree-buffer)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
890 (set-buffer (newsticker--treeview-tree-buffer))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
891 (kill-all-local-variables)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
892 (let ((inhibit-read-only t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
893 (erase-buffer)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
894 (tree-widget-set-theme "folder")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
895 (setq newsticker--treeview-feed-tree
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
896 (widget-create 'tree-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
897 :tag (newsticker--treeview-propertize-tag
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
898 "Feeds" 0 "feeds")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
899 :expander 'newsticker--treeview-tree-expand
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
900 :expander-p (lambda (&rest ignore) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
901 :leaf-icon 'newsticker--tree-widget-leaf-icon
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
902 :nt-group (cdr newsticker-groups)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
903 :nt-id "feeds"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
904 :keep '(:nt-id)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
905 :open t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
906 (setq newsticker--treeview-vfeed-tree
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
907 (widget-create 'tree-widget
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
908 :tag (newsticker--treeview-propertize-tag
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
909 "Virtual Feeds" 0 "vfeeds")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
910 :expander 'newsticker--treeview-tree-expand-status
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
911 :expander-p (lambda (&rest ignore) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
912 :leaf-icon 'newsticker--tree-widget-leaf-icon
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
913 :nt-id "vfeeds"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
914 :keep '(:nt-id)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
915 :open t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
916 (use-local-map widget-keymap)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
917 (widget-setup))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
918 (newsticker-treeview-mode)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
919
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
920 (defun newsticker--treeview-propertize-tag (tag &optional num-new nt-id feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
921 vfeed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
922 "Return propertized copy of string TAG.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
923 Optional argument NUM-NEW is used for choosing face, other
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
924 arguments NT-ID, FEED, and VFEED are added as properties."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
925 ;;(message "newsticker--treeview-propertize-tag '%s' %s" feed nt-id)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
926 (let ((face 'newsticker-treeview-face)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
927 (map (make-sparse-keymap)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
928 (if (and num-new (> num-new 0))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
929 (setq face 'newsticker-treeview-new-face))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
930 (define-key map [mouse-1] 'newsticker-treeview-tree-click)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
931 (define-key map "\n" 'newsticker-treeview-tree-do-click)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
932 (define-key map "\C-m" 'newsticker-treeview-tree-do-click)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
933 (propertize tag 'face face 'keymap map
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
934 :nt-id nt-id
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
935 :nt-feed feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
936 :nt-vfeed vfeed
96120
2dfe9a37940f newsticker-treeview-own-frame turned off, tooltips
Ulf Jasper <ulf.jasper@web.de>
parents: 95960
diff changeset
937 'help-echo tag
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
938 'mouse-face 'highlight)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
939
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
940 (defun newsticker--treeview-tree-get-tag (feed-name vfeed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
941 &optional nt-id)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
942 "Return a tag string for either FEED-NAME or, if it is nil, for VFEED-NAME.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
943 Optional argument NT-ID is added to the tag's properties."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
944 (let (tag (num-new 0))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
945 (cond (vfeed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
946 (cond ((string= vfeed-name "new")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
947 (setq num-new (newsticker--stat-num-items-total 'new))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
948 (setq tag (format "New items (%d)" num-new)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
949 ((string= vfeed-name "immortal")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
950 (setq num-new (newsticker--stat-num-items-total 'immortal))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
951 (setq tag (format "Immortal items (%d)" num-new)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
952 ((string= vfeed-name "obsolete")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
953 (setq num-new (newsticker--stat-num-items-total 'obsolete))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
954 (setq tag (format "Obsolete items (%d)" num-new)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
955 ((string= vfeed-name "all")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
956 (setq num-new (newsticker--stat-num-items-total))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
957 (setq tag (format "All items (%d)" num-new)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
958 (feed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
959 (setq num-new (newsticker--stat-num-items-for-group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
960 (intern feed-name) 'new 'immortal))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
961 (setq tag
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
962 (format "%s (%d)"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
963 (newsticker--real-feed-name (intern feed-name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
964 num-new))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
965 (if tag
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
966 (newsticker--treeview-propertize-tag tag num-new
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
967 nt-id
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
968 feed-name vfeed-name))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
969
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
970 (defun newsticker--stat-num-items-for-group (feed-name-symbol &rest ages)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
971 "Count number of items in feed FEED-NAME-SYMBOL that have an age matching AGES."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
972 ;;(message "newsticker--stat-num-items-for-group %s %s" feed-name-symbol ages)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
973 (let ((result (apply 'newsticker--stat-num-items feed-name-symbol ages)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
974 (mapc (lambda (f-n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
975 (setq result (+ result
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
976 (apply 'newsticker--stat-num-items (intern f-n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
977 ages))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
978 (newsticker--group-get-feeds
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
979 (newsticker--group-get-group (symbol-name feed-name-symbol)) t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
980 result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
981
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
982 (defun newsticker--treeview-count-node-items (feed &optional isvirtual)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
983 "Count number of relevant items for a treeview node.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
984 FEED gives the name of the feed or group. If ISVIRTUAL is non-nil
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
985 the feed is a virtual feed."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
986 (let* ((num-new 0))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
987 (if feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
988 (if isvirtual
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
989 (cond ((string= feed "new")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
990 (setq num-new (newsticker--stat-num-items-total 'new)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
991 ((string= feed "immortal")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
992 (setq num-new (newsticker--stat-num-items-total 'immortal)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
993 ((string= feed "obsolete")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
994 (setq num-new (newsticker--stat-num-items-total 'obsolete)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
995 ((string= feed "all")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
996 (setq num-new (newsticker--stat-num-items-total))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
997 (setq num-new (newsticker--stat-num-items-for-group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
998 (intern feed) 'new 'immortal))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
999 num-new))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1000
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1001 (defun newsticker--treeview-tree-update-tag (w &optional recursive
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1002 &rest ignore)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1003 "Update tag for tree widget W.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1004 If RECURSIVE is non-nil recursively update parent widgets as
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1005 well. Argument IGNORE is ignored. Note that this function, if
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1006 called recursively, makes w invalid. You should keep w's nt-id in
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1007 that case."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1008 (let* ((parent (widget-get w :parent))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1009 (feed (or (widget-get w :nt-feed) (widget-get parent :nt-feed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1010 (vfeed (or (widget-get w :nt-vfeed) (widget-get parent :nt-vfeed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1011 (nt-id (or (widget-get w :nt-id) (widget-get parent :nt-id)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1012 (num-new (newsticker--treeview-count-node-items (or feed vfeed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1013 vfeed))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1014 (tag (newsticker--treeview-tree-get-tag feed vfeed nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1015 (n (widget-get w :node)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1016 (if parent
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1017 (if recursive
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1018 (newsticker--treeview-tree-update-tag parent)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1019 (when tag
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1020 (when n
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1021 (widget-put n :tag tag))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1022 (widget-put w :num-new num-new)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1023 (widget-put w :tag tag)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1024 (when (marker-position (widget-get w :from))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1025 (let ((p (point))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1026 (notify (widget-get w :notify)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1027 ;; FIXME: This moves point!!!!
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1028 (with-current-buffer (newsticker--treeview-tree-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1029 (widget-value-set w (widget-value w)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1030 (goto-char p))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1031
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1032 (defun newsticker--treeview-tree-do-update-tags (widget)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1033 "Actually recursively update tags for WIDGET."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1034 (save-excursion
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1035 (let ((children (widget-get widget :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1036 (dolist (w children)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1037 (newsticker--treeview-tree-do-update-tags w))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1038 (newsticker--treeview-tree-update-tag widget))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1039
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1040 (defun newsticker--treeview-tree-update-tags (&rest ignore)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1041 "Update all tags of all trees.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1042 Arguments IGNORE are ignored."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1043 (save-current-buffer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1044 (set-buffer (newsticker--treeview-tree-buffer))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1045 (let ((inhibit-read-only t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1046 (newsticker--treeview-tree-do-update-tags
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1047 newsticker--treeview-feed-tree)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1048 (newsticker--treeview-tree-do-update-tags
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1049 newsticker--treeview-vfeed-tree))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1050 (tree-widget-set-theme "folder")))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1051
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1052 (defun newsticker--treeview-tree-update-highlight ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1053 "Update highlight in tree buffer."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1054 (let ((pos (widget-get (newsticker--treeview-get-current-node) :from)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1055 (unless (or (integerp pos) (and (markerp pos) (marker-position pos)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1056 (setq pos (widget-get (widget-get
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1057 (newsticker--treeview-get-current-node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1058 :parent) :from)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1059 (when (or (integerp pos) (and (markerp pos) (marker-position pos)))
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1060 (with-current-buffer (newsticker--treeview-tree-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1061 (goto-char pos)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1062 (move-overlay newsticker--tree-selection-overlay
106083
df266edf1b2b (newsticker--treeview-list-update-faces):
Glenn Morris <rgm@gnu.org>
parents: 105813
diff changeset
1063 (point-at-bol) (1+ (point-at-eol))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1064 (current-buffer)))
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1065 (if (window-live-p (newsticker--treeview-tree-window))
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1066 (set-window-point (newsticker--treeview-tree-window) pos)))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1067
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1068 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1069 ;;; Toolbar
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1070 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1071 ;;(makunbound 'newsticker-treeview-tool-bar-map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1072 (defvar newsticker-treeview-tool-bar-map
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1073 (if (featurep 'xemacs)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1074 nil
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1075 (if (boundp 'tool-bar-map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1076 (let ((tool-bar-map (make-sparse-keymap)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1077 (define-key tool-bar-map [newsticker-sep-1]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1078 (list 'menu-item "--double-line"))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1079 (define-key tool-bar-map [newsticker-browse-url]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1080 (list 'menu-item "newsticker-browse-url"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1081 'newsticker-browse-url
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1082 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1083 :help "Browse URL for item at point"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1084 :image newsticker--browse-image))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1085 (define-key tool-bar-map [newsticker-buffer-force-update]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1086 (list 'menu-item "newsticker-treeview-update"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1087 'newsticker-treeview-update
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1088 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1089 :help "Update newsticker buffer"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1090 :image newsticker--update-image
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1091 :enable t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1092 (define-key tool-bar-map [newsticker-get-all-news]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1093 (list 'menu-item "newsticker-get-all-news" 'newsticker-get-all-news
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1094 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1095 :help "Get news for all feeds"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1096 :image newsticker--get-all-image))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1097 (define-key tool-bar-map [newsticker-mark-item-at-point-as-read]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1098 (list 'menu-item "newsticker-treeview-mark-item-old"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1099 'newsticker-treeview-mark-item-old
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1100 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1101 :image newsticker--mark-read-image
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1102 :help "Mark current item as read"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1103 ;;:enable '(newsticker-item-not-old-p) FIXME
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1104 ))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1105 (define-key tool-bar-map [newsticker-mark-item-at-point-as-immortal]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1106 (list 'menu-item "newsticker-treeview-toggle-item-immortal"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1107 'newsticker-treeview-toggle-item-immortal
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1108 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1109 :image newsticker--mark-immortal-image
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1110 :help "Toggle current item as immortal"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1111 :enable t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1112 ;;'(newsticker-item-not-immortal-p) FIXME
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1113 ))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1114 (define-key tool-bar-map [newsticker-next-feed]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1115 (list 'menu-item "newsticker-treeview-next-feed"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1116 'newsticker-treeview-next-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1117 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1118 :help "Go to next feed"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1119 :image newsticker--next-feed-image
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1120 :enable t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1121 ;;'(newsticker-next-feed-available-p) FIXME
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1122 ))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1123 (define-key tool-bar-map [newsticker-treeview-next-item]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1124 (list 'menu-item "newsticker-treeview-next-item"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1125 'newsticker-treeview-next-item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1126 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1127 :help "Go to next item"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1128 :image newsticker--next-item-image
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1129 :enable t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1130 ;;'(newsticker-next-item-available-p) FIXME
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1131 ))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1132 (define-key tool-bar-map [newsticker-treeview-prev-item]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1133 (list 'menu-item "newsticker-treeview-prev-item"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1134 'newsticker-treeview-prev-item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1135 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1136 :help "Go to previous item"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1137 :image newsticker--previous-item-image
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1138 :enable t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1139 ;;'(newsticker-previous-item-available-p) FIXME
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1140 ))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1141 (define-key tool-bar-map [newsticker-treeview-prev-feed]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1142 (list 'menu-item "newsticker-treeview-prev-feed"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1143 'newsticker-treeview-prev-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1144 :visible t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1145 :help "Go to previous feed"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1146 :image newsticker--previous-feed-image
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1147 :enable t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1148 ;;'(newsticker-previous-feed-available-p) FIXME
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1149 ))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1150 ;; standard icons / actions
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1151 (tool-bar-add-item "close"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1152 'newsticker-treeview-quit
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1153 'newsticker-treeview-quit
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1154 :help "Close newsticker")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1155 (tool-bar-add-item "preferences"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1156 'newsticker-customize
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1157 'newsticker-customize
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1158 :help "Customize newsticker")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1159 tool-bar-map))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1160
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1161 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1162 ;;; actions
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1163 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1164
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1165 (defun newsticker-treeview-mouse-browse-url (event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1166 "Call `browse-url' for the link of the item at which the EVENT occurred."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1167 (interactive "e")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1168 (save-excursion
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1169 (switch-to-buffer (window-buffer (posn-window (event-end event))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1170 (let ((url (get-text-property (posn-point (event-end event))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1171 :nt-link)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1172 (when url
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1173 (browse-url url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1174 (if newsticker-automatically-mark-visited-items-as-old
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1175 (newsticker-treeview-mark-item-old))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1176
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1177 (defun newsticker-treeview-browse-url ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1178 "Call `browse-url' for the link of the item at point."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1179 (interactive)
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1180 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1181 (let ((url (get-text-property (point) :nt-link)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1182 (when url
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1183 (browse-url url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1184 (if newsticker-automatically-mark-visited-items-as-old
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1185 (newsticker-treeview-mark-item-old))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1186
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1187 (defun newsticker--treeview-buffer-init ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1188 "Initialize all treeview buffers."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1189 (setq newsticker--treeview-buffers nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1190 (add-to-list 'newsticker--treeview-buffers
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1191 (get-buffer-create "*Newsticker Tree*") t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1192 (add-to-list 'newsticker--treeview-buffers
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1193 (get-buffer-create "*Newsticker List*") t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1194 (add-to-list 'newsticker--treeview-buffers
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1195 (get-buffer-create "*Newsticker Item*") t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1196
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1197 (unless newsticker--selection-overlay
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1198 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1199 (setq newsticker--selection-overlay (make-overlay (point-min)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1200 (point-max)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1201 (overlay-put newsticker--selection-overlay 'face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1202 'newsticker-treeview-selection-face)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1203 (unless newsticker--tree-selection-overlay
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1204 (with-current-buffer (newsticker--treeview-tree-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1205 (setq newsticker--tree-selection-overlay (make-overlay (point-min)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1206 (point-max)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1207 (overlay-put newsticker--tree-selection-overlay 'face
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1208 'newsticker-treeview-selection-face)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1209
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1210 (newsticker--treeview-tree-update)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1211 (newsticker--treeview-list-update t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1212 (newsticker--treeview-item-update))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1213
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1214 (defun newsticker-treeview-update ()
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1215 "Update all treeview buffers and windows.
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1216 Note: does not update the layout."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1217 (interactive)
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1218 (let ((cur-item (newsticker--treeview-get-selected-item)))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1219 (newsticker--group-manage-orphan-feeds)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1220 (newsticker--treeview-list-update t)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1221 (newsticker--treeview-item-update)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1222 (newsticker--treeview-tree-update-tags)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1223 (cond (newsticker--treeview-current-feed
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1224 (newsticker--treeview-list-items newsticker--treeview-current-feed))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1225 (newsticker--treeview-current-vfeed
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1226 (newsticker--treeview-list-items-with-age
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1227 (intern newsticker--treeview-current-vfeed))))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1228 (newsticker--treeview-tree-update-highlight)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1229 (newsticker--treeview-list-update-highlight)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1230 (let ((cur-feed (or newsticker--treeview-current-feed
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1231 newsticker--treeview-current-vfeed)))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1232 (if (and cur-feed cur-item)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1233 (newsticker--treeview-list-select cur-item)))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1234
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1235 (defun newsticker-treeview-quit ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1236 "Quit newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1237 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1238 (setq newsticker--sentinel-callback nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1239 (bury-buffer "*Newsticker Tree*")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1240 (bury-buffer "*Newsticker List*")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1241 (bury-buffer "*Newsticker Item*")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1242 (set-window-configuration newsticker--saved-window-config)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1243 (when newsticker--frame
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1244 (if (frame-live-p newsticker--frame)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1245 (delete-frame newsticker--frame))
100492
afc7ba4fff7a newsticker: fixed problem with missing group definition
Ulf Jasper <ulf.jasper@web.de>
parents: 99885
diff changeset
1246 (setq newsticker--frame nil))
afc7ba4fff7a newsticker: fixed problem with missing group definition
Ulf Jasper <ulf.jasper@web.de>
parents: 99885
diff changeset
1247 (newsticker-treeview-save))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1248
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1249 (defun newsticker-treeview-save ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1250 "Save newsticker data including treeview settings."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1251 (interactive)
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1252 (let ((coding-system-for-write 'utf-8)
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1253 (buf (find-file-noselect (concat newsticker-dir "/groups"))))
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1254 (when buf
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1255 (with-current-buffer buf
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1256 (setq buffer-undo-list t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1257 (erase-buffer)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1258 (insert ";; -*- coding: utf-8 -*-\n")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1259 (insert (prin1-to-string newsticker-groups))
101911
a4aa4e04bc11 newsticker: kill groups buffer after saving/loading.
Ulf Jasper <ulf.jasper@web.de>
parents: 101870
diff changeset
1260 (save-buffer)
a4aa4e04bc11 newsticker: kill groups buffer after saving/loading.
Ulf Jasper <ulf.jasper@web.de>
parents: 101870
diff changeset
1261 (kill-buffer)))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1262
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1263 (defun newsticker--treeview-load ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1264 "Load treeview settings."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1265 (let* ((coding-system-for-read 'utf-8)
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1266 (filename
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1267 (or (and (file-exists-p newsticker-groups-filename)
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1268 (y-or-n-p
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1269 (format "Old newsticker groups (%s) file exists. Read it? "
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1270 newsticker-groups-filename))
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1271 newsticker-groups-filename)
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1272 (concat newsticker-dir "/groups")))
100492
afc7ba4fff7a newsticker: fixed problem with missing group definition
Ulf Jasper <ulf.jasper@web.de>
parents: 99885
diff changeset
1273 (buf (and (file-exists-p filename)
afc7ba4fff7a newsticker: fixed problem with missing group definition
Ulf Jasper <ulf.jasper@web.de>
parents: 99885
diff changeset
1274 (find-file-noselect filename))))
102071
e25fb73b6868 * net/newst-treeview.el (newsticker--treeview-load): Remove bogus `if'.
Juanma Barranquero <lekktu@gmail.com>
parents: 102060
diff changeset
1275 (and (file-exists-p newsticker-groups-filename)
e25fb73b6868 * net/newst-treeview.el (newsticker--treeview-load): Remove bogus `if'.
Juanma Barranquero <lekktu@gmail.com>
parents: 102060
diff changeset
1276 (y-or-n-p (format "Delete old newsticker groups file? "))
e25fb73b6868 * net/newst-treeview.el (newsticker--treeview-load): Remove bogus `if'.
Juanma Barranquero <lekktu@gmail.com>
parents: 102060
diff changeset
1277 (delete-file newsticker-groups-filename))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1278 (when buf
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1279 (set-buffer buf)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1280 (goto-char (point-min))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1281 (condition-case nil
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1282 (setq newsticker-groups (read buf))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1283 (error
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1284 (message "Error while reading newsticker groups file!")
101911
a4aa4e04bc11 newsticker: kill groups buffer after saving/loading.
Ulf Jasper <ulf.jasper@web.de>
parents: 101870
diff changeset
1285 (setq newsticker-groups nil)))
a4aa4e04bc11 newsticker: kill groups buffer after saving/loading.
Ulf Jasper <ulf.jasper@web.de>
parents: 101870
diff changeset
1286 (kill-buffer buf))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1287
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1288
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1289 (defun newsticker-treeview-scroll-item ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1290 "Scroll current item."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1291 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1292 (save-selected-window
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1293 (select-window (newsticker--treeview-item-window) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1294 (scroll-up 1)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1295
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1296 (defun newsticker-treeview-show-item ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1297 "Show current item."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1298 (interactive)
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1299 (newsticker--treeview-restore-layout)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1300 (newsticker--treeview-list-update-highlight)
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1301 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1302 (beginning-of-line)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1303 (let ((item (get-text-property (point) :nt-item))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1304 (feed (get-text-property (point) :nt-feed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1305 (newsticker--treeview-item-show item feed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1306 (newsticker--treeview-tree-update-tag
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1307 (newsticker--treeview-get-current-node) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1308 (newsticker--treeview-tree-update-highlight))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1309
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1310 (defun newsticker-treeview-next-item ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1311 "Move to next item."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1312 (interactive)
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1313 (newsticker--treeview-restore-layout)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1314 (save-current-buffer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1315 (set-buffer (newsticker--treeview-list-buffer))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1316 (if (newsticker--treeview-list-highlight-start)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1317 (forward-line 1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1318 (if (eobp)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1319 (forward-line -1)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1320 (newsticker-treeview-show-item))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1321
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1322 (defun newsticker-treeview-prev-item ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1323 "Move to previous item."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1324 (interactive)
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1325 (newsticker--treeview-restore-layout)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1326 (save-current-buffer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1327 (set-buffer (newsticker--treeview-list-buffer))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1328 (forward-line -1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1329 (newsticker-treeview-show-item))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1330
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1331 (defun newsticker-treeview-next-new-or-immortal-item (&optional
101870
085bed32d1c1 newsticker: fix infinite recursion when moving to next new item
Ulf Jasper <ulf.jasper@web.de>
parents: 101428
diff changeset
1332 current-item-counts
085bed32d1c1 newsticker: fix infinite recursion when moving to next new item
Ulf Jasper <ulf.jasper@web.de>
parents: 101428
diff changeset
1333 dont-wrap-trees)
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1334 "Move to next new or immortal item.
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1335 Will move to next feed until an item is found. Will not move if
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1336 optional argument CURRENT-ITEM-COUNTS is t and current item is
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1337 new or immortal. Will not move from virtual to ordinary feed
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1338 tree or vice versa if optional argument DONT-WRAP-TREES is non-nil."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1339 (interactive)
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1340 (newsticker--treeview-restore-layout)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1341 (newsticker--treeview-list-clear-highlight)
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1342 (unless (catch 'found
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1343 (let ((move (not current-item-counts)))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1344 (while t
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1345 (save-current-buffer
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1346 (set-buffer (newsticker--treeview-list-buffer))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1347 (when move (forward-line 1)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1348 (when (eobp)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1349 (forward-line -1)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1350 (throw 'found nil))))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1351 (when (memq (newsticker--age
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1352 (newsticker--treeview-get-selected-item))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1353 '(new immortal))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1354 (newsticker-treeview-show-item)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1355 (throw 'found t))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1356 (setq move t))))
101870
085bed32d1c1 newsticker: fix infinite recursion when moving to next new item
Ulf Jasper <ulf.jasper@web.de>
parents: 101428
diff changeset
1357 (let ((wrap-trees (not dont-wrap-trees)))
085bed32d1c1 newsticker: fix infinite recursion when moving to next new item
Ulf Jasper <ulf.jasper@web.de>
parents: 101428
diff changeset
1358 (when (or (newsticker-treeview-next-feed t)
085bed32d1c1 newsticker: fix infinite recursion when moving to next new item
Ulf Jasper <ulf.jasper@web.de>
parents: 101428
diff changeset
1359 (and wrap-trees (newsticker--treeview-first-feed)))
085bed32d1c1 newsticker: fix infinite recursion when moving to next new item
Ulf Jasper <ulf.jasper@web.de>
parents: 101428
diff changeset
1360 (newsticker-treeview-next-new-or-immortal-item t t)))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1361
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1362 (defun newsticker-treeview-prev-new-or-immortal-item ()
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1363 "Move to previous new or immortal item.
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1364 Will move to previous feed until an item is found."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1365 (interactive)
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1366 (newsticker--treeview-restore-layout)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1367 (newsticker--treeview-list-clear-highlight)
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1368 (unless (catch 'found
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1369 (while t
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1370 (save-current-buffer
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1371 (set-buffer (newsticker--treeview-list-buffer))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1372 (when (bobp)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1373 (throw 'found nil))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1374 (forward-line -1))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1375 (when (memq (newsticker--age
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1376 (newsticker--treeview-get-selected-item))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1377 '(new immortal))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1378 (newsticker-treeview-show-item)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1379 (throw 'found t))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1380 (when (bobp)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1381 (throw 'found nil))))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1382 (when (newsticker-treeview-prev-feed t)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1383 (set-buffer (newsticker--treeview-list-buffer))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1384 (goto-char (point-max))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1385 (newsticker-treeview-prev-new-or-immortal-item))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1386
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1387 (defun newsticker--treeview-get-selected-item ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1388 "Return item that is currently selected in list buffer."
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1389 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1390 (beginning-of-line)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1391 (get-text-property (point) :nt-item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1392
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1393 (defun newsticker-treeview-mark-item-old (&optional dont-proceed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1394 "Mark current item as old unless it is obsolete.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1395 Move to next item unless DONT-PROCEED is non-nil."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1396 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1397 (let ((item (newsticker--treeview-get-selected-item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1398 (unless (eq (newsticker--age item) 'obsolete)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1399 (newsticker--treeview-mark-item item 'old)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1400 (unless dont-proceed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1401 (newsticker-treeview-next-item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1402
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1403 (defun newsticker-treeview-toggle-item-immortal ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1404 "Toggle immortality of current item."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1405 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1406 (let* ((item (newsticker--treeview-get-selected-item))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1407 (new-age (if (eq (newsticker--age item) 'immortal)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1408 'old
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1409 'immortal)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1410 (newsticker--treeview-mark-item item new-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1411 (newsticker-treeview-next-item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1412
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1413 (defun newsticker--treeview-mark-item (item new-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1414 "Mark ITEM with NEW-AGE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1415 (when item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1416 (setcar (nthcdr 4 item) new-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1417 ;; clean up ticker FIXME
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1418 )
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1419 (newsticker--cache-save-feed
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1420 (newsticker--cache-get-feed (intern newsticker--treeview-current-feed)))
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
1421 (newsticker--treeview-tree-do-update-tags newsticker--treeview-vfeed-tree))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1422
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1423 (defun newsticker-treeview-mark-list-items-old ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1424 "Mark all listed items as old."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1425 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1426 (let ((current-feed (or newsticker--treeview-current-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1427 newsticker--treeview-current-vfeed)))
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1428 (with-current-buffer (newsticker--treeview-list-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1429 (goto-char (point-min))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1430 (while (not (eobp))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1431 (let ((item (get-text-property (point) :nt-item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1432 (unless (memq (newsticker--age item) '(immortal obsolete))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1433 (newsticker--treeview-mark-item item 'old)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1434 (forward-line 1)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1435 (newsticker--treeview-tree-update-tags)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1436 (if current-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1437 (newsticker-treeview-jump current-feed))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1438
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1439 (defun newsticker-treeview-save-item ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1440 "Save current item."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1441 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1442 (newsticker-save-item (or newsticker--treeview-current-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1443 newsticker--treeview-current-vfeed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1444 (newsticker--treeview-get-selected-item)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1445
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1446 (defun newsticker-treeview-browse-url-item ()
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1447 "Convert current item to HTML and call `browse-url' on result."
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1448 (interactive)
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1449 (newsticker-browse-url-item (or newsticker--treeview-current-feed
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1450 newsticker--treeview-current-vfeed)
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1451 (newsticker--treeview-get-selected-item)))
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1452
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1453 (defun newsticker--treeview-set-current-node (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1454 "Make NODE the current node."
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1455 (with-current-buffer (newsticker--treeview-tree-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1456 (setq newsticker--treeview-current-node-id
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1457 (widget-get node :nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1458 (setq newsticker--treeview-current-feed (widget-get node :nt-feed))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1459 (setq newsticker--treeview-current-vfeed (widget-get node :nt-vfeed))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1460 (newsticker--treeview-tree-update-highlight)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1461
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1462 (defun newsticker--treeview-get-first-child (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1463 "Get first child of NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1464 (let ((children (widget-get node :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1465 (if children
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1466 (car children)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1467 nil)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1468
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1469 (defun newsticker--treeview-get-second-child (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1470 "Get scond child of NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1471 (let ((children (widget-get node :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1472 (if children
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1473 (car (cdr children))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1474 nil)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1475
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1476 (defun newsticker--treeview-get-last-child (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1477 "Get last child of NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1478 ;;(message "newsticker--treeview-get-last-child %s" (widget-get node :tag))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1479 (let ((children (widget-get node :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1480 (if children
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1481 (car (reverse children))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1482 nil)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1483
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1484 (defun newsticker--treeview-get-feed-vfeed (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1485 "Get (virtual) feed of NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1486 (or (widget-get node :nt-feed) (widget-get node :nt-vfeed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1487
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1488 (defun newsticker--treeview-get-next-sibling (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1489 "Get next sibling of NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1490 (let ((parent (widget-get node :parent)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1491 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1492 (let ((children (widget-get parent :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1493 (while children
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1494 (if (newsticker--treeview-nodes-eq (car children) node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1495 (throw 'found (car (cdr children))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1496 (setq children (cdr children)))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1497
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1498 (defun newsticker--treeview-get-prev-sibling (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1499 "Get previous sibling of NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1500 (let ((parent (widget-get node :parent)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1501 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1502 (let ((children (widget-get parent :children))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1503 (prev nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1504 (while children
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1505 (if (and (newsticker--treeview-nodes-eq (car children) node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1506 (widget-get prev :nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1507 (throw 'found prev))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1508 (setq prev (car children))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1509 (setq children (cdr children)))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1510
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1511 (defun newsticker--treeview-get-next-uncle (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1512 "Get next uncle of NODE, i.e. parent's next sibling."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1513 (let* ((parent (widget-get node :parent))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1514 (grand-parent (widget-get parent :parent)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1515 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1516 (let ((uncles (widget-get grand-parent :children)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1517 (while uncles
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1518 (if (newsticker--treeview-nodes-eq (car uncles) parent)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1519 (throw 'found (car (cdr uncles))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1520 (setq uncles (cdr uncles)))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1521
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1522 (defun newsticker--treeview-get-prev-uncle (node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1523 "Get previous uncle of NODE, i.e. parent's previous sibling."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1524 (let* ((parent (widget-get node :parent))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1525 (grand-parent (widget-get parent :parent)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1526 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1527 (let ((uncles (widget-get grand-parent :children))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1528 (prev nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1529 (while uncles
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1530 (if (newsticker--treeview-nodes-eq (car uncles) parent)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1531 (throw 'found prev))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1532 (setq prev (car uncles))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1533 (setq uncles (cdr uncles)))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1534
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1535 (defun newsticker--treeview-get-other-tree ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1536 "Get other tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1537 (if (and (newsticker--treeview-get-current-node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1538 (widget-get (newsticker--treeview-get-current-node) :nt-feed))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1539 newsticker--treeview-vfeed-tree
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1540 newsticker--treeview-feed-tree))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1541
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1542 (defun newsticker--treeview-activate-node (node &optional backward)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1543 "Activate NODE.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1544 If NODE is a tree widget the node's first subnode is activated.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1545 If BACKWARD is non-nil the last subnode of the previous sibling
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1546 is activated."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1547 (newsticker--treeview-set-current-node node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1548 (save-current-buffer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1549 (set-buffer (newsticker--treeview-tree-buffer))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1550 (cond ((eq (widget-type node) 'tree-widget)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1551 (unless (widget-get node :open)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1552 (widget-put node :open nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1553 (widget-apply-action node))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1554 (newsticker--treeview-activate-node
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1555 (if backward
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1556 (newsticker--treeview-get-last-child node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1557 (newsticker--treeview-get-second-child node))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1558 (node
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1559 (widget-apply-action node)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1560
101428
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1561 (defun newsticker--treeview-first-feed ()
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1562 "Jump to the depth-first feed in the `newsticker-groups' tree."
101428
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1563 (newsticker-treeview-jump
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1564 (car (reverse (newsticker--group-get-feeds newsticker-groups t)))))
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1565
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1566 (defun newsticker-treeview-next-feed (&optional stay-in-tree)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1567 "Move to next feed.
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1568 Optional argument STAY-IN-TREE prevents moving from real feed
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1569 tree to virtual feed tree or vice versa.
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1570 Return t if a new feed was activated, nil otherwise."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1571 (interactive)
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1572 (newsticker--treeview-restore-layout)
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1573 (let ((cur (newsticker--treeview-get-current-node))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1574 (new nil))
101428
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1575 (setq new
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1576 (if cur
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1577 (or (newsticker--treeview-get-next-sibling cur)
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1578 (newsticker--treeview-get-next-uncle cur)
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1579 (and (not stay-in-tree)
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1580 (newsticker--treeview-get-other-tree)))
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1581 (car (widget-get newsticker--treeview-feed-tree :children))))
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1582 (if new
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1583 (progn
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1584 (newsticker--treeview-activate-node new)
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1585 (newsticker--treeview-tree-update-highlight)
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1586 (not (eq new cur)))
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1587 nil)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1588
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1589 (defun newsticker-treeview-prev-feed (&optional stay-in-tree)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1590 "Move to previous feed.
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1591 Optional argument STAY-IN-TREE prevents moving from real feed
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1592 tree to virtual feed tree or vice versa.
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1593 Return t if a new feed was activated, nil otherwise."
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1594 (interactive)
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1595 (newsticker--treeview-restore-layout)
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1596 (let ((cur (newsticker--treeview-get-current-node))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1597 (new nil))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1598 (if cur
101361
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1599 (progn
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1600 (setq new
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1601 (if cur
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1602 (or (newsticker--treeview-get-prev-sibling cur)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1603 (newsticker--treeview-get-prev-uncle cur)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1604 (and (not stay-in-tree)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1605 (newsticker--treeview-get-other-tree)))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1606 (car (widget-get newsticker--treeview-feed-tree :children))))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1607 (if new
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1608 (progn
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1609 (newsticker--treeview-activate-node new t)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1610 (newsticker--treeview-tree-update-highlight)
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1611 (not (eq new cur)))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1612 nil))
5421268f1d18 newsticker: fixed bug#1569
Ulf Jasper <ulf.jasper@web.de>
parents: 100908
diff changeset
1613 nil)))
102071
e25fb73b6868 * net/newst-treeview.el (newsticker--treeview-load): Remove bogus `if'.
Juanma Barranquero <lekktu@gmail.com>
parents: 102060
diff changeset
1614
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1615 (defun newsticker-treeview-next-page ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1616 "Scroll item buffer."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1617 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1618 (save-selected-window
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1619 (select-window (newsticker--treeview-item-window) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1620 (condition-case nil
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1621 (scroll-up nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1622 (error
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1623 (goto-char (point-min))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1624
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1625
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1626 (defun newsticker--treeview-unfold-node (feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1627 "Recursively show subtree above the node that represents FEED-NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1628 (let ((node (newsticker--treeview-get-node-of-feed feed-name)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1629 (unless node
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1630 (let* ((group-name (or (car (newsticker--group-find-group-for-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1631 feed-name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1632 (newsticker--group-get-parent-group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1633 feed-name))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1634 (newsticker--treeview-unfold-node group-name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1635 (setq node (newsticker--treeview-get-node-of-feed feed-name)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1636 (when node
105813
df4934f25eef * textmodes/two-column.el (2C-split):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 104395
diff changeset
1637 (with-current-buffer (newsticker--treeview-tree-buffer)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1638 (widget-put node :nt-selected t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1639 (widget-apply-action node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1640 (newsticker--treeview-set-current-node node)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1641
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1642 (defun newsticker-treeview-jump (feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1643 "Jump to feed FEED-NAME in newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1644 (interactive
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1645 (list (let ((completion-ignore-case t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1646 (completing-read
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1647 "Jump to feed: "
102979
5739f357f79f newsticker: enable jump to virtual feeds
Ulf Jasper <ulf.jasper@web.de>
parents: 102071
diff changeset
1648 (append '("new" "obsolete" "immortal" "all")
5739f357f79f newsticker: enable jump to virtual feeds
Ulf Jasper <ulf.jasper@web.de>
parents: 102071
diff changeset
1649 (mapcar 'car (append newsticker-url-list
5739f357f79f newsticker: enable jump to virtual feeds
Ulf Jasper <ulf.jasper@web.de>
parents: 102071
diff changeset
1650 newsticker-url-list-defaults)))
5739f357f79f newsticker: enable jump to virtual feeds
Ulf Jasper <ulf.jasper@web.de>
parents: 102071
diff changeset
1651 nil t))))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1652 (newsticker--treeview-unfold-node feed-name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1653
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1654 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1655 ;;; Groups
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1656 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1657 (defun newsticker--group-do-find-group-for-feed (feed-name node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1658 "Recursively find FEED-NAME in NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1659 (if (member feed-name (cdr node))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1660 (throw 'found node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1661 (mapc (lambda (n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1662 (if (listp n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1663 (newsticker--group-do-find-group-for-feed feed-name n)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1664 (cdr node))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1665
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1666 (defun newsticker--group-find-group-for-feed (feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1667 "Find group containing FEED-NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1668 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1669 (newsticker--group-do-find-group-for-feed feed-name
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1670 newsticker-groups)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1671 nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1672
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1673 (defun newsticker--group-do-get-group (name node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1674 "Recursively find group with NAME below NODE."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1675 (if (string= name (car node))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1676 (throw 'found node)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1677 (mapc (lambda (n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1678 (if (listp n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1679 (newsticker--group-do-get-group name n)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1680 (cdr node))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1681
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1682 (defun newsticker--group-get-group (name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1683 "Find group with NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1684 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1685 (mapc (lambda (n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1686 (if (listp n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1687 (newsticker--group-do-get-group name n)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1688 newsticker-groups)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1689 nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1690
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1691 (defun newsticker--group-do-get-parent-group (name node parent)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1692 "Recursively find parent group for NAME from NODE which is a child of PARENT."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1693 (if (string= name (car node))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1694 (throw 'found parent)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1695 (mapc (lambda (n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1696 (if (listp n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1697 (newsticker--group-do-get-parent-group name n (car node))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1698 (cdr node))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1699
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1700 (defun newsticker--group-get-parent-group (name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1701 "Find parent group for group named NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1702 (catch 'found
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1703 (mapc (lambda (n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1704 (if (listp n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1705 (newsticker--group-do-get-parent-group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1706 name n (car newsticker-groups))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1707 newsticker-groups)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1708 nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1709
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1710
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1711 (defun newsticker--group-get-subgroups (group &optional recursive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1712 "Return list of subgroups for GROUP.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1713 If RECURSIVE is non-nil recursively get subgroups and return a nested list."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1714 (let ((result nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1715 (mapc (lambda (n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1716 (when (listp n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1717 (setq result (cons (car n) result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1718 (let ((subgroups (newsticker--group-get-subgroups n recursive)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1719 (when subgroups
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1720 (setq result (append subgroups result))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1721 group)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1722 result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1723
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1724 (defun newsticker--group-all-groups ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1725 "Return nested list of all groups."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1726 (newsticker--group-get-subgroups newsticker-groups t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1727
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1728 (defun newsticker--group-get-feeds (group &optional recursive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1729 "Return list of all feeds in GROUP.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1730 If RECURSIVE is non-nil recursively get feeds of subgroups and
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1731 return a nested list."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1732 (let ((result nil))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1733 (mapc (lambda (n)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1734 (if (not (listp n))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1735 (setq result (cons n result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1736 (if recursive
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1737 (let ((subfeeds (newsticker--group-get-feeds n t)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1738 (when subfeeds
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1739 (setq result (append subfeeds result)))))))
101428
d7b1d5b3b2c1 newsticker: Fixed next-new-or-immortal-feed even more.
Ulf Jasper <ulf.jasper@web.de>
parents: 101363
diff changeset
1740 (cdr group))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1741 result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1742
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1743 (defun newsticker-group-add-group (name parent)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1744 "Add group NAME to group PARENT."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1745 (interactive
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1746 (list (read-string "Group Name: ")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1747 (let ((completion-ignore-case t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1748 (completing-read "Parent Group: " (newsticker--group-all-groups)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1749 nil t))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1750 (if (newsticker--group-get-group name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1751 (error "Group %s exists already" name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1752 (let ((p (if (and parent (not (string= parent "")))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1753 (newsticker--group-get-group parent)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1754 newsticker-groups)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1755 (unless p
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1756 (error "Parent %s does not exist" parent))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1757 (setcdr p (cons (list name) (cdr p))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1758 (newsticker--treeview-tree-update))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1759
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1760 (defun newsticker-group-move-feed (name group-name &optional no-update)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1761 "Move feed NAME to group GROUP-NAME.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1762 Update teeview afterwards unless NO-UPDATE is non-nil."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1763 (interactive
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1764 (let ((completion-ignore-case t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1765 (list (completing-read "Feed Name: "
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1766 (mapcar 'car newsticker-url-list)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1767 nil t newsticker--treeview-current-feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1768 (completing-read "Group Name: " (newsticker--group-all-groups)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1769 nil t))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1770 (let ((group (if (and group-name (not (string= group-name "")))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1771 (newsticker--group-get-group group-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1772 newsticker-groups)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1773 (unless group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1774 (error "Group %s does not exist" group-name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1775 (while (let ((old-group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1776 (newsticker--group-find-group-for-feed name)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1777 (when old-group
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1778 (delete name old-group))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1779 old-group))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1780 (setcdr group (cons name (cdr group)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1781 (unless no-update
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1782 (newsticker--treeview-tree-update)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1783 (newsticker-treeview-update))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1784
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1785 (defun newsticker-group-delete-group (name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1786 "Remove group NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1787 (interactive
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1788 (let ((completion-ignore-case t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1789 (list (completing-read "Group Name: " (newsticker--group-all-groups)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1790 nil t))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1791 (let* ((g (newsticker--group-get-group name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1792 (p (or (newsticker--group-get-parent-group name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1793 newsticker-groups)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1794 (unless g
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1795 (error "Group %s does not exist" name))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1796 (delete g p))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1797 (newsticker--treeview-tree-update))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1798
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1799 (defun newsticker--count-groups (group)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1800 "Recursively count number of subgroups of GROUP."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1801 (let ((result 1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1802 (mapc (lambda (g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1803 (if (listp g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1804 (setq result (+ result (newsticker--count-groups g)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1805 (cdr group))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1806 result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1807
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1808 (defun newsticker--count-grouped-feeds (group)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1809 "Recursively count number of feeds in GROUP and its subgroups."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1810 (let ((result 0))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1811 (mapc (lambda (g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1812 (if (listp g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1813 (setq result (+ result (newsticker--count-grouped-feeds g)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1814 (setq result (1+ result))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1815 (cdr group))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1816 result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1817
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1818 (defun newsticker--group-remove-obsolete-feeds (group)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1819 "Recursively remove obselete feeds from GROUP."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1820 (let ((result nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1821 (urls (append newsticker-url-list newsticker-url-list-defaults)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1822 (mapc (lambda (g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1823 (if (listp g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1824 (let ((sub-groups
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1825 (newsticker--group-remove-obsolete-feeds g)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1826 (if sub-groups
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1827 (setq result (cons sub-groups result))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1828 (if (assoc g urls)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1829 (setq result (cons g result)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1830 (cdr group))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1831 (if result
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1832 (cons (car group) (reverse result))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1833 result)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1834
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1835 (defun newsticker--group-manage-orphan-feeds ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1836 "Put unmanaged feeds into `newsticker-groups'.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1837 Remove obsolete feeds as well."
95960
f104cdfcb450 newsticker: window dedication, orphan feeds.
Ulf Jasper <ulf.jasper@web.de>
parents: 95904
diff changeset
1838 (unless newsticker-groups
f104cdfcb450 newsticker: window dedication, orphan feeds.
Ulf Jasper <ulf.jasper@web.de>
parents: 95904
diff changeset
1839 (setq newsticker-groups '("Feeds")))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1840 (let ((new-feed nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1841 (grouped-feeds (newsticker--count-grouped-feeds newsticker-groups)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1842 (mapc (lambda (f)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1843 (unless (newsticker--group-find-group-for-feed (car f))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1844 (setq new-feed t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1845 (newsticker-group-move-feed (car f) nil t)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1846 (append newsticker-url-list-defaults newsticker-url-list))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1847 (setq newsticker-groups
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1848 (newsticker--group-remove-obsolete-feeds newsticker-groups))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1849 (if (or new-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1850 (not (= grouped-feeds
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1851 (newsticker--count-grouped-feeds newsticker-groups))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1852 (newsticker--treeview-tree-update))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1853
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1854 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1855 ;;; Modes
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1856 ;; ======================================================================
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1857 (defun newsticker--treeview-create-groups-menu (group-list
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1858 excluded-group)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1859 "Create menu for GROUP-LIST omitting EXCLUDED-GROUP."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1860 (let ((menu (make-sparse-keymap (if (stringp (car group-list))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1861 (car group-list)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1862 "Move to group..."))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1863 (mapc (lambda (g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1864 (when (listp g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1865 (let ((title (if (stringp (car g))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1866 (car g)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1867 "Move to group...")))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1868 (unless (eq g excluded-group)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1869 (define-key menu (vector (intern title))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1870 (list 'menu-item title
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1871 (newsticker--treeview-create-groups-menu
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1872 (cdr g) excluded-group)))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1873 (reverse group-list))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1874 menu))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1875
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1876 (defun newsticker--treeview-create-tree-menu (feed-name)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1877 "Create tree menu for FEED-NAME."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1878 (let ((menu (make-sparse-keymap feed-name)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1879 (define-key menu [newsticker-treeview-mark-list-items-old]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1880 (list 'menu-item "Mark all items old"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1881 'newsticker-treeview-mark-list-items-old))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1882 (define-key menu [move]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1883 (list 'menu-item "Move to group..."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1884 (newsticker--treeview-create-groups-menu
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1885 newsticker-groups
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1886 (newsticker--group-get-group feed-name))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1887 menu))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1888
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1889 (defvar newsticker-treeview-list-menu
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1890 (let ((menu (make-sparse-keymap "Newsticker List")))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1891 (define-key menu [newsticker-treeview-mark-list-items-old]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1892 (list 'menu-item "Mark all items old"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1893 'newsticker-treeview-mark-list-items-old))
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1894 (define-key menu [newsticker-treeview-mark-item-old]
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1895 (list 'menu-item "Mark current item old"
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1896 'newsticker-treeview-mark-item-old))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1897 (define-key menu [newsticker-treeview-toggle-item-immortal]
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1898 (list 'menu-item "Mark current item immortal (toggle)"
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1899 'newsticker-treeview-toggle-item-immortal))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1900 (define-key menu [newsticker-treeview-get-news]
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1901 (list 'menu-item "Get news for current feed"
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1902 'newsticker-treeview-get-news))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1903 menu)
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1904 "Map for newsticker list menu.")
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1905
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1906 (defvar newsticker-treeview-item-menu
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1907 (let ((menu (make-sparse-keymap "Newsticker Item")))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1908 (define-key menu [newsticker-treeview-mark-item-old]
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1909 (list 'menu-item "Mark current item old"
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1910 'newsticker-treeview-mark-item-old))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1911 (define-key menu [newsticker-treeview-toggle-item-immortal]
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1912 (list 'menu-item "Mark current item immortal (toggle)"
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1913 'newsticker-treeview-toggle-item-immortal))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1914 (define-key menu [newsticker-treeview-get-news]
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1915 (list 'menu-item "Get news for current feed"
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1916 'newsticker-treeview-get-news))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1917 menu)
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1918 "Map for newsticker item menu.")
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1919
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1920 (defvar newsticker-treeview-mode-map
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1921 (let ((map (make-sparse-keymap 'newsticker-treeview-mode-map)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1922 (define-key map " " 'newsticker-treeview-next-page)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1923 (define-key map "a" 'newsticker-add-url)
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
1924 (define-key map "b" 'newsticker-treeview-browse-url-item)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1925 (define-key map "F" 'newsticker-treeview-prev-feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1926 (define-key map "f" 'newsticker-treeview-next-feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1927 (define-key map "g" 'newsticker-treeview-get-news)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1928 (define-key map "G" 'newsticker-get-all-news)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1929 (define-key map "i" 'newsticker-treeview-toggle-item-immortal)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1930 (define-key map "j" 'newsticker-treeview-jump)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1931 (define-key map "n" 'newsticker-treeview-next-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1932 (define-key map "N" 'newsticker-treeview-next-new-or-immortal-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1933 (define-key map "O" 'newsticker-treeview-mark-list-items-old)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1934 (define-key map "o" 'newsticker-treeview-mark-item-old)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1935 (define-key map "p" 'newsticker-treeview-prev-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1936 (define-key map "P" 'newsticker-treeview-prev-new-or-immortal-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1937 (define-key map "q" 'newsticker-treeview-quit)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1938 (define-key map "S" 'newsticker-treeview-save-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1939 (define-key map "s" 'newsticker-treeview-save)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1940 (define-key map "u" 'newsticker-treeview-update)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1941 (define-key map "v" 'newsticker-treeview-browse-url)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1942 ;;(define-key map "\n" 'newsticker-treeview-scroll-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1943 ;;(define-key map "\C-m" 'newsticker-treeview-scroll-item)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1944 (define-key map "\M-m" 'newsticker-group-move-feed)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1945 (define-key map "\M-a" 'newsticker-group-add-group)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1946 map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1947 "Mode map for newsticker treeview.")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1948
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1949 (defun newsticker-treeview-mode ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1950 "Major mode for Newsticker Treeview.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1951 \\{newsticker-treeview-mode-map}"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1952 (kill-all-local-variables)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1953 (use-local-map newsticker-treeview-mode-map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1954 (setq major-mode 'newsticker-treeview-mode)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1955 (setq mode-name "Newsticker TV")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1956 (if (boundp 'tool-bar-map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1957 (set (make-local-variable 'tool-bar-map)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1958 newsticker-treeview-tool-bar-map))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1959 (setq buffer-read-only t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1960 truncate-lines t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1961
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1962 (define-derived-mode newsticker-treeview-list-mode newsticker-treeview-mode
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1963 "Item List"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1964 (let ((header (concat
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1965 (propertize " " 'display '(space :align-to 0))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1966 (newsticker-treeview-list-make-sort-button "*" 'sort-by-age)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1967 (propertize " " 'display '(space :align-to 2))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1968 (if newsticker--treeview-list-show-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1969 (concat "Feed"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1970 (propertize " " 'display '(space :align-to 12)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1971 "")
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1972 (newsticker-treeview-list-make-sort-button "Date"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1973 'sort-by-time)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1974 (if newsticker--treeview-list-show-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1975 (propertize " " 'display '(space :align-to 28))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1976 (propertize " " 'display '(space :align-to 18)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1977 (newsticker-treeview-list-make-sort-button "Title"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1978 'sort-by-title))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1979 (setq header-line-format header))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1980 (define-key newsticker-treeview-list-mode-map [down-mouse-3]
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1981 newsticker-treeview-list-menu))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1982
106408
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1983 (define-derived-mode newsticker-treeview-item-mode newsticker-treeview-mode
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1984 "Item"
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1985 (define-key newsticker-treeview-item-mode-map [down-mouse-3]
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1986 newsticker-treeview-item-menu))
53d1b718f76a Newsticker fixes/changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 106111
diff changeset
1987
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1988 (defun newsticker-treeview-tree-click (event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1989 "Handle click EVENT on a tag in the newsticker tree."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1990 (interactive "e")
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
1991 (newsticker--treeview-restore-layout)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1992 (save-excursion
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1993 (switch-to-buffer (window-buffer (posn-window (event-end event))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1994 (newsticker-treeview-tree-do-click (posn-point (event-end event)))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1995
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1996 (defun newsticker-treeview-tree-do-click (&optional pos event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1997 "Actually handle click event.
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1998 POS gives the position where EVENT occurred."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
1999 (interactive)
99885
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
2000 (let* ((pos (or pos (point)))
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
2001 (nt-id (get-text-property pos :nt-id))
7161bac8c5a8 newsticker: cache file redesign.
Ulf Jasper <ulf.jasper@web.de>
parents: 99288
diff changeset
2002 (item (get-text-property pos :nt-item)))
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2003 (cond (item
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2004 ;; click in list buffer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2005 (newsticker-treeview-show-item))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2006 (t
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2007 ;; click in tree buffer
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2008 (let ((w (newsticker--treeview-get-node nt-id)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2009 (when w
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2010 (newsticker--treeview-tree-update-tag w t t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2011 (setq w (newsticker--treeview-get-node nt-id))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2012 (widget-put w :nt-selected t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2013 (widget-apply w :action event)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2014 (newsticker--treeview-set-current-node w))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2015 (newsticker--treeview-tree-update-highlight))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2016
99288
dc1f107fdf13 newsticker fixes: cachefile, layout changes.
Ulf Jasper <ulf.jasper@web.de>
parents: 98692
diff changeset
2017 (defun newsticker--treeview-restore-layout ()
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2018 "Restore treeview buffers."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2019 (catch 'error
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2020 (dotimes (i 3)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2021 (let ((win (nth i newsticker--treeview-windows))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2022 (buf (nth i newsticker--treeview-buffers)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2023 (unless (window-live-p win)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2024 (newsticker--treeview-window-init)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2025 (newsticker--treeview-buffer-init)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2026 (throw 'error t))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2027 (unless (eq (window-buffer win) buf)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2028 (set-window-buffer win buf t))))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2029
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2030 (defun newsticker--treeview-frame-init ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2031 "Initialize treeview frame."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2032 (when newsticker-treeview-own-frame
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2033 (unless (and newsticker--frame (frame-live-p newsticker--frame))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2034 (setq newsticker--frame (make-frame '((name . "Newsticker")))))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2035 (select-frame-set-input-focus newsticker--frame)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2036 (raise-frame newsticker--frame)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2037
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2038 (defun newsticker--treeview-window-init ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2039 "Initialize treeview windows."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2040 (setq newsticker--saved-window-config (current-window-configuration))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2041 (setq newsticker--treeview-windows nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2042 (setq newsticker--treeview-buffers nil)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2043 (delete-other-windows)
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
2044 (split-window-horizontally newsticker-treeview-treewindow-width)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2045 (add-to-list 'newsticker--treeview-windows (selected-window) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2046 (other-window 1)
97699
708c29dada1f Added newsticker-browse-url-item and configurable layout parameters.
Ulf Jasper <ulf.jasper@web.de>
parents: 96153
diff changeset
2047 (split-window-vertically newsticker-treeview-listwindow-height)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2048 (add-to-list 'newsticker--treeview-windows (selected-window) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2049 (other-window 1)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2050 (add-to-list 'newsticker--treeview-windows (selected-window) t)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2051 (other-window 1))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2052
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2053 ;;;###autoload
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2054 (defun newsticker-treeview ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2055 "Start newsticker treeview."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2056 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2057 (newsticker--treeview-load)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2058 (setq newsticker--sentinel-callback 'newsticker-treeview-update)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2059 (newsticker--treeview-frame-init)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2060 (newsticker--treeview-window-init)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2061 (newsticker--treeview-buffer-init)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2062 (newsticker--group-manage-orphan-feeds)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2063 (newsticker--treeview-set-current-node newsticker--treeview-feed-tree)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2064 (newsticker-start t) ;; will start only if not running
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2065 (newsticker-treeview-update)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2066 (newsticker--treeview-item-show-text
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2067 "Newsticker"
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2068 "Welcome to newsticker!"))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2069
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2070 (defun newsticker-treeview-get-news ()
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2071 "Get news for current feed."
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2072 (interactive)
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2073 (when newsticker--treeview-current-feed
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2074 (newsticker-get-news newsticker--treeview-current-feed)))
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2075
106460
e341c53bc4af Fixed Bug#5096.
Ulf Jasper <ulf.jasper@web.de>
parents: 106408
diff changeset
2076 (provide 'newst-treeview)
95901
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2077
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2078 ;; arch-tag: 5dbaff48-1f3e-4fc6-8ebd-e966fc90d2d4
b4bd9957663d Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff changeset
2079 ;;; newst-treeview.el ends here