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