Mercurial > emacs
annotate lisp/net/newst-plainview.el @ 99738:f84e322e603e
(math-additional-units): Doc fix (active voice).
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 20 Nov 2008 02:44:21 +0000 |
parents | 51d93fabb7cf |
children | a9dc0e7c3f2b |
rev | line source |
---|---|
95901
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1 ;;; newst-plainview.el --- Single buffer frontend for newsticker. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
2 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
3 ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
5 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
6 ;; Author: Ulf Jasper <ulf.jasper@web.de> |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
7 ;; Filename: newst-plainview.el |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
8 ;; URL: http://www.nongnu.org/newsticker |
98692
51d93fabb7cf
newsticker: declare-function compatibility
Ulf Jasper <ulf.jasper@web.de>
parents:
95956
diff
changeset
|
9 ;; Time-stamp: "13. Oktober 2008, 20:34:21 (ulf)" |
95901
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
10 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
11 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
12 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
13 ;; This file is part of GNU Emacs. |
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 ;; 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
|
16 ;; 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
|
17 ;; 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
|
18 ;; (at your option) any later version. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
19 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
20 ;; 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
|
21 ;; 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
|
22 ;; 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
|
23 ;; GNU General Public License for more details. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
24 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
25 ;; 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
|
26 ;; 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
|
27 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
28 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
29 ;;; Commentary: |
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 ;; See newsticker.el |
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 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
34 ;;; Code: |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
35 |
95904
594d82b81559
Renamed newsticker-*.el to newst-*.el. Fixed (require).
Ulf Jasper <ulf.jasper@web.de>
parents:
95901
diff
changeset
|
36 (require 'newsticker-ticker "newst-ticker") |
594d82b81559
Renamed newsticker-*.el to newst-*.el. Fixed (require).
Ulf Jasper <ulf.jasper@web.de>
parents:
95901
diff
changeset
|
37 (require 'newsticker-reader "newst-reader") |
95901
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
38 (require 'derived) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
39 (require 'xml) |
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 ;; Silence warnings |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
42 (defvar w3-mode-map) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
43 (defvar w3m-minor-mode-map) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
44 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
45 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
46 ;;; Customization |
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 (defgroup newsticker-plainview nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
49 "Settings for the simple plain view reader. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
50 See also `newsticker-plainview-hooks'." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
51 :group 'newsticker-reader) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
52 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
53 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
54 (defun newsticker--set-customvar-buffer (symbol value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
55 "Set newsticker-variable SYMBOL value to VALUE. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
56 Calls all actions which are necessary in order to make the new |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
57 value effective." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
58 (if (or (not (boundp symbol)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
59 (equal (symbol-value symbol) value)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
60 (set symbol value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
61 ;; something must have changed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
62 (set symbol value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
63 (newsticker--buffer-set-uptodate nil))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
64 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
65 (defun newsticker--set-customvar-sorting (symbol value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
66 "Set newsticker-variable SYMBOL value to VALUE. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
67 Calls all actions which are necessary in order to make the new |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
68 value effective." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
69 (if (or (not (boundp symbol)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
70 (equal (symbol-value symbol) value)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
71 (set symbol value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
72 ;; something must have changed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
73 (set symbol value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
74 (message "Applying new sort method...") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
75 (when (fboundp 'newsticker--cache-sort) (newsticker--cache-sort)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
76 (when (fboundp 'newsticker--buffer-set-uptodate) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
77 (newsticker--buffer-set-uptodate nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
78 (message "Applying new sort method...done"))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
79 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
80 (defcustom newsticker-sort-method |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
81 'sort-by-original-order |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
82 "Sort method for news items. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
83 The following sort methods are available: |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
84 * `sort-by-original-order' keeps the order in which the items |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
85 appear in the headline file (please note that for immortal items, |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
86 which have been removed from the news feed, there is no original |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
87 order), |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
88 * `sort-by-time' looks at the time at which an item has been seen |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
89 the first time. The most recent item is put at top, |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
90 * `sort-by-title' will put the items in an alphabetical order." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
91 :type '(choice |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
92 (const :tag "Keep original order" sort-by-original-order) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
93 (const :tag "Sort by time" sort-by-time) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
94 (const :tag "Sort by title" sort-by-title)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
95 :set 'newsticker--set-customvar-sorting |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
96 :group 'newsticker-plainview) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
97 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
98 (defcustom newsticker-heading-format |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
99 "%l |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
100 %t %d %s" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
101 "Format string for feed headings. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
102 The following printf-like specifiers can be used: |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
103 %d The date the feed was retrieved. See `newsticker-date-format'. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
104 %l The logo (image) of the feed. Most news feeds provide a small |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
105 image as logo. Newsticker can display them, if Emacs can -- |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
106 see `image-types' for a list of supported image types. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
107 %L The logo (image) of the feed. If the logo is not available |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
108 the title of the feed is used. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
109 %s The statistical data of the feed. See `newsticker-statistics-format'. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
110 %t The title of the feed, i.e. its name." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
111 :type 'string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
112 :set 'newsticker--set-customvar-formatting |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
113 :group 'newsticker-plainview) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
114 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
115 (defcustom newsticker-item-format |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
116 "%t %d" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
117 "Format string for news item headlines. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
118 The following printf-like specifiers can be used: |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
119 %d The date the item was (first) retrieved. See `newsticker-date-format'. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
120 %l The logo (image) of the feed. Most news feeds provide a small |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
121 image as logo. Newsticker can display them, if Emacs can -- |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
122 see `image-types' for a list of supported image types. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
123 %L The logo (image) of the feed. If the logo is not available |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
124 the title of the feed is used. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
125 %t The title of the item." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
126 :type 'string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
127 :set 'newsticker--set-customvar-formatting |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
128 :group 'newsticker-plainview) |
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 (defcustom newsticker-desc-format |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
131 "%d %c" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
132 "Format string for news descriptions (contents). |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
133 The following printf-like specifiers can be used: |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
134 %c The contents (description) of the item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
135 %d The date the item was (first) retrieved. See |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
136 `newsticker-date-format'." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
137 :type 'string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
138 :set 'newsticker--set-customvar-formatting |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
139 :group 'newsticker-plainview) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
140 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
141 (defcustom newsticker-statistics-format |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
142 "[%n + %i + %o + %O = %a]" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
143 "Format for the statistics part in feed lines. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
144 The following printf-like specifiers can be used: |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
145 %a The number of all items in the feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
146 %i The number of immortal items in the feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
147 %n The number of new items in the feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
148 %o The number of old items in the feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
149 %O The number of obsolete items in the feed." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
150 :type 'string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
151 :set 'newsticker--set-customvar-formatting |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
152 :group 'newsticker-plainview) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
153 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
154 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
155 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
156 ;; faces |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
157 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
158 (defface newsticker-new-item-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
159 '((((class color) (background dark)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
160 (:family "helvetica" :bold t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
161 (((class color) (background light)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
162 (:family "helvetica" :bold t))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
163 "Face for new news items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
164 :group 'newsticker-faces) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
165 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
166 (defface newsticker-old-item-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
167 '((((class color) (background dark)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
168 (:family "helvetica" :bold t :foreground "orange3")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
169 (((class color) (background light)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
170 (:family "helvetica" :bold t :foreground "red4"))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
171 "Face for old news items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
172 :group 'newsticker-faces) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
173 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
174 (defface newsticker-immortal-item-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
175 '((((class color) (background dark)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
176 (:family "helvetica" :bold t :italic t :foreground "orange")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
177 (((class color) (background light)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
178 (:family "helvetica" :bold t :italic t :foreground "blue"))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
179 "Face for immortal news items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
180 :group 'newsticker-faces) |
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 (defface newsticker-obsolete-item-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
183 '((((class color) (background dark)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
184 (:family "helvetica" :bold t :strike-through t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
185 (((class color) (background light)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
186 (:family "helvetica" :bold t :strike-through t))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
187 "Face for old news items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
188 :group 'newsticker-faces) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
189 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
190 (defface newsticker-date-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
191 '((((class color) (background dark)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
192 (:family "helvetica" :italic t :height 0.8)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
193 (((class color) (background light)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
194 (:family "helvetica" :italic t :height 0.8))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
195 "Face for newsticker dates." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
196 :group 'newsticker-faces) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
197 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
198 (defface newsticker-statistics-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
199 '((((class color) (background dark)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
200 (:family "helvetica" :italic t :height 0.8)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
201 (((class color) (background light)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
202 (:family "helvetica" :italic t :height 0.8))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
203 "Face for newsticker dates." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
204 :group 'newsticker-faces) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
205 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
206 (defface newsticker-default-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
207 '((((class color) (background dark)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
208 (:inherit default)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
209 (((class color) (background light)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
210 (:inherit default))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
211 "Face for the description of news items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
212 ;;:set 'newsticker--set-customvar |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
213 :group 'newsticker-faces) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
214 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
215 (defcustom newsticker-hide-old-items-in-newsticker-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
216 nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
217 "Decides whether to automatically hide old items in the *newsticker* buffer. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
218 If set to t old items will be completely folded and only new |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
219 items will show up in the *newsticker* buffer. Otherwise old as |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
220 well as new items will be visible." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
221 :type 'boolean |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
222 :set 'newsticker--set-customvar-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
223 :group 'newsticker-plainview) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
224 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
225 (defcustom newsticker-show-descriptions-of-new-items |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
226 t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
227 "Whether to automatically show descriptions of new items in *newsticker*. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
228 If set to t old items will be folded and new items will be |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
229 unfolded. Otherwise old as well as new items will be folded." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
230 :type 'boolean |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
231 :set 'newsticker--set-customvar-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
232 :group 'newsticker-plainview) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
233 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
234 (defcustom newsticker-show-all-news-elements |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
235 nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
236 "Show all news elements." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
237 :type 'boolean |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
238 ;;:set 'newsticker--set-customvar |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
239 :group 'newsticker-plainview) |
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 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
242 ;; hooks |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
243 (defgroup newsticker-plainview-hooks nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
244 "Settings for newsticker hooks which apply to plainview only." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
245 :group 'newsticker-hooks) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
246 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
247 (defcustom newsticker-select-item-hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
248 'newsticker--buffer-make-item-completely-visible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
249 "List of functions run after a headline has been selected. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
250 Each function is called after one of `newsticker-next-item', |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
251 `newsticker-next-new-item', `newsticker-previous-item', |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
252 `newsticker-previous-new-item' has been called. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
253 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
254 The default value 'newsticker--buffer-make-item-completely-visible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
255 assures that the current item is always completely visible." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
256 :type 'hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
257 :options '(newsticker--buffer-make-item-completely-visible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
258 :group 'newsticker-plainview-hooks) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
259 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
260 (defcustom newsticker-select-feed-hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
261 'newsticker--buffer-make-item-completely-visible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
262 "List of functions run after a feed has been selected. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
263 Each function is called after one of `newsticker-next-feed', and |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
264 `newsticker-previous-feed' has been called. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
265 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
266 The default value 'newsticker--buffer-make-item-completely-visible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
267 assures that the current feed is completely visible." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
268 :type 'hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
269 :options '(newsticker--buffer-make-item-completely-visible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
270 :group 'newsticker-plainview-hooks) |
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 (defcustom newsticker-buffer-change-hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
273 'newsticker-w3m-show-inline-images |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
274 "List of functions run after the newsticker buffer has been updated. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
275 Each function is called after `newsticker-buffer-update' has been called. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
276 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
277 The default value '`newsticker-w3m-show-inline-images' loads inline |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
278 images." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
279 :type 'hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
280 :group 'newsticker-plainview-hooks) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
281 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
282 (defcustom newsticker-narrow-hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
283 'newsticker-w3m-show-inline-images |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
284 "List of functions run after narrowing in newsticker buffer has changed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
285 Each function is called after |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
286 `newsticker-toggle-auto-narrow-to-feed' or |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
287 `newsticker-toggle-auto-narrow-to-item' has been called. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
288 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
289 The default value '`newsticker-w3m-show-inline-images' loads inline |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
290 images." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
291 :type 'hook |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
292 :group 'newsticker-plainview-hooks) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
293 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
294 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
295 ;;; Toolbar |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
296 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
297 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
298 (defvar newsticker--plainview-tool-bar-map |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
299 (if (featurep 'xemacs) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
300 nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
301 (if (boundp 'tool-bar-map) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
302 (let ((tool-bar-map (make-sparse-keymap))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
303 (define-key tool-bar-map [newsticker-sep-1] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
304 (list 'menu-item "--double-line")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
305 (define-key tool-bar-map [newsticker-browse-url] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
306 (list 'menu-item "newsticker-browse-url" 'newsticker-browse-url |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
307 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
308 :help "Browse URL for item at point" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
309 :image newsticker--browse-image)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
310 (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
|
311 (list 'menu-item "newsticker-buffer-force-update" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
312 'newsticker-buffer-force-update |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
313 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
314 :help "Update newsticker buffer" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
315 :image newsticker--update-image |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
316 :enable '(not newsticker--buffer-uptodate-p))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
317 (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
|
318 (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
|
319 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
320 :help "Get news for all feeds" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
321 :image newsticker--get-all-image)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
322 (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
|
323 (list 'menu-item "newsticker-mark-item-at-point-as-read" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
324 'newsticker-mark-item-at-point-as-read |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
325 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
326 :image newsticker--mark-read-image |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
327 :help "Mark current item as read" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
328 :enable '(newsticker-item-not-old-p))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
329 (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
|
330 (list 'menu-item "newsticker-mark-item-at-point-as-immortal" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
331 'newsticker-mark-item-at-point-as-immortal |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
332 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
333 :image newsticker--mark-immortal-image |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
334 :help "Mark current item as immortal" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
335 :enable '(newsticker-item-not-immortal-p))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
336 (define-key tool-bar-map [newsticker-toggle-auto-narrow-to-feed] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
337 (list 'menu-item "newsticker-toggle-auto-narrow-to-feed" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
338 'newsticker-toggle-auto-narrow-to-feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
339 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
340 :help "Toggle visibility of other feeds" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
341 :image newsticker--narrow-image)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
342 (define-key tool-bar-map [newsticker-next-feed] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
343 (list 'menu-item "newsticker-next-feed" 'newsticker-next-feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
344 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
345 :help "Go to next feed" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
346 :image newsticker--next-feed-image |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
347 :enable '(newsticker-next-feed-available-p))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
348 (define-key tool-bar-map [newsticker-next-item] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
349 (list 'menu-item "newsticker-next-item" 'newsticker-next-item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
350 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
351 :help "Go to next item" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
352 :image newsticker--next-item-image |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
353 :enable '(newsticker-next-item-available-p))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
354 (define-key tool-bar-map [newsticker-previous-item] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
355 (list 'menu-item "newsticker-previous-item" 'newsticker-previous-item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
356 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
357 :help "Go to previous item" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
358 :image newsticker--previous-item-image |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
359 :enable '(newsticker-previous-item-available-p))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
360 (define-key tool-bar-map [newsticker-previous-feed] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
361 (list 'menu-item "newsticker-previous-feed" 'newsticker-previous-feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
362 :visible t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
363 :help "Go to previous feed" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
364 :image newsticker--previous-feed-image |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
365 :enable '(newsticker-previous-feed-available-p))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
366 ;; standard icons / actions |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
367 (tool-bar-add-item "close" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
368 'newsticker-close-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
369 'newsticker-close-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
370 :help "Close newsticker buffer") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
371 (tool-bar-add-item "preferences" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
372 'newsticker-customize |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
373 'newsticker-customize |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
374 :help "Customize newsticker") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
375 tool-bar-map)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
376 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
377 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
378 ;;; Newsticker mode |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
379 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
380 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
381 (define-derived-mode newsticker-mode fundamental-mode |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
382 "NewsTicker" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
383 "Viewing news feeds in Emacs." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
384 (if (boundp 'tool-bar-map) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
385 (set (make-local-variable 'tool-bar-map) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
386 newsticker--plainview-tool-bar-map)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
387 (set (make-local-variable 'imenu-sort-function) nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
388 (set (make-local-variable 'scroll-conservatively) 999) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
389 (setq imenu-create-index-function 'newsticker--imenu-create-index) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
390 (setq imenu-default-goto-function 'newsticker--imenu-goto) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
391 (setq buffer-read-only t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
392 (auto-fill-mode -1) ;; turn auto-fill off! |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
393 (font-lock-mode -1) ;; turn off font-lock!! |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
394 (set (make-local-variable 'font-lock-defaults) nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
395 (set (make-local-variable 'line-move-ignore-invisible) t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
396 (setq mode-line-format |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
397 (list "-" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
398 'mode-line-mule-info |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
399 'mode-line-modified |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
400 'mode-line-frame-identification |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
401 " Newsticker (" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
402 '(newsticker--buffer-uptodate-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
403 "up to date" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
404 "NEED UPDATE") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
405 ") " |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
406 '(:eval (format "[%d]" (length newsticker--process-ids))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
407 " -- " |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
408 '(:eval (newsticker--buffer-get-feed-title-at-point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
409 ": " |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
410 '(:eval (newsticker--buffer-get-item-title-at-point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
411 " %-")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
412 (add-to-invisibility-spec 't) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
413 (unless newsticker-show-all-news-elements |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
414 (add-to-invisibility-spec 'extra)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
415 (newsticker--buffer-set-uptodate nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
416 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
417 ;; refine its mode-map |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
418 (define-key newsticker-mode-map "sO" 'newsticker-show-old-items) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
419 (define-key newsticker-mode-map "hO" 'newsticker-hide-old-items) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
420 (define-key newsticker-mode-map "sa" 'newsticker-show-all-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
421 (define-key newsticker-mode-map "ha" 'newsticker-hide-all-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
422 (define-key newsticker-mode-map "sf" 'newsticker-show-feed-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
423 (define-key newsticker-mode-map "hf" 'newsticker-hide-feed-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
424 (define-key newsticker-mode-map "so" 'newsticker-show-old-item-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
425 (define-key newsticker-mode-map "ho" 'newsticker-hide-old-item-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
426 (define-key newsticker-mode-map "sn" 'newsticker-show-new-item-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
427 (define-key newsticker-mode-map "hn" 'newsticker-hide-new-item-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
428 (define-key newsticker-mode-map "se" 'newsticker-show-entry) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
429 (define-key newsticker-mode-map "he" 'newsticker-hide-entry) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
430 (define-key newsticker-mode-map "sx" 'newsticker-show-extra) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
431 (define-key newsticker-mode-map "hx" 'newsticker-hide-extra) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
432 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
433 (define-key newsticker-mode-map " " 'scroll-up) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
434 (define-key newsticker-mode-map "q" 'newsticker-close-buffer) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
435 (define-key newsticker-mode-map "p" 'newsticker-previous-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
436 (define-key newsticker-mode-map "P" 'newsticker-previous-new-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
437 (define-key newsticker-mode-map "F" 'newsticker-previous-feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
438 (define-key newsticker-mode-map "\t" 'newsticker-next-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
439 (define-key newsticker-mode-map "n" 'newsticker-next-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
440 (define-key newsticker-mode-map "N" 'newsticker-next-new-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
441 (define-key newsticker-mode-map "f" 'newsticker-next-feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
442 (define-key newsticker-mode-map "M" 'newsticker-mark-all-items-as-read) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
443 (define-key newsticker-mode-map "m" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
444 'newsticker-mark-all-items-at-point-as-read-and-redraw) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
445 (define-key newsticker-mode-map "o" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
446 'newsticker-mark-item-at-point-as-read) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
447 (define-key newsticker-mode-map "O" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
448 'newsticker-mark-all-items-at-point-as-read) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
449 (define-key newsticker-mode-map "G" 'newsticker-get-all-news) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
450 (define-key newsticker-mode-map "g" 'newsticker-get-news-at-point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
451 (define-key newsticker-mode-map "u" 'newsticker-buffer-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
452 (define-key newsticker-mode-map "U" 'newsticker-buffer-force-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
453 (define-key newsticker-mode-map "a" 'newsticker-add-url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
454 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
455 (define-key newsticker-mode-map "i" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
456 'newsticker-mark-item-at-point-as-immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
457 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
458 (define-key newsticker-mode-map "xf" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
459 'newsticker-toggle-auto-narrow-to-feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
460 (define-key newsticker-mode-map "xi" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
461 'newsticker-toggle-auto-narrow-to-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
462 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
463 ;; maps for the clickable portions |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
464 (defvar newsticker--url-keymap (make-sparse-keymap) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
465 "Key map for click-able headings in the newsticker buffer.") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
466 (define-key newsticker--url-keymap [mouse-1] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
467 'newsticker-mouse-browse-url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
468 (define-key newsticker--url-keymap [mouse-2] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
469 'newsticker-mouse-browse-url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
470 (define-key newsticker--url-keymap "\n" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
471 'newsticker-browse-url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
472 (define-key newsticker--url-keymap "\C-m" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
473 'newsticker-browse-url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
474 (define-key newsticker--url-keymap [(control return)] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
475 'newsticker-handle-url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
476 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
477 ;; newsticker menu |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
478 (defvar newsticker-menu (make-sparse-keymap "Newsticker")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
479 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
480 (define-key newsticker-menu [newsticker-browse-url] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
481 '("Browse URL for item at point" . newsticker-browse-url)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
482 (define-key newsticker-menu [newsticker-separator-1] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
483 '("--")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
484 (define-key newsticker-menu [newsticker-buffer-update] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
485 '("Update buffer" . newsticker-buffer-update)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
486 (define-key newsticker-menu [newsticker-separator-2] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
487 '("--")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
488 (define-key newsticker-menu [newsticker-get-all-news] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
489 '("Get news from all feeds" . newsticker-get-all-news)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
490 (define-key newsticker-menu [newsticker-get-news-at-point] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
491 '("Get news from feed at point" . newsticker-get-news-at-point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
492 (define-key newsticker-menu [newsticker-separator-3] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
493 '("--")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
494 (define-key newsticker-menu [newsticker-mark-all-items-as-read] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
495 '("Mark all items as read" . newsticker-mark-all-items-as-read)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
496 (define-key newsticker-menu [newsticker-mark-all-items-at-point-as-read] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
497 '("Mark all items in feed at point as read" . |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
498 newsticker-mark-all-items-at-point-as-read)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
499 (define-key newsticker-menu [newsticker-mark-item-at-point-as-read] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
500 '("Mark item at point as read" . |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
501 newsticker-mark-item-at-point-as-read)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
502 (define-key newsticker-menu [newsticker-mark-item-at-point-as-immortal] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
503 '("Toggle immortality for item at point" . |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
504 newsticker-mark-item-at-point-as-immortal)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
505 (define-key newsticker-menu [newsticker-separator-4] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
506 '("--")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
507 (define-key newsticker-menu [newsticker-toggle-auto-narrow-to-item] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
508 '("Narrow to single item" . newsticker-toggle-auto-narrow-to-item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
509 (define-key newsticker-menu [newsticker-toggle-auto-narrow-to-feed] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
510 '("Narrow to single news feed" . newsticker-toggle-auto-narrow-to-feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
511 (define-key newsticker-menu [newsticker-hide-old-items] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
512 '("Hide old items" . newsticker-hide-old-items)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
513 (define-key newsticker-menu [newsticker-show-old-items] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
514 '("Show old items" . newsticker-show-old-items)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
515 (define-key newsticker-menu [newsticker-next-item] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
516 '("Go to next item" . newsticker-next-item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
517 (define-key newsticker-menu [newsticker-previous-item] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
518 '("Go to previous item" . newsticker-previous-item)) |
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 ;; bind menu to mouse |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
521 (define-key newsticker-mode-map [down-mouse-3] newsticker-menu) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
522 ;; Put menu in menu-bar |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
523 (define-key newsticker-mode-map [menu-bar Newsticker] |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
524 (cons "Newsticker" newsticker-menu)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
525 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
526 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
527 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
528 ;;; User fun |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
529 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
530 ;;;###autoload |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
531 (defun newsticker-plainview () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
532 "Start newsticker plainview." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
533 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
534 (newsticker-buffer-update t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
535 (switch-to-buffer "*newsticker*")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
536 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
537 (defun newsticker-buffer-force-update () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
538 "Update the newsticker buffer, even if not necessary." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
539 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
540 (newsticker-buffer-update t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
541 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
542 (defun newsticker-buffer-update (&optional force) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
543 "Update the *newsticker* buffer. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
544 Unless FORCE is t this is done only if necessary, i.e. when the |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
545 *newsticker* buffer is not up-to-date." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
546 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
547 ;; bring cache data into proper order.... |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
548 (newsticker--cache-sort) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
549 ;; fill buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
550 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
551 (let ((buf (get-buffer "*newsticker*"))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
552 (if buf |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
553 (switch-to-buffer buf) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
554 (switch-to-buffer (get-buffer-create "*newsticker*")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
555 (newsticker--buffer-set-uptodate nil))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
556 (when (or force |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
557 (not newsticker--buffer-uptodate-p)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
558 (message "Preparing newsticker buffer...") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
559 (setq buffer-undo-list t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
560 (let ((inhibit-read-only t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
561 (set-buffer-modified-p nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
562 (erase-buffer) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
563 (newsticker-mode) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
564 ;; Emacs 21.3.50 does not care if we turn off auto-fill in the |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
565 ;; definition of newsticker-mode, so we do it here (again) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
566 (auto-fill-mode -1) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
567 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
568 (set-buffer-file-coding-system 'utf-8) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
569 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
570 (if newsticker-use-full-width |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
571 (set (make-local-variable 'fill-column) (1- (window-width)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
572 (newsticker--buffer-insert-all-items) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
573 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
574 ;; FIXME: needed for methods buffer in ecb |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
575 ;; (set-visited-file-name "*newsticker*") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
576 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
577 (set-buffer-modified-p nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
578 (newsticker-hide-all-desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
579 (if newsticker-hide-old-items-in-newsticker-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
580 (newsticker-hide-old-items)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
581 (if newsticker-show-descriptions-of-new-items |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
582 (newsticker-show-new-item-desc)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
583 ) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
584 (message "")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
585 (newsticker--buffer-set-uptodate t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
586 (run-hooks 'newsticker-buffer-change-hook))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
587 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
588 (defun newsticker-get-news-at-point () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
589 "Launch retrieval of news for the feed point is in. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
590 This does NOT start the retrieval timers." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
591 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
592 ;; launch retrieval of news |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
593 (let ((feed (get-text-property (point) 'feed))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
594 (when feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
595 (newsticker--debug-msg "Getting news for %s" (symbol-name feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
596 (newsticker-get-news (symbol-name feed))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
597 |
98692
51d93fabb7cf
newsticker: declare-function compatibility
Ulf Jasper <ulf.jasper@web.de>
parents:
95956
diff
changeset
|
598 (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
|
599 (declare-function w3m-toggle-inline-image "ext:w3m" (&optional force no-cache)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
600 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
601 (defun newsticker-w3m-show-inline-images () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
602 "Show inline images in visible text ranges. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
603 In-line images in invisible text ranges are hidden. This function |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
604 calls `w3m-toggle-inline-image'. It works only if |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
605 `newsticker-html-renderer' is set to `w3m-region'." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
606 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
607 (if (eq newsticker-html-renderer 'w3m-region) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
608 (let ((inhibit-read-only t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
609 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
610 (save-restriction |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
611 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
612 (goto-char (point-min)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
613 (let ((pos (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
614 (while pos |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
615 (setq pos (next-single-property-change pos 'w3m-image)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
616 (when pos |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
617 (goto-char pos) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
618 (when (get-text-property pos 'w3m-image) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
619 (let ((invis (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
620 (get-text-property (1- (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
621 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
622 buffer-invisibility-spec))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
623 (unless (car (get-text-property (1- (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
624 'display)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
625 (unless invis |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
626 (w3m-toggle-inline-image t))))))))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
627 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
628 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
629 ;;; Keymap stuff |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
630 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
631 (defun newsticker-close-buffer () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
632 "Close the newsticker buffer." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
633 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
634 (newsticker--cache-update t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
635 (bury-buffer)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
636 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
637 (defun newsticker-next-new-item (&optional do-not-wrap-at-eob) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
638 "Go to next new news item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
639 If no new item is found behind point, search is continued at |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
640 beginning of buffer unless optional argument DO-NOT-WRAP-AT-EOB |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
641 is non-nil." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
642 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
643 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
644 (let ((go-ahead t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
645 (while go-ahead |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
646 (unless (newsticker--buffer-goto '(item) 'new) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
647 ;; found nothing -- wrap |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
648 (unless do-not-wrap-at-eob |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
649 (goto-char (point-min)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
650 (newsticker-next-new-item t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
651 (setq go-ahead nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
652 (unless (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
653 (get-text-property (point) 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
654 buffer-invisibility-spec) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
655 ;; this item is invisible -- continue search |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
656 (setq go-ahead nil)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
657 (run-hooks 'newsticker-select-item-hook) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
658 (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
659 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
660 (defun newsticker-previous-new-item (&optional do-not-wrap-at-bob) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
661 "Go to previous new news item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
662 If no new item is found before point, search is continued at |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
663 beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
664 is non-nil." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
665 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
666 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
667 (let ((go-ahead t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
668 (while go-ahead |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
669 (unless (newsticker--buffer-goto '(item) 'new t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
670 (unless do-not-wrap-at-bob |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
671 (goto-char (point-max)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
672 (newsticker--buffer-goto '(item) 'new t))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
673 (unless (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
674 (get-text-property (point) 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
675 buffer-invisibility-spec) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
676 (setq go-ahead nil)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
677 (run-hooks 'newsticker-select-item-hook) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
678 (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
679 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
680 (defun newsticker-next-item (&optional do-not-wrap-at-eob) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
681 "Go to next news item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
682 Return new buffer position. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
683 If no item is found below point, search is continued at beginning |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
684 of buffer unless optional argument DO-NOT-WRAP-AT-EOB is |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
685 non-nil." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
686 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
687 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
688 (let ((go-ahead t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
689 (search-list '(item))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
690 (if newsticker--auto-narrow-to-item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
691 (setq search-list '(item feed))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
692 (while go-ahead |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
693 (unless (newsticker--buffer-goto search-list) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
694 ;; found nothing -- wrap |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
695 (unless do-not-wrap-at-eob |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
696 (goto-char (point-min))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
697 (setq go-ahead nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
698 (unless (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
699 (get-text-property (point) 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
700 buffer-invisibility-spec) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
701 (setq go-ahead nil)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
702 (run-hooks 'newsticker-select-item-hook) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
703 (force-mode-line-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
704 (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
705 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
706 (defun newsticker-next-item-same-feed () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
707 "Go to next news item in the same feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
708 Return new buffer position. If no item is found below point or if |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
709 auto-narrow-to-item is enabled, nil is returned." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
710 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
711 (if newsticker--auto-narrow-to-item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
712 nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
713 (let ((go-ahead t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
714 (current-pos (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
715 (end-of-feed (save-excursion (newsticker--buffer-end-of-feed)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
716 (while go-ahead |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
717 (unless (newsticker--buffer-goto '(item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
718 (setq go-ahead nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
719 (unless (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
720 (get-text-property (point) 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
721 buffer-invisibility-spec) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
722 (setq go-ahead nil))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
723 (if (and (> (point) current-pos) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
724 (< (point) end-of-feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
725 (point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
726 (goto-char current-pos) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
727 nil)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
728 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
729 (defun newsticker-previous-item (&optional do-not-wrap-at-bob) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
730 "Go to previous news item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
731 Return new buffer position. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
732 If no item is found before point, search is continued at |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
733 beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
734 is non-nil." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
735 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
736 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
737 (let ((go-ahead t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
738 (search-list '(item))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
739 (if newsticker--auto-narrow-to-item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
740 (setq search-list '(item feed))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
741 (when (bobp) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
742 (unless do-not-wrap-at-bob |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
743 (goto-char (point-max)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
744 (while go-ahead |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
745 (if (newsticker--buffer-goto search-list nil t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
746 (unless (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
747 (get-text-property (point) 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
748 buffer-invisibility-spec) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
749 (setq go-ahead nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
750 (goto-char (point-min)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
751 (setq go-ahead nil)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
752 (run-hooks 'newsticker-select-item-hook) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
753 (force-mode-line-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
754 (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
755 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
756 (defun newsticker-next-feed () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
757 "Go to next news feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
758 Return new buffer position." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
759 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
760 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
761 (newsticker--buffer-goto '(feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
762 (run-hooks 'newsticker-select-feed-hook) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
763 (force-mode-line-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
764 (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
765 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
766 (defun newsticker-previous-feed () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
767 "Go to previous news feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
768 Return new buffer position." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
769 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
770 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
771 (newsticker--buffer-goto '(feed) nil t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
772 (run-hooks 'newsticker-select-feed-hook) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
773 (force-mode-line-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
774 (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
775 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
776 (defun newsticker-mark-all-items-at-point-as-read-and-redraw () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
777 "Mark all items as read and clear ticker contents." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
778 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
779 (when (or newsticker--buffer-uptodate-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
780 (y-or-n-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
781 "Buffer is not up to date -- really mark items as read? ")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
782 (newsticker-mark-all-items-of-feed-as-read |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
783 (get-text-property (point) 'feed)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
784 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
785 (defun newsticker-mark-all-items-of-feed-as-read (feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
786 "Mark all items of FEED as read, clear ticker, and redraw buffer." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
787 (when feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
788 (let ((pos (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
789 (message "Marking all items as read for %s" (symbol-name feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
790 (newsticker--cache-replace-age newsticker--cache feed 'new 'old) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
791 (newsticker--cache-replace-age newsticker--cache feed 'obsolete |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
792 'old) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
793 (newsticker--cache-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
794 (newsticker--buffer-set-uptodate nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
795 (newsticker--ticker-text-setup) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
796 (newsticker-buffer-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
797 ;; go back to where we came frome |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
798 (goto-char pos) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
799 (end-of-line) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
800 (newsticker--buffer-goto '(feed) nil t)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
801 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
802 (defun newsticker-mark-all-items-at-point-as-read () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
803 "Mark all items as read and clear ticker contents." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
804 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
805 (when (or newsticker--buffer-uptodate-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
806 (y-or-n-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
807 "Buffer is not up to date -- really mark items as read? ")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
808 (newsticker--do-mark-item-at-point-as-read t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
809 (while (newsticker-next-item-same-feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
810 (newsticker--do-mark-item-at-point-as-read t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
811 (newsticker-next-item t))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
812 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
813 (defun newsticker-mark-item-at-point-as-read (&optional respect-immortality) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
814 "Mark item at point as read and move to next item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
815 If optional argument RESPECT-IMMORTALITY is not nil immortal items do |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
816 not get changed." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
817 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
818 (when (or newsticker--buffer-uptodate-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
819 (y-or-n-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
820 "Buffer is not up to date -- really mark this item as read? ")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
821 (newsticker--do-mark-item-at-point-as-read respect-immortality) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
822 ;; move forward |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
823 (newsticker-next-item t))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
824 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
825 (defun newsticker--do-mark-item-at-point-as-read (&optional respect-immortality) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
826 "Mark item at point as read. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
827 If optional argument RESPECT-IMMORTALITY is not nil immortal items do |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
828 not get changed." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
829 (let ((feed (get-text-property (point) 'feed))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
830 (when feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
831 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
832 (newsticker--buffer-beginning-of-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
833 (let ((inhibit-read-only t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
834 (age (get-text-property (point) 'nt-age)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
835 (title (get-text-property (point) 'nt-title)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
836 (guid (get-text-property (point) 'nt-guid)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
837 (nt-desc (get-text-property (point) 'nt-desc)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
838 (pos (save-excursion (newsticker--buffer-end-of-item))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
839 item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
840 (when (or (eq age 'new) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
841 (eq age 'obsolete) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
842 (and (eq age 'immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
843 (not respect-immortality))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
844 ;; find item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
845 (setq item (newsticker--cache-contains newsticker--cache |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
846 feed title nt-desc |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
847 nil nil guid)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
848 ;; mark as old |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
849 (when item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
850 (setcar (nthcdr 4 item) 'old) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
851 (newsticker--do-forget-preformatted item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
852 ;; clean up ticker |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
853 (if (or (and (eq age 'new) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
854 newsticker-hide-immortal-items-in-echo-area) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
855 (and (memq age '(old immortal)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
856 (not |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
857 (eq newsticker-hide-old-items-in-newsticker-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
858 newsticker-hide-immortal-items-in-echo-area)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
859 (newsticker--ticker-text-remove feed title)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
860 ;; set faces etc. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
861 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
862 (save-restriction |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
863 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
864 (put-text-property (point) pos 'nt-age 'old) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
865 (newsticker--buffer-set-faces (point) pos))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
866 (set-buffer-modified-p nil))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
867 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
868 (defun newsticker-mark-item-at-point-as-immortal () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
869 "Mark item at point as read." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
870 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
871 (when (or newsticker--buffer-uptodate-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
872 (y-or-n-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
873 "Buffer is not up to date -- really mark this item as read? ")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
874 (let ((feed (get-text-property (point) 'feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
875 (item nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
876 (when feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
877 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
878 (newsticker--buffer-beginning-of-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
879 (let ((inhibit-read-only t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
880 (oldage (get-text-property (point) 'nt-age)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
881 (title (get-text-property (point) 'nt-title)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
882 (guid (get-text-property (point) 'nt-guid)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
883 (pos (save-excursion (newsticker--buffer-end-of-item)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
884 (let ((newage 'immortal)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
885 (if (eq oldage 'immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
886 (setq newage 'old)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
887 (setq item (newsticker--cache-contains newsticker--cache |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
888 feed title nil nil nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
889 guid)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
890 ;; change age |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
891 (when item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
892 (setcar (nthcdr 4 item) newage) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
893 (newsticker--do-forget-preformatted item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
894 (if (or (and (eq newage 'immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
895 newsticker-hide-immortal-items-in-echo-area) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
896 (and (eq newage 'obsolete) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
897 newsticker-hide-obsolete-items-in-echo-area) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
898 (and (eq oldage 'immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
899 (not |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
900 (eq newsticker-hide-old-items-in-newsticker-buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
901 newsticker-hide-immortal-items-in-echo-area)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
902 (newsticker--ticker-text-remove feed title) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
903 (newsticker--ticker-text-setup)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
904 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
905 (save-restriction |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
906 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
907 (put-text-property (point) pos 'nt-age newage) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
908 (if (eq newage 'immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
909 (put-text-property (point) pos 'nt-age 'immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
910 (put-text-property (point) pos 'nt-age 'old)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
911 (newsticker--buffer-set-faces (point) pos)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
912 (if item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
913 (newsticker-next-item t)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
914 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
915 (defun newsticker-mark-all-items-as-read () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
916 "Mark all items as read and clear ticker contents." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
917 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
918 (when (or newsticker--buffer-uptodate-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
919 (y-or-n-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
920 "Buffer is not up to date -- really mark items as read? ")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
921 (newsticker--cache-replace-age newsticker--cache 'any 'new 'old) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
922 (newsticker--buffer-set-uptodate nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
923 (newsticker--ticker-text-setup) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
924 (newsticker--cache-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
925 (newsticker-buffer-update))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
926 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
927 (defun newsticker-hide-extra () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
928 "Hide the extra elements of items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
929 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
930 (newsticker--buffer-hideshow 'extra nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
931 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
932 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
933 (defun newsticker-show-extra () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
934 "Show the extra elements of items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
935 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
936 (newsticker--buffer-hideshow 'extra t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
937 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
938 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
939 (defun newsticker-hide-old-item-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
940 "Hide the description of old items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
941 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
942 (newsticker--buffer-hideshow 'desc-old nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
943 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
944 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
945 (defun newsticker-show-old-item-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
946 "Show the description of old items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
947 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
948 (newsticker--buffer-hideshow 'item-old t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
949 (newsticker--buffer-hideshow 'desc-old t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
950 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
951 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
952 (defun newsticker-hide-new-item-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
953 "Hide the description of new items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
954 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
955 (newsticker--buffer-hideshow 'desc-new nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
956 (newsticker--buffer-hideshow 'desc-immortal nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
957 (newsticker--buffer-hideshow 'desc-obsolete nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
958 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
959 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
960 (defun newsticker-show-new-item-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
961 "Show the description of new items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
962 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
963 (newsticker--buffer-hideshow 'desc-new t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
964 (newsticker--buffer-hideshow 'desc-immortal t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
965 (newsticker--buffer-hideshow 'desc-obsolete t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
966 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
967 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
968 (defun newsticker-hide-feed-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
969 "Hide the description of feeds." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
970 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
971 (newsticker--buffer-hideshow 'desc-feed nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
972 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
973 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
974 (defun newsticker-show-feed-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
975 "Show the description of old items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
976 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
977 (newsticker--buffer-hideshow 'desc-feed t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
978 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
979 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
980 (defun newsticker-hide-all-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
981 "Hide the descriptions of feeds and all items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
982 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
983 (newsticker--buffer-hideshow 'desc-feed nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
984 (newsticker--buffer-hideshow 'desc-immortal nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
985 (newsticker--buffer-hideshow 'desc-obsolete nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
986 (newsticker--buffer-hideshow 'desc-new nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
987 (newsticker--buffer-hideshow 'desc-old nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
988 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
989 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
990 (defun newsticker-show-all-desc () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
991 "Show the descriptions of feeds and all items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
992 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
993 (newsticker--buffer-hideshow 'desc-feed t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
994 (newsticker--buffer-hideshow 'desc-immortal t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
995 (newsticker--buffer-hideshow 'desc-obsolete t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
996 (newsticker--buffer-hideshow 'desc-new t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
997 (newsticker--buffer-hideshow 'desc-old t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
998 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
999 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1000 (defun newsticker-hide-old-items () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1001 "Hide old items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1002 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1003 (newsticker--buffer-hideshow 'desc-old nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1004 (newsticker--buffer-hideshow 'item-old nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1005 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1006 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1007 (defun newsticker-show-old-items () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1008 "Show old items." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1009 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1010 (newsticker--buffer-hideshow 'item-old t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1011 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1012 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1013 (defun newsticker-hide-entry () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1014 "Hide description of entry at point." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1015 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1016 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1017 (let* (pos1 pos2 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1018 (inhibit-read-only t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1019 inv-prop org-inv-prop |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1020 is-invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1021 (newsticker--buffer-beginning-of-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1022 (newsticker--buffer-goto '(desc)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1023 (setq pos1 (max (point-min) (1- (point)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1024 (newsticker--buffer-goto '(extra feed item nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1025 (setq pos2 (max (point-min) (1- (point)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1026 (setq inv-prop (get-text-property pos1 'invisible)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1027 (setq org-inv-prop (get-text-property pos1 'org-invisible)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1028 (cond ((eq inv-prop t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1029 ;; do nothing |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1030 ) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1031 ((eq org-inv-prop nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1032 (add-text-properties pos1 pos2 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1033 (list 'invisible (list t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1034 'org-invisible inv-prop))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1035 (t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1036 ;; toggle |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1037 (add-text-properties pos1 pos2 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1038 (list 'invisible org-inv-prop)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1039 (remove-text-properties pos1 pos2 '(org-invisible)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1040 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1041 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1042 (defun newsticker-show-entry () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1043 "Show description of entry at point." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1044 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1045 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1046 (let* (pos1 pos2 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1047 (inhibit-read-only t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1048 inv-prop org-inv-prop |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1049 is-invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1050 (newsticker--buffer-beginning-of-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1051 (newsticker--buffer-goto '(desc)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1052 (setq pos1 (max (point-min) (1- (point)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1053 (newsticker--buffer-goto '(extra feed item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1054 (setq pos2 (max (point-min) (1- (point)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1055 (setq inv-prop (get-text-property pos1 'invisible)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1056 (setq org-inv-prop (get-text-property pos1 'org-invisible)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1057 (cond ((eq org-inv-prop nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1058 (add-text-properties pos1 pos2 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1059 (list 'invisible nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1060 'org-invisible inv-prop))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1061 (t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1062 ;; toggle |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1063 (add-text-properties pos1 pos2 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1064 (list 'invisible org-inv-prop)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1065 (remove-text-properties pos1 pos2 '(org-invisible)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1066 (newsticker--buffer-redraw)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1067 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1068 (defun newsticker-toggle-auto-narrow-to-feed () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1069 "Toggle narrowing to current news feed. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1070 If auto-narrowing is active, only news item of the current feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1071 are visible." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1072 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1073 (newsticker-set-auto-narrow-to-feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1074 (not newsticker--auto-narrow-to-feed))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1075 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1076 (defun newsticker-set-auto-narrow-to-feed (value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1077 "Turn narrowing to current news feed on or off. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1078 If VALUE is nil, auto-narrowing is turned off, otherwise it is turned on." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1079 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1080 (setq newsticker--auto-narrow-to-item nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1081 (setq newsticker--auto-narrow-to-feed value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1082 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1083 (newsticker--buffer-make-item-completely-visible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1084 (run-hooks 'newsticker-narrow-hook)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1085 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1086 (defun newsticker-toggle-auto-narrow-to-item () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1087 "Toggle narrowing to current news item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1088 If auto-narrowing is active, only one item of the current feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1089 is visible." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1090 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1091 (newsticker-set-auto-narrow-to-item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1092 (not newsticker--auto-narrow-to-item))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1093 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1094 (defun newsticker-set-auto-narrow-to-item (value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1095 "Turn narrowing to current news item on or off. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1096 If VALUE is nil, auto-narrowing is turned off, otherwise it is turned on." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1097 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1098 (setq newsticker--auto-narrow-to-feed nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1099 (setq newsticker--auto-narrow-to-item value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1100 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1101 (newsticker--buffer-make-item-completely-visible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1102 (run-hooks 'newsticker-narrow-hook)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1103 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1104 (defun newsticker-next-feed-available-p () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1105 "Return t if position is before last feed, nil otherwise." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1106 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1107 (let ((p (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1108 (newsticker--buffer-goto '(feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1109 (not (= p (point)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1110 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1111 (defun newsticker-previous-feed-available-p () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1112 "Return t if position is behind first feed, nil otherwise." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1113 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1114 (let ((p (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1115 (newsticker--buffer-goto '(feed) nil t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1116 (not (= p (point)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1117 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1118 (defun newsticker-next-item-available-p () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1119 "Return t if position is before last feed, nil otherwise." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1120 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1121 (catch 'result |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1122 (while (< (point) (point-max)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1123 (unless (newsticker--buffer-goto '(item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1124 (throw 'result nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1125 (unless (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1126 (get-text-property (point) 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1127 buffer-invisibility-spec) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1128 (throw 'result t)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1129 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1130 (defun newsticker-previous-item-available-p () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1131 "Return t if position is behind first item, nil otherwise." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1132 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1133 (catch 'result |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1134 (while (> (point) (point-min)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1135 (unless (newsticker--buffer-goto '(item) nil t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1136 (throw 'result nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1137 (unless (newsticker--lists-intersect-p |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1138 (get-text-property (point) 'invisible) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1139 buffer-invisibility-spec) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1140 (throw 'result t)))))) |
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 (defun newsticker-item-not-old-p () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1143 "Return t if there is an item at point which is not old, nil otherwise." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1144 (when (get-text-property (point) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1145 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1146 (newsticker--buffer-beginning-of-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1147 (let ((age (get-text-property (point) 'nt-age))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1148 (and (memq age '(new immortal obsolete)) t))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1149 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1150 (defun newsticker-item-not-immortal-p () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1151 "Return t if there is an item at point which is not immortal, nil otherwise." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1152 (when (get-text-property (point) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1153 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1154 (newsticker--buffer-beginning-of-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1155 (let ((age (get-text-property (point) 'nt-age))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1156 (and (memq age '(new old obsolete)) t))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1157 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1158 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1159 ;;; Imenu stuff |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1160 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1161 (defun newsticker--imenu-create-index () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1162 "Scan newsticker buffer and return an index for imenu." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1163 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1164 (goto-char (point-min)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1165 (let ((index-alist nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1166 (feed-list nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1167 (go-ahead t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1168 (while go-ahead |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1169 (let ((type (get-text-property (point) 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1170 (title (get-text-property (point) 'nt-title))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1171 (cond ((eq type 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1172 ;; we're on a feed heading |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1173 (when feed-list |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1174 (if index-alist |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1175 (nconc index-alist (list feed-list)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1176 (setq index-alist (list feed-list)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1177 (setq feed-list (list title))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1178 (t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1179 (nconc feed-list |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1180 (list (cons title (point))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1181 (setq go-ahead (newsticker--buffer-goto '(item feed)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1182 (if index-alist |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1183 (nconc index-alist (list feed-list)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1184 (setq index-alist (list feed-list))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1185 index-alist))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1186 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1187 (defun newsticker--imenu-goto (name pos &rest args) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1188 "Go to item NAME at position POS and show item. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1189 ARGS are ignored." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1190 (goto-char pos) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1191 ;; show headline |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1192 (newsticker--buffer-goto '(desc extra feed item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1193 (let* ((inhibit-read-only t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1194 (pos1 (max (point-min) (1- pos))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1195 (pos2 (max pos1 (1- (point)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1196 (inv-prop (get-text-property pos 'invisible)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1197 (org-inv-prop (get-text-property pos 'org-invisible))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1198 (when (eq org-inv-prop nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1199 (add-text-properties pos1 pos2 (list 'invisible nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1200 'org-invisible inv-prop)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1201 ;; show desc |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1202 (newsticker-show-entry)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1203 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1204 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1205 ;;; Buffer stuff |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1206 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1207 (defun newsticker--buffer-set-uptodate (value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1208 "Set the uptodate-status of the newsticker buffer to VALUE. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1209 The mode-line is changed accordingly." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1210 (setq newsticker--buffer-uptodate-p value) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1211 (let ((b (get-buffer "*newsticker*"))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1212 (when b |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1213 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1214 (set-buffer b) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1215 (if value |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1216 (setq mode-name "Newsticker -- up to date -- ") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1217 (setq mode-name "Newsticker -- NEED UPDATE -- "))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1218 (force-mode-line-update 0)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1219 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1220 (defun newsticker--buffer-redraw () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1221 "Redraw the newsticker window." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1222 (if (fboundp 'force-window-update) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1223 (force-window-update (current-buffer)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1224 (redraw-frame (selected-frame))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1225 (run-hooks 'newsticker-buffer-change-hook) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1226 (sit-for 0)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1227 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1228 (defun newsticker--buffer-insert-all-items () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1229 "Insert all cached newsticker items into the current buffer. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1230 Keeps order of feeds as given in `newsticker-url-list' and |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1231 `newsticker-url-list-defaults'." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1232 (goto-char (point-min)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1233 (mapc (lambda (url-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1234 (let* ((feed-name (car url-item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1235 (feed-name-symbol (intern feed-name)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1236 (feed (assoc feed-name-symbol newsticker--cache)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1237 (items (cdr feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1238 (pos (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1239 (when feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1240 ;; insert the feed description |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1241 (mapc (lambda (item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1242 (when (eq (newsticker--age item) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1243 (newsticker--buffer-insert-item item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1244 feed-name-symbol))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1245 items) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1246 ;;insert the items |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1247 (mapc (lambda (item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1248 (if (memq (newsticker--age item) '(new immortal old |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1249 obsolete)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1250 (newsticker--buffer-insert-item item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1251 feed-name-symbol))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1252 items) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1253 (put-text-property pos (point) 'feed (car feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1254 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1255 ;; insert empty line between feeds |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1256 (let ((p (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1257 (insert "\n") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1258 (put-text-property p (point) 'hard t))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1259 (append newsticker-url-list newsticker-url-list-defaults)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1260 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1261 (newsticker--buffer-set-faces (point-min) (point-max)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1262 (newsticker--buffer-set-invisibility (point-min) (point-max)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1263 (goto-char (point-min))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1264 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1265 (defun newsticker--buffer-insert-item (item &optional feed-name-symbol) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1266 "Insert a news item in the current buffer. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1267 Insert a formatted representation of the ITEM. The optional parameter |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1268 FEED-NAME-SYMBOL determines how the item is formatted and whether the |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1269 item-retrieval time is added as well." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1270 ;; insert headline |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1271 (if (eq (newsticker--age item) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1272 (newsticker--buffer-do-insert-text item 'feed feed-name-symbol) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1273 (newsticker--buffer-do-insert-text item 'item feed-name-symbol)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1274 ;; insert the description |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1275 (newsticker--buffer-do-insert-text item 'desc feed-name-symbol)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1276 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1277 (defun newsticker--buffer-do-insert-text (item type feed-name-symbol) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1278 "Actually insert contents of news item, format it, render it and all that. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1279 ITEM is a news item, TYPE tells which part of the item shall be inserted, |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1280 FEED-NAME-SYMBOL tells to which feed this item belongs." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1281 (let* ((pos (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1282 (format newsticker-desc-format) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1283 (pos-date-start nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1284 (pos-date-end nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1285 (pos-stat-start nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1286 (pos-stat-end nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1287 (pos-text-start nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1288 (pos-text-end nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1289 (pos-extra-start nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1290 (pos-extra-end nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1291 (pos-enclosure-start nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1292 (pos-enclosure-end nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1293 (age (newsticker--age item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1294 (preformatted-contents (newsticker--preformatted-contents item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1295 (preformatted-title (newsticker--preformatted-title item))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1296 (cond ((and preformatted-contents |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1297 (not (eq (aref preformatted-contents 0) ?\n));; we must |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1298 ;; NOT have a line |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1299 ;; break! |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1300 (eq type 'desc)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1301 (insert preformatted-contents)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1302 ((and preformatted-title |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1303 (not (eq (aref preformatted-title 0) ?\n));; we must NOT have a |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1304 ;; line break! |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1305 (eq type 'item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1306 (insert preformatted-title)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1307 (t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1308 ;; item was not formatted before. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1309 ;; Let's go. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1310 (if (eq type 'item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1311 (setq format newsticker-item-format) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1312 (if (eq type 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1313 (setq format newsticker-heading-format))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1314 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1315 (while (> (length format) 0) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1316 (let ((prefix (if (> (length format) 1) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1317 (substring format 0 2) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1318 ""))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1319 (cond ((string= "%c" prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1320 ;; contents |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1321 (when (newsticker--desc item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1322 (setq pos-text-start (point-marker)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1323 (insert (newsticker--desc item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1324 (setq pos-text-end (point-marker))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1325 (setq format (substring format 2))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1326 ((string= "%d" prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1327 ;; date |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1328 (setq pos-date-start (point-marker)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1329 (if (newsticker--time item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1330 (insert (format-time-string newsticker-date-format |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1331 (newsticker--time item)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1332 (setq pos-date-end (point-marker)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1333 (setq format (substring format 2))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1334 ((string= "%l" prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1335 ;; logo |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1336 (let ((disabled (cond ((eq (newsticker--age item) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1337 (= (newsticker--stat-num-items |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1338 feed-name-symbol 'new) 0)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1339 (t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1340 (not (eq (newsticker--age item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1341 'new)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1342 (let ((img (newsticker--image-read feed-name-symbol |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1343 disabled))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1344 (when img |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1345 (newsticker--insert-image img (car item))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1346 (setq format (substring format 2))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1347 ((string= "%L" prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1348 ;; logo or title |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1349 (let ((disabled (cond ((eq (newsticker--age item) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1350 (= (newsticker--stat-num-items |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1351 feed-name-symbol 'new) 0)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1352 (t |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1353 (not (eq (newsticker--age item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1354 'new)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1355 (let ((img (newsticker--image-read feed-name-symbol |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1356 disabled))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1357 (if img |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1358 (newsticker--insert-image img (car item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1359 (when (car item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1360 (setq pos-text-start (point-marker)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1361 (if (eq (newsticker--age item) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1362 (insert (newsticker--title item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1363 ;; FIXME: This is not the "real" title! |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1364 (insert (format "%s" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1365 (car (newsticker--cache-get-feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1366 feed-name-symbol))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1367 (setq pos-text-end (point-marker)))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1368 (setq format (substring format 2))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1369 ((string= "%s" prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1370 ;; statistics |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1371 (setq pos-stat-start (point-marker)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1372 (if (eq (newsticker--age item) 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1373 (insert (newsticker--buffer-statistics |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1374 feed-name-symbol))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1375 (setq pos-stat-end (point-marker)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1376 (setq format (substring format 2))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1377 ((string= "%t" prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1378 ;; title |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1379 (when (car item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1380 (setq pos-text-start (point-marker)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1381 (insert (car item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1382 (setq pos-text-end (point-marker))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1383 (setq format (substring format 2))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1384 ((string-match "%." prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1385 ;; unknown specifier! |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1386 (insert prefix) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1387 (setq format (substring format 2))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1388 ((string-match "^\\([^%]*\\)\\(.*\\)" format) ;; FIXME! |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1389 ;; everything else |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1390 (let ((p (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1391 (insert (substring format |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1392 (match-beginning 1) (match-end 1))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1393 ;; in case that the format string contained newlines |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1394 (put-text-property p (point) 'hard t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1395 (setq format (substring format (match-beginning 2))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1396 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1397 ;; decode HTML if possible... |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1398 (let ((is-rendered-HTML nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1399 (when (and newsticker-html-renderer pos-text-start pos-text-end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1400 (condition-case error-data |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1401 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1402 ;; 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
|
1403 ;; (regexp inspired by htmlr.el) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1404 (goto-char pos-text-start) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1405 (when (re-search-forward |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1406 "</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" pos-text-end t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1407 ;; (message "%s" (newsticker--title item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1408 (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
|
1409 -1 fill-column)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1410 (w3-maximum-line-length |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1411 (if newsticker-use-full-width nil fill-column))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1412 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1413 (funcall newsticker-html-renderer pos-text-start |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1414 pos-text-end))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1415 (cond ((eq newsticker-html-renderer 'w3m-region) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1416 (add-text-properties pos (point-max) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1417 (list 'keymap |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1418 w3m-minor-mode-map))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1419 ((eq newsticker-html-renderer 'w3-region) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1420 (add-text-properties pos (point-max) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1421 (list 'keymap w3-mode-map)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1422 (setq is-rendered-HTML t))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1423 (error |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1424 (message "Error: HTML rendering failed: %s, %s" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1425 (car error-data) (cdr error-data))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1426 ;; After html rendering there might be chunks of blank |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1427 ;; characters between rendered text and date, statistics or |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1428 ;; whatever. Remove it |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1429 (when (and (eq type 'item) is-rendered-HTML) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1430 (goto-char pos) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1431 (while (re-search-forward "[ \t]*\n[ \t]*" nil t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1432 (replace-match " " nil nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1433 (goto-char (point-max))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1434 (when (and newsticker-justification |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1435 (memq type '(item desc)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1436 (not is-rendered-HTML)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1437 (condition-case nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1438 (let ((use-hard-newlines t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1439 (fill-region pos (point-max) newsticker-justification)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1440 (error nil)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1441 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1442 ;; remove leading and trailing newlines |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1443 (goto-char pos) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1444 (unless (= 0 (skip-chars-forward " \t\r\n")) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1445 (delete-region pos (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1446 (goto-char (point-max)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1447 (let ((end (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1448 (unless (= 0 (skip-chars-backward " \t\r\n" (1+ pos))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1449 (delete-region (point) end))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1450 (goto-char (point-max)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1451 ;; closing newline |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1452 (unless nil ;;(eq pos (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1453 (insert "\n") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1454 (put-text-property (1- (point)) (point) 'hard t)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1455 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1456 ;; insert enclosure element |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1457 (when (eq type 'desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1458 (setq pos-enclosure-start (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1459 (newsticker--insert-enclosure item newsticker--url-keymap) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1460 (setq pos-enclosure-end (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1461 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1462 ;; show extra elements |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1463 (when (eq type 'desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1464 (goto-char (point-max)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1465 (setq pos-extra-start (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1466 (newsticker--print-extra-elements item newsticker--url-keymap) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1467 (setq pos-extra-end (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1468 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1469 ;; text properties |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1470 (when (memq type '(feed item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1471 (add-text-properties pos (1- (point)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1472 (list 'mouse-face 'highlight |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1473 'nt-link (newsticker--link item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1474 'help-echo |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1475 (format "mouse-2: visit item (%s)" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1476 (newsticker--link item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1477 'keymap newsticker--url-keymap)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1478 (add-text-properties pos (point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1479 (list 'nt-title (newsticker--title item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1480 'nt-desc (newsticker--desc item)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1481 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1482 (add-text-properties pos (point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1483 (list 'nt-type type |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1484 'nt-face type |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1485 'nt-age age |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1486 'nt-guid (newsticker--guid item))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1487 (when (and pos-date-start pos-date-end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1488 (put-text-property pos-date-start pos-date-end 'nt-face 'date)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1489 (when (and pos-stat-start pos-stat-end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1490 (put-text-property pos-stat-start pos-stat-end 'nt-face 'stat)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1491 (when (and pos-extra-start pos-extra-end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1492 (put-text-property pos-extra-start pos-extra-end |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1493 'nt-face 'extra) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1494 (put-text-property pos-extra-start pos-extra-end |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1495 'nt-type 'extra)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1496 (when (and pos-enclosure-start pos-enclosure-end |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1497 (> pos-enclosure-end pos-enclosure-start)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1498 (put-text-property pos-enclosure-start (1- pos-enclosure-end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1499 'nt-face 'enclosure)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1500 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1501 ;; left margin |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1502 ;;(unless (memq type '(feed item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1503 ;;(set-left-margin pos (1- (point)) 1)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1504 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1505 ;; save rendered stuff |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1506 (cond ((eq type 'desc) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1507 ;; preformatted contents |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1508 (newsticker--cache-set-preformatted-contents |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1509 item (buffer-substring pos (point)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1510 ((eq type 'item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1511 ;; preformatted title |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1512 (newsticker--cache-set-preformatted-title |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1513 item (buffer-substring pos (point))))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1514 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1515 (defun newsticker--buffer-statistics (feed-name-symbol) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1516 "Return a statistic string for the feed given by FEED-NAME-SYMBOL. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1517 See `newsticker-statistics-format'." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1518 (let ((case-fold-search nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1519 (replace-regexp-in-string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1520 "%a" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1521 (format "%d" (newsticker--stat-num-items feed-name-symbol)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1522 (replace-regexp-in-string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1523 "%i" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1524 (format "%d" (newsticker--stat-num-items feed-name-symbol 'immortal)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1525 (replace-regexp-in-string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1526 "%n" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1527 (format "%d" (newsticker--stat-num-items feed-name-symbol 'new)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1528 (replace-regexp-in-string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1529 "%o" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1530 (format "%d" (newsticker--stat-num-items feed-name-symbol 'old)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1531 (replace-regexp-in-string |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1532 "%O" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1533 (format "%d" (newsticker--stat-num-items feed-name-symbol 'obsolete)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1534 newsticker-statistics-format))))))) |
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--buffer-set-faces (start end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1537 "Add face properties according to mark property. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1538 Scans the buffer between START and END." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1539 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1540 (put-text-property start end 'face 'newsticker-default-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1541 (goto-char start) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1542 (let ((pos1 start) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1543 (pos2 1) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1544 (nt-face (get-text-property start 'nt-face)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1545 (nt-age (get-text-property start 'nt-age))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1546 (when nt-face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1547 (setq pos2 (next-single-property-change (point) 'nt-face)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1548 (newsticker--set-face-properties pos1 pos2 nt-face nt-age) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1549 (setq nt-face (get-text-property pos2 'nt-face)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1550 (setq pos1 pos2)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1551 (while (and (setq pos2 (next-single-property-change pos1 'nt-face)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1552 (<= pos2 end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1553 (> pos2 pos1)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1554 (newsticker--set-face-properties pos1 pos2 nt-face nt-age) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1555 (setq nt-face (get-text-property pos2 'nt-face)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1556 (setq nt-age (get-text-property pos2 'nt-age)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1557 (setq pos1 pos2))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1558 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1559 (defun newsticker--buffer-set-invisibility (start end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1560 "Add invisibility properties according to nt-type property. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1561 Scans the buffer between START and END. Sets the 'invisible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1562 property to '(<nt-type>-<nt-age> <nt-type> <nt-age>)." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1563 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1564 ;; reset invisibility settings |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1565 (put-text-property start end 'invisible nil) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1566 ;; let's go |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1567 (goto-char start) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1568 (let ((pos1 start) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1569 (pos2 1) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1570 (nt-type (get-text-property start 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1571 (nt-age (get-text-property start 'nt-age))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1572 (when nt-type |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1573 (setq pos2 (next-single-property-change (point) 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1574 (put-text-property (max (point-min) pos1) (1- pos2) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1575 'invisible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1576 (list (intern |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1577 (concat |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1578 (symbol-name |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1579 (if (eq nt-type 'extra) 'desc nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1580 "-" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1581 (symbol-name nt-age))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1582 nt-type |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1583 nt-age)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1584 (setq nt-type (get-text-property pos2 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1585 (setq pos1 pos2)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1586 (while (and (setq pos2 (next-single-property-change pos1 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1587 (<= pos2 end) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1588 (> pos2 pos1)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1589 ;; must shift one char to the left in order to handle inivisible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1590 ;; newlines, motion in invisible text areas and all that correctly |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1591 (put-text-property (1- pos1) (1- pos2) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1592 'invisible |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1593 (list (intern |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1594 (concat |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1595 (symbol-name |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1596 (if (eq nt-type 'extra) 'desc nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1597 "-" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1598 (symbol-name nt-age))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1599 nt-type |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1600 nt-age)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1601 (setq nt-type (get-text-property pos2 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1602 (setq nt-age (get-text-property pos2 'nt-age)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1603 (setq pos1 pos2))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1604 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1605 (defun newsticker--set-face-properties (pos1 pos2 nt-face age) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1606 "Set the face for the text between the positions POS1 and POS2. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1607 The face is chosen according the values of NT-FACE and AGE." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1608 (let ((face (cond ((eq nt-face 'feed) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1609 'newsticker-feed-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1610 ((eq nt-face 'item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1611 (cond ((eq age 'new) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1612 'newsticker-new-item-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1613 ((eq age 'old) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1614 'newsticker-old-item-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1615 ((eq age 'immortal) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1616 'newsticker-immortal-item-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1617 ((eq age 'obsolete) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1618 'newsticker-obsolete-item-face))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1619 ((eq nt-face 'date) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1620 'newsticker-date-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1621 ((eq nt-face 'stat) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1622 'newsticker-statistics-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1623 ((eq nt-face 'extra) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1624 'newsticker-extra-face) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1625 ((eq nt-face 'enclosure) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1626 'newsticker-enclosure-face)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1627 (when face |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1628 (put-text-property pos1 (max pos1 pos2) 'face face)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1629 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1630 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1631 ;;; Functions working on the *newsticker* buffer |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1632 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1633 (defun newsticker--buffer-make-item-completely-visible () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1634 "Scroll buffer until current item is completely visible." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1635 (when newsticker--auto-narrow-to-feed |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1636 (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1637 (point-min))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1638 (max (or (save-excursion (newsticker--buffer-end-of-feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1639 (point-max)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1640 (narrow-to-region min max))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1641 (when newsticker--auto-narrow-to-item |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1642 (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1643 (point-min))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1644 (max (or (save-excursion (newsticker--buffer-end-of-item)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1645 (point-max)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1646 (narrow-to-region min max))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1647 (sit-for 0) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1648 ;; do not count lines and stuff because that does not work when images |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1649 ;; are displayed. Do it the simple way: |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1650 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1651 (newsticker--buffer-end-of-item) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1652 (unless (pos-visible-in-window-p) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1653 (recenter -1))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1654 (unless (pos-visible-in-window-p) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1655 (recenter 0))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1656 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1657 (defun newsticker--buffer-get-feed-title-at-point () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1658 "Return feed symbol of headline at point." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1659 (format "%s" (or (get-text-property (point) 'feed) " "))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1660 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1661 (defun newsticker--buffer-get-item-title-at-point () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1662 "Return feed symbol of headline at point." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1663 (format "%s" (or (get-text-property (point) 'nt-title) " "))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1664 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1665 (defun newsticker--buffer-goto (types &optional age backwards) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1666 "Search next occurrence of TYPES in current buffer. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1667 TYPES is a list of symbols. If TYPES is found point is moved, if |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1668 not point is left unchanged. If optional parameter AGE is not |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1669 nil, the type AND the age must match. If BACKWARDS is t, search |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1670 backwards." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1671 (let ((pos (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1672 (save-restriction |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1673 (widen) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1674 (catch 'found |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1675 (let ((tpos (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1676 (while (setq tpos |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1677 (if backwards |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1678 (if (eq tpos (point-min)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1679 nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1680 (or (previous-single-property-change |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1681 tpos 'nt-type) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1682 (point-min))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1683 (next-single-property-change |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1684 tpos 'nt-type))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1685 (and (memq (get-text-property tpos 'nt-type) types) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1686 (or (not age) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1687 (eq (get-text-property tpos 'nt-age) age)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1688 (throw 'found tpos))))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1689 (when pos |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1690 (goto-char pos)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1691 pos)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1692 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1693 (defun newsticker--buffer-hideshow (mark-age onoff) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1694 "Hide or show items of type MARK-AGE. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1695 If ONOFF is nil the item is hidden, otherwise it is shown." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1696 (if onoff |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1697 (remove-from-invisibility-spec mark-age) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1698 (add-to-invisibility-spec mark-age))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1699 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1700 (defun newsticker--buffer-beginning-of-item () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1701 "Move point to the beginning of the item at point. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1702 Return new position." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1703 (if (bobp) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1704 (point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1705 (let ((type (get-text-property (point) 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1706 (typebefore (get-text-property (1- (point)) 'nt-type))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1707 (if (and (memq type '(item feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1708 (not (eq type typebefore))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1709 (point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1710 (newsticker--buffer-goto '(item feed) nil t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1711 (point))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1712 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1713 (defun newsticker--buffer-beginning-of-feed () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1714 "Move point to the beginning of the feed at point. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1715 Return new position." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1716 (if (bobp) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1717 (point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1718 (let ((type (get-text-property (point) 'nt-type)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1719 (typebefore (get-text-property (1- (point)) 'nt-type))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1720 (if (and (memq type '(feed)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1721 (not (eq type typebefore))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1722 (point) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1723 (newsticker--buffer-goto '(feed) nil t) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1724 (point))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1725 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1726 (defun newsticker--buffer-end-of-item () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1727 "Move point to the end of the item at point. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1728 Take care: end of item is at the end of its last line!" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1729 (when (newsticker--buffer-goto '(item feed nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1730 (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1731 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1732 (defun newsticker--buffer-end-of-feed () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1733 "Move point to the end of the last item of the feed at point. |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1734 Take care: end of item is at the end of its last line!" |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1735 (when (newsticker--buffer-goto '(feed nil)) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1736 (backward-char 1) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1737 (point))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1738 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1739 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1740 ;;; misc |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1741 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1742 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1743 (defun newsticker-mouse-browse-url (event) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1744 "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
|
1745 (interactive "e") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1746 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1747 (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
|
1748 (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
|
1749 'nt-link))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1750 (when url |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1751 (browse-url url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1752 (save-excursion |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1753 (goto-char (posn-point (event-end event))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1754 (if newsticker-automatically-mark-visited-items-as-old |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1755 (newsticker-mark-item-at-point-as-read t))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1756 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1757 (defun newsticker-browse-url () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1758 "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
|
1759 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1760 (let ((url (get-text-property (point) 'nt-link))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1761 (when url |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1762 (browse-url url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1763 (if newsticker-automatically-mark-visited-items-as-old |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1764 (newsticker-mark-item-at-point-as-read t))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1765 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1766 (defvar newsticker-open-url-history |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1767 '("wget" "xmms" "realplay") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1768 "...") |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1769 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1770 (defun newsticker-handle-url () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1771 "Ask for a program to open the link of the item at point." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1772 (interactive) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1773 (let ((url (get-text-property (point) 'nt-link))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1774 (when url |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1775 (let ((prog (read-string "Open url with: " nil |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1776 'newsticker-open-url-history))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1777 (when prog |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1778 (message "%s %s" prog url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1779 (start-process prog prog prog url) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1780 (if newsticker-automatically-mark-visited-items-as-old |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1781 (newsticker-mark-item-at-point-as-read t))))))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1782 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1783 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1784 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1785 ;;; Misc |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1786 ;; ====================================================================== |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1787 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1788 (defun newsticker--cache-sort () |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1789 "Sort the newsticker cache data." |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1790 (let ((sort-fun (cond ((eq newsticker-sort-method 'sort-by-time) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1791 'newsticker--cache-item-compare-by-time) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1792 ((eq newsticker-sort-method 'sort-by-title) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1793 'newsticker--cache-item-compare-by-title) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1794 ((eq newsticker-sort-method 'sort-by-original-order) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1795 'newsticker--cache-item-compare-by-position)))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1796 (mapc (lambda (feed-list) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1797 (setcdr feed-list (sort (cdr feed-list) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1798 sort-fun))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1799 newsticker--cache))) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1800 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1801 (provide 'newsticker-plainview) |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1802 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1803 ;; arch-tag: 4e48b683-d48b-48dd-a13e-fe45baf41184 |
b4bd9957663d
Renamed newsticker-*.el to newst-*.el.
Ulf Jasper <ulf.jasper@web.de>
parents:
diff
changeset
|
1804 ;;; newst-plainview.el ends here |