annotate lisp/net/newsticker.el @ 95302:d63199769a1b

(diary-ordinal-suffix): Declare for compiler.
author Glenn Morris <rgm@gnu.org>
date Mon, 26 May 2008 01:27:31 +0000
parents 91e5880a36c1
children e5ad50007c14
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
1 ;;; newsticker.el --- A Newsticker for Emacs.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
79714
6888fd3398e8 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78229
diff changeset
3 ;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5 ;; This file is part of GNU Emacs.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; Author: Ulf Jasper <ulf.jasper@web.de>
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8 ;; Filename: newsticker.el
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; URL: http://www.nongnu.org/newsticker
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; Created: 17. June 2003
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
11 ;; Keywords: News, RSS, Atom
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
12 ;; Time-stamp: "29. Januar 2007, 21:05:09 (ulf)"
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
13
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
14 ;; ======================================================================
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
16 ;; GNU Emacs is free software: you can redistribute it and/or modify
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; it under the terms of the GNU General Public License as published by
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
18 ;; the Free Software Foundation, either version 3 of the License, or
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
19 ;; (at your option) any later version.
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
20
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
21 ;; GNU Emacs is distributed in the hope that it will be useful,
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
22 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
23 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
24 ;; GNU General Public License for more details.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;; You should have received a copy of the GNU General Public License
94677
91e5880a36c1 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
27 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
29 (defconst newsticker-version "1.10" "Version number of newsticker.el.")
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
30
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;;; Commentary:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; Overview
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;; --------
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
37 ;; Newsticker provides a newsticker for Emacs. A newsticker is a thing
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
38 ;; that asynchronously retrieves headlines from a list of news sites,
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
39 ;; prepares these headlines for reading, and allows for loading the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
40 ;; corresponding articles in a web browser.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
41
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
42 ;; Headlines consist of a title and (possibly) a small description. They
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
43 ;; are contained in "RSS" (RDF Site Summary) or "Atom" files. Newsticker
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
44 ;; should work with the following RSS formats:
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
45 ;; * RSS 0.91
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
46 ;; (see http://backend.userland.com/rss091 or
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
47 ;; http://my.netscape.com/publish/formats/rss-spec-0.91.html)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
48 ;; * RSS 0.92
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
49 ;; (see http://backend.userland.com/rss092)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
50 ;; * RSS 1.0
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
51 ;; (see http://purl.org/rss/1.0/spec)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
52 ;; * RSS 2.0
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
53 ;; (see http://blogs.law.harvard.edu/tech/rss)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
54 ;; as well as the following Atom formats:
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
55 ;; * Atom 0.3
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
56 ;; * Atom 1.0
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
57 ;; (see http://www.ietf.org/internet-drafts/draft-ietf-atompub-format-11.txt)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
58 ;; That makes Newsticker.el an "Atom aggregator, "RSS reader", "RSS
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
59 ;; aggregator", and "Feed Reader".
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ;; Newsticker provides several commands for reading headlines, navigating
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;; through them, marking them as read/unread, hiding old headlines
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
63 ;; etc. Headlines can be displayed as plain text or as rendered HTML.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; Headlines can be displayed in the echo area, either scrolling like
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;; messages in a stock-quote ticker, or just changing.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; Newsticker allows for automatic processing of headlines by providing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ;; hooks and (sample) functions for automatically downloading images and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; enclosed files (as delivered by podcasts, e.g.).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 ;; Requirements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;; ------------
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
74 ;; Newsticker can be used with GNU Emacs version 21.1 or later as well as
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
75 ;; XEmacs. It requires an XML-parser (`xml.el') which is part of GNU
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
76 ;; Emacs. If you are using XEmacs you want to get the `net-utils' package
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 ;; which contains `xml.el' for XEmacs.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ;; Newsticker requires a program which can retrieve files via http and
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
80 ;; prints them to stdout. By default Newsticker will use wget for this
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ;; task.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
83 ;; Installation
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
84 ;; ------------
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
85
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
86 ;; If you are using Newsticker as part of GNU Emacs there is no need to
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
87 ;; perform any installation steps in order to use Newsticker. Otherwise
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
88 ;; place Newsticker in a directory where Emacs can find it. Add the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
89 ;; following line to your Emacs startup file (`~/.emacs').
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
90 ;; (add-to-list 'load-path "/path/to/newsticker/")
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
91 ;; (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
92 ;; (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
93
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
94 ;; If you are using `imenu', which allows for navigating with the help of a
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
95 ;; menu, you should add the following to your Emacs startup file
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
96 ;; (`~/.emacs').
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
97 ;; (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
98
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
99 ;; That's it.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
100
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 ;; Usage
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 ;; -----
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 ;; The command newsticker-show-news will display all available headlines in
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
104 ;; a special buffer, called `*newsticker*'. It will also start the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
105 ;; asynchronous download of headlines. The modeline in the `*newsticker*'
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
106 ;; buffer informs whenever new headlines have arrived. Clicking
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 ;; mouse-button 2 or pressing RET in this buffer on a headline will call
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 ;; browse-url to load the corresponding news story in your favourite web
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 ;; browser.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 ;; The scrolling, or flashing of headlines in the echo area, can be started
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
112 ;; with the command newsticker-start-ticker. It can be stopped with
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 ;; newsticker-stop-ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 ;; If you just want to start the periodic download of headlines use the
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
116 ;; command newsticker-start. Calling newsticker-stop will stop the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
117 ;; periodic download, but will call newsticker-stop-ticker as well.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 ;; Configuration
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 ;; -------------
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 ;; All Newsticker options are customizable, i.e. they can be changed with
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 ;; Emacs customization methods: Call the command customize-group and enter
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 ;; `newsticker' for the customization group.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 ;; All Newsticker options have reasonable default values, so that in most
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 ;; cases it is not necessary to customize settings before starting
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 ;; Newsticker for the first time.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129 ;; Newsticker options are organized in the following groups.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 ;; * newsticker-feed contains options that define which news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 ;; feeds are retrieved and how this is done.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 ;; o newsticker-url-list defines the list of headlines which are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 ;; retrieved.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 ;; o newsticker-retrieval-interval defines how often headlines are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 ;; retrieved.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 ;; * newsticker-headline-processing contains options that define how the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 ;; retrieved headlines are processed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 ;; o newsticker-keep-obsolete-items decides whether unread headlines that
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 ;; have been removed from the feed are kept in the Newsticker cache.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 ;; * newsticker-layout contains options that define how the buffer for
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
142 ;; reading news headlines is formatted.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 ;; o newsticker-item-format defines how the title of a headline is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 ;; formatted.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 ;; * newsticker-ticker contains options that define how headlines are shown
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 ;; in the echo area.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 ;; o newsticker-display-interval and newsticker-scroll-smoothly define
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 ;; how headlines are shown in the echo area.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 ;; * newsticker-hooks contains options for hooking other Emacs commands to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 ;; newsticker functions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 ;; o newsticker-new-item-functions allows for automatic processing of
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
152 ;; headlines. See `newsticker-download-images', and
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 ;; `newsticker-download-enclosures' for sample functions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 ;; * newsticker-miscellaneous contains other Newsticker options.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 ;; Please have a look at the customization buffers for the complete list of
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 ;; options.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 ;; Remarks
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 ;; -------
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 ;; This newsticker is designed do its job silently in the background
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 ;; without disturbing you. However, it is probably impossible to prevent
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 ;; such a tool from slightly attenuating your Editor's responsiveness every
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 ;; once in a while.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
166 ;; Byte-compiling newsticker.el is recommended.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 ;;; History:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
171 ;; 1.10 (2007-01-29)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
172 ;; * Bugfixes mostly: `newsticker--decode-iso8601-date',
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
173 ;; `newsticker--sentinel', and others.
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
174 ;; * Renamed `newsticker--retrieval-timer-list' to
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
175 ;; `newsticker-retrieval-timer-list'. Removed
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
176 ;; `newsticker-running-p' -- check newsticker-retrieval-timer-list
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
177 ;; to find out whether newsticker is running. Removed
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
178 ;; `newsticker-ticker-running-p'.
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
179 ;; * Try to cache images in w3m-rendered HTML text.
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
180 ;; * Other minor changes.
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
181
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
182 ;; 1.9 (2005-11-01)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
183 ;; * Rewrote feed parsing part. Newsticker now supports RSS 0.91,
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
184 ;; 0.92, 1.0, 2.0 as well as Atom 0.3 and 1.0 -- thanks to Thien-Thi
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
185 ;; Nguyen.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
186 ;; * Changed auto-marking mechanism: Replaced variable
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
187 ;; `newsticker-auto-mark-filter' with new variable
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
188 ;; `newsticker-auto-mark-filter-list', which allows for looking not
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
189 ;; only at the title but also at the description of a headline.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
190 ;; * Call `newsticker--ticker-text-setup' only after all pending
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
191 ;; downloads processes have finished.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
192 ;; * Improved handling of coding systems.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
193 ;; * Added magic autoload comments.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
194 ;; * Bugfixes:
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
195 ;; - `hide-entry' was hiding too much when called for the last
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
196 ;; headline,
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
197 ;; - update mode-line and menu-bar when necessary,
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
198 ;; - repaired `newsticker--imenu-goto',
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
199 ;; - other minor things.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
200
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 ;; 1.8 (2005-08-26)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 ;; * Added commands `newsticker-show-extra' and `newsticker-hide-extra'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 ;; to show and hide extra RSS elements, bound to "sx" and "hx"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 ;; resp. Changed default value of `newsticker-show-all-rss-elements'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 ;; to nil.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 ;; * mode-line: Introduced special mode-line-format for newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 ;; * Get feed logos only once every 24 h.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 ;; * Default faces changed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 ;; * Minor fixes.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 ;; 1.7 (2005-06-25)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 ;; * Tool-bar support: most important commands can be called from
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 ;; tool-bar buttons.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 ;; * Auto-Narrowing introduced: *newsticker* buffer can be narrowed to
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
215 ;; a single item (bound to key `xi') or a single feed (bound to
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
216 ;; `xf').
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 ;; * Enclosure support: enclosed items are shown (see
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 ;; `newsticker-enclosure-face') and can be (automatically) downloaded
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 ;; (see below). For those of you who read "podcasts".
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 ;; * Added variable `newsticker-auto-mark-filter' for automatically
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 ;; marking items as immortal or old.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 ;; * Added hook variable `newsticker-new-item-functions' for handling
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 ;; new items. Added sample functions `newsticker-download-images',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 ;; and `newsticker-download-enclosures'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 ;; * Added hook variable `newsticker-select-item-hook' which is run
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 ;; after `newsticker-(next|previous)-(new-)?-item'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 ;; * Added hook variable `newsticker-select-feed-hook' which is run
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 ;; after `newsticker-(next|previous)-feed'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 ;; * Added hook variable `newsticker-buffer-change-hook' which is run
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 ;; after the contents or visibility of the newsticker buffer has
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 ;; changed, e.g. after `newsticker-buffer-update' or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 ;; `newsticker-show-feed-desc'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 ;; * Added command `newsticker-handle-url' for interactively launching
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 ;; arbitrary programs for URLs, bound to `C-RET'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 ;; * URLs in extra elements are clickable.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 ;; * Better support for w3, added command
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 ;; `newsticker-w3m-show-inline-images' for displaying all inline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 ;; images.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
239 ;; * Insert an artificial headline which notifies about failed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
240 ;; retrievals.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 ;; * Use pubDate element (RSS 2.0) instead of retrieval time when
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 ;; available.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 ;; * Customizable options grouped.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 ;; * Bugfixes: `newsticker--imenu-create-index'; strip whitespace
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 ;; from links; apply coding-system to extra-elements; time-comparison
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 ;; for obsolete items; and others which I have forgotten.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
247 ;; * Workaround for another bug in xml-parse-region -- thanks to
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
248 ;; anonymous for sending patch.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 ;; * Renamed invisible buffers ` *wget-newsticker-<feed>*' to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 ;; ` *newsticker-wget-<feed>*'.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
251 ;; * Tested with GNU Emacs versions 21.3 and 22.0 and XEmacs
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
252 ;; 21.something.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 ;; 1.6 * Support for (some) optional RSS elements: guid, dc:date. See
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 ;; `newsticker-show-all-rss-elements' `newsticker-extra-face'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 ;; * Better support for w3m -- `newsticker-default-face' is obsolete
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 ;; now, removed `newsticker-w3m-toggle-inline-image'.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
258 ;; * Added `newsticker-desc-comp-max' -- comparison of item
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
259 ;; descriptions can take quite some time.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 ;; * Added `newsticker--buffer-make-item-completely-visible' to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 ;; ensure that the current item is fully visible.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 ;; * Allow for non-positive retrieval-interval, which make newsticker
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 ;; get news only once.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 ;; * Use :set for customizable variables.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 ;; * Added `newsticker-buffer-force-update', bound to key `U'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 ;; * Added concept of obsolete items, see
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 ;; `newsticker-keep-obsolete-items', `newsticker-obsolete-item-face',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 ;; `newsticker-obsolete-item-max-age'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 ;; * Added `newsticker-add-url'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 ;; * OPML export.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 ;; * Save pre-formatted titles => even better performance!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 ;; * `newsticker-*-new-item' wraps at beginning/end of buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 ;; * Always sort obsolete items to end of item list.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 ;; * Bugfixes:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 ;; - newsticker-hide-entry,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 ;; - changes of feed-titles led to duplicate feed items,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 ;; - faces for rendered HTML texts,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278 ;; - length of ticker-text (for "exotic"/multibyte texts),
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 ;; Thanks to Hiroshi Maruyama.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 ;; - suppress items with empty title and description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 ;; - newsticker-sort-method was ignored!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 ;; - prevent call of fill-region on HTML-rendered descriptions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 ;; 1.5 * Rewrote the visibility stuff. newsticker does not inherit
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 ;; outline anymore. Now you have complete freedom for
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 ;; `newsticker-*-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 ;; * Save pre-formatted descriptions => incredible performance boost!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 ;; * Introduced `newsticker-(start|stop)-ticker'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 ;; * Introduced statistics for heading-format and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 ;; `newsticker-statistics-face'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 ;; * Introduced `newsticker-enable-logo-manipulations'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 ;; * Compare link of items (as well as title and desc).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 ;; * Added `newsticker-start-hook' and `newsticker-stop-hook', thanks
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 ;; to mace.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 ;; * Bugfixes -- thanks to Ryan Yeske, Jari Aalto, Bruce Ingalls.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 ;; * Tested with Emacs 21.3.50, 21.3.1, 21.2, 21.1; XEmacs 21.4.15
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 ;; 1.4 * Enabled HTML rendering, added `newsticker-html-renderer' to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 ;; choose a HTML rendering engine, thanks to Greg Scott for testing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 ;; * New Outline handling using text properties instead of "**"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 ;; prefixes.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 ;; * Added possibility to mark single item as old (bound to key
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 ;; `o' (`newsticker-mark-item-at-point-as-read').
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 ;; * Added possibility to mark single item as immortal (bound to key
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 ;; `i' (`newsticker-mark-item-at-point-as-immortal').
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 ;; * Added possibility to display feed logos.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 ;; * Added `newsticker-heading-format', `newsticker-item-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 ;; * Added `newsticker-date-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 ;; * Added `newsticker-justification'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 ;; * Added `newsticker-automatically-mark-visited-items-as-old'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 ;; * Added `newsticker-w3m-toggle-inline-image' which calls
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 ;; `w3m-toggle-inline-image' if `newsticker-html-renderer' is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 ;; `w3m-region'. Exists for convenience only (bound to key
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 ;; `RET').
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 ;; 1.3 * Compare title AND desc to check whether item is old, except
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 ;; for feed desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 ;; * Mark as not-up-to-date only after new items have arrived.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 ;; * Added XEmacs compatibility code, tested with XEmacs 21.4.13.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 ;; * Tested with Emacs 21.3.50 and Emacs 21.2.something.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 ;; * Bugfix: Apply coding-systems to feed title and description,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 ;; thanks to OHASHI Akira
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 ;; * Bugfix: xml-parser-workaround did not work for japanese texts,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 ;; thanks to OHASHI Akira
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 ;; * Kill wget-buffers unless newsticker-debug is not nil.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 ;; * Bugfix: xml-parser-workaround for "DOCTYPE rdf:RDF"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 ;; 1.2 Peter S Galbraith <psg@debian.org>
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 ;; * Added `newsticker-url-list-defaults', splitting the URLs into
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 ;; a customizable selection list, and a user add-on list.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 ;; * Minor checkdoc fixes.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 ;; 1.1 * Introduced optional feed-specific wget-arguments.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 ;; * Keep order of feeds as given in `newsticker-url-list' in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 ;; *newsticker* buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 ;; * Ignore unsupported coding systems.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 ;; 1.0 * Introduced feed-specific retrieval-timers.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339 ;; * Removed dependency on 'cl (cddddr).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 ;; * Thanks to Kevin Rodgers and T.V. Raman for their help.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 ;; * Use utf-8 for reading and writing cache data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 ;; * Reported to work with Emacs 21.3.50.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 ;; 0.99 * Minor tweaks.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 ;; * Tested with Emacs 21.3.2
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 ;; 0.98 * Check exit status of wget processes. Keep cache data if
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 ;; something went wrong. Throw error when old wget-processes
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 ;; are hanging around.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 ;; * Introduced newsticker-specific faces.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 ;; * Added `newsticker-show-descriptions-of-new-items'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 ;; * Added `newsticker-hide-old-items-in-newsticker-buffer'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 ;; * Added `newsticker-(hide|show)-old-items'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 ;; 0.97 * Minor tweaks.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 ;; 0.96 * Added caching.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 ;; * newsticker-mode inherits outline-mode.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 ;; * newsticker-mode supports imenu.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 ;; * Easy buffer-navigation with newsticker-mode's keymap.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 ;; * Some bugs fixed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 ;; * Thanks to Moritz Epple for documentation tips.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 ;; 0.95 * Added newsticker-mode -- Thanks to T.V. Raman.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 ;; * Catch xml-parser errors -- Thanks to T.V. Raman.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 ;; * Remove stupid newlines in titles (headlines) -- Thanks to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 ;; Jeff Rancier.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369 ;; 0.94 * Added clickerability and description for channel headings.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 ;; * Made it work for (at least some) rss 0.9<something> feeds.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 ;; 0.93 * Added some more sites.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 ;; * Do not flood the *Messages* buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 ;; * First attempt at handling coding systems.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 ;; 0.92 * Added `newsticker-wget-name'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 ;; * Try to display message only if minibuffer and echo area are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 ;; not in use already.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 ;; * Dirty workaround for newer versions of xml.el: Remove
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 ;; whitespace in rdf.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 ;; * Tested with Emacs 21.3.2 and CVS-snapshot of 2003-06-21.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 ;; 0.91 * First bugfix: *newsticker* is read-only.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 ;; 0.9 * First release.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 ;; * Tested with Emacs 21.3.2 and wget 1.8.2.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 ;;; To Do:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 ;; * Image handling for XEmacs (create-image does not exist)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 ;;; Code:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 (require 'derived)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397 (require 'xml)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
399 ;; Silence warnings
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
400 (defvar tool-bar-map)
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
401 (defvar w3-mode-map)
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
402 (defvar w3m-minor-mode-map)
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
403
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 ;; ======================================================================
67593
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
405 ;;; Newsticker status
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
406 ;; ======================================================================
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
407
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
408 (defvar newsticker--retrieval-timer-list nil
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
409 "List of timers for news retrieval.
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
410 This is an alist, each element consisting of (feed-name . timer).")
67593
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
411
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
412 (defvar newsticker--display-timer nil
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
413 "Timer for newsticker display.")
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
414
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
415 ;;;###autoload
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
416 (defun newsticker-running-p ()
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
417 "Check whether newsticker is running.
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
418 Return t if newsticker is running, nil otherwise. Newsticker is
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
419 considered to be running if the newsticker timer list is not empty."
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
420 (> (length newsticker--retrieval-timer-list) 0))
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
421
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
422 ;;;###autoload
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
423 (defun newsticker-ticker-running-p ()
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
424 "Check whether newsticker's actual ticker is running.
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
425 Return t if ticker is running, nil otherwise. Newsticker is
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
426 considered to be running if the newsticker timer list is not
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
427 empty."
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
428 (timerp newsticker--display-timer))
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
429
b42dfcb5e692 (newsticker--retrieval-timer-list, newsticker--display-timer)
Richard M. Stallman <rms@gnu.org>
parents: 66704
diff changeset
430 ;; ======================================================================
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 ;;; Customizables
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 (defgroup newsticker nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
434 "Aggregator for RSS and Atom feeds."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 :group 'applications)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437 (defconst newsticker--raw-url-list-defaults
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 '(("CNET News.com"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 "http://export.cnet.com/export/feeds/news/rss/1,11176,,00.xml")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 ("Debian Security Advisories"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 "http://www.debian.org/security/dsa.en.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 ("Debian Security Advisories - Long format"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 "http://www.debian.org/security/dsa-long.en.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 ("Emacs Wiki"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445 "http://www.emacswiki.org/cgi-bin/wiki.pl?action=rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 3600)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 ("Freshmeat.net"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 "http://freshmeat.net/backend/fm.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 ("Kuro5hin.org"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 "http://www.kuro5hin.org/backend.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 ("LWN (Linux Weekly News)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 "http://lwn.net/headlines/rss")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 ("NewsForge"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 "http://newsforge.com/index.rss")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 ("NY Times: Technology"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 "http://partners.userland.com/nytRss/technology.xml")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 ("NY Times"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 "http://partners.userland.com/nytRss/nytHomepage.xml")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 ("Quote of the day"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 "http://www.quotationspage.com/data/qotd.rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 "07:00"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463 86400)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 ("The Register"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 "http://www.theregister.co.uk/tonys/slashdot.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466 ("slashdot"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 "http://slashdot.org/index.rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469 3600) ;/. will ban you if under 3600 seconds!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
470 ("Wired News"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 "http://www.wired.com/news_drop/netcenter/netcenter.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 ("Heise News (german)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 "http://www.heise.de/newsticker/heise.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 ("Tagesschau (german)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475 "http://www.tagesschau.de/newsticker.rdf"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 1800)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 ("Telepolis (german)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 "http://www.heise.de/tp/news.rdf"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 "Default URL list in raw form.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481 This list is fed into defcustom via `newsticker--splicer'.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 (defun newsticker--splicer (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 "Convert ITEM for splicing into `newsticker-url-list-defaults'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 (let ((result (list 'list :tag (nth 0 item) (list 'const (nth 0 item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 (element (cdr item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 (while element
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488 (setq result (append result (list (list 'const (car element)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 (setq element (cdr element)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 result))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 ;;; Customization
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 (defun newsticker--set-customvar (symbol value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 "Set newsticker-variable SYMBOL value to VALUE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
498 Calls all necessary actions which are necessary in order to make
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
499 the new value effective. Changing `newsticker-url-list', for example,
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
500 will re-start the retrieval-timers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 (unless (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
502 (eq (symbol-value symbol) value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
503 (error nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
504 (set symbol value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
505 (cond ((eq symbol 'newsticker-sort-method)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
506 (when (fboundp 'newsticker--cache-sort)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
507 (message "Applying new sort method...")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
508 (newsticker--cache-sort)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
509 (newsticker--buffer-set-uptodate nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
510 (message "Applying new sort method...done")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
511 ((memq symbol '(newsticker-url-list-defaults
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
512 newsticker-url-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
513 newsticker-retrieval-interval))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 (when (and (fboundp 'newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 (newsticker-running-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 (message "Restarting newsticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517 (newsticker-stop)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
518 (newsticker-start)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
519 ((eq symbol 'newsticker-display-interval)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
520 (when (and (fboundp 'newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
521 (newsticker-running-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
522 (message "Restarting ticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
523 (newsticker-stop-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524 (newsticker-start-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525 (message "")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526 ((memq symbol '(newsticker-hide-old-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
527 newsticker-hide-obsolete-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528 newsticker-hide-immortal-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 (when (and (fboundp 'newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530 (newsticker-running-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531 (message "Restarting newsticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
532 (newsticker-stop-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
533 (newsticker--ticker-text-setup)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 (newsticker-start-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535 (message "")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 ((memq symbol '(newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 newsticker-show-descriptions-of-new-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 (when (fboundp 'newsticker--buffer-set-uptodate)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 (newsticker--buffer-set-uptodate nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540 ((memq symbol '(newsticker-heading-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
541 newsticker-item-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 newsticker-desc-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 newsticker-date-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544 newsticker-statistics-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
545 newsticker-justification
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547 newsticker-html-renderer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
548 newsticker-feed-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
549 newsticker-new-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 newsticker-old-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 newsticker-immortal-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
552 newsticker-obsolete-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553 newsticker-date-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554 newsticker-statistics-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 ;;newsticker-default-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
556 ))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
557 (when (fboundp 'newsticker--forget-preformatted)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558 (newsticker--forget-preformatted)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560 (error "Ooops %s" symbol)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562 ;; customization group feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 (defgroup newsticker-feed nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
564 "Settings for news feeds."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
565 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
567 (defcustom newsticker-url-list-defaults
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 '(("Emacs Wiki"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 "http://www.emacswiki.org/cgi-bin/wiki.pl?action=rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 3600))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 "A customizable list of news feeds to select from.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573 These were mostly extracted from the Radio Community Server at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 http://subhonker6.userland.com/rcsPublic/rssHotlist.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
575
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
576 You may add other entries in `newsticker-url-list'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
577 :type `(set ,@(mapcar `newsticker--splicer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578 newsticker--raw-url-list-defaults))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 (defcustom newsticker-url-list nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 "The news feeds which you like to watch.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
585 This alist will be used in addition to selection made customizing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 `newsticker-url-list-defaults'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588 This is an alist. Each element consists of two items: a LABEL and a URL,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 optionally followed by a START-TIME, INTERVAL specifier and WGET-ARGUMENTS.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 The LABEL gives the name of the news feed. It can be an arbitrary string.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593 The URL gives the location of the news feed. It must point to a valid
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
594 RSS or Atom file. The file is retrieved by calling wget, or whatever you
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
595 specify as `newsticker-wget-name'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
596
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597 The START-TIME can be either a string, or nil. If it is a string it
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598 specifies a fixed time at which this feed shall be retrieved for the
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
599 first time. (Examples: \"11:00pm\", \"23:00\".) If it is nil (or
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
600 unspecified), this feed will be retrieved immediately after calling
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
601 `newsticker-start'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
602
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
603 The INTERVAL specifies the time between retrievals for this feed. If it
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604 is nil (or unspecified) the default interval value as set in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 `newsticker-retrieval-interval' is used.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 \(newsticker.el calls `run-at-time'. The newsticker-parameters START-TIME
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 and INTERVAL correspond to the `run-at-time'-parameters TIME and REPEAT.)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610 WGET-ARGUMENTS specifies arguments for wget (see `newsticker-wget-name')
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611 which apply for this feed only, overriding the value of
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612 `newsticker-wget-arguments'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 :type '(repeat (list :tag "News feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
614 (string :tag "Label")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615 (string :tag "URI")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 (choice :tag "Start"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617 (const :tag "Default" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 (string :tag "Fixed Time"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619 (choice :tag "Interval"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620 (const :tag "Default" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621 (const :tag "Hourly" 3600)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
622 (const :tag "Daily" 86400)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
623 (const :tag "Weekly" 604800)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
624 (integer :tag "Interval"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
625 (choice :tag "Wget Arguments"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626 (const :tag "Default arguments" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
627 (repeat :tag "Special arguments" string))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
628 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
629 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
631 (defcustom newsticker-wget-name
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
632 "wget"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
633 "Name of the program which is called to retrieve news from the web.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
634 The canonical choice is wget but you may take any other program which is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
635 able to return the contents of a news feed file on stdout."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
636 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
637 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
638
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
639 (defcustom newsticker-wget-arguments
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
640 '("-q" "-O" "-")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
641 "Arguments which are passed to wget.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
642 There is probably no reason to change the default settings, unless you
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
643 are living behind a firewall."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
644 :type '(repeat (string :tag "Argument"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
645 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
646
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
647 (defcustom newsticker-retrieval-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
648 3600
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
649 "Time interval for retrieving new news items (seconds).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
650 If this value is not positive (i.e. less than or equal to 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
651 items are retrieved only once!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
652 Please note that some feeds, e.g. Slashdot, will ban you if you
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
653 make it less than 1800 seconds (30 minutes)!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
654 :type '(choice :tag "Interval"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
655 (const :tag "No automatic retrieval" 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
656 (const :tag "Hourly" 3600)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
657 (const :tag "Daily" 86400)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
658 (const :tag "Weekly" 604800)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
659 (integer :tag "Interval"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
660 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
661 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
662
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
663 (defcustom newsticker-desc-comp-max
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
664 100
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
665 "Relevant length of headline descriptions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666 This value gives the maximum number of characters which will be
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
667 taken into account when newsticker compares two headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668 descriptions."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
669 :type 'integer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
670 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
671
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
672 ;; customization group behaviour
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673 (defgroup newsticker-headline-processing nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
674 "Settings for the automatic processing of headlines."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
676
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677 (defcustom newsticker-automatically-mark-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679 "Decides whether to automatically mark items as old.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
680 If t a new item is considered as new only after its first retrieval. As
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
681 soon as it is retrieved a second time, it becomes old. If not t all
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682 items stay new until you mark them as old. This is done in the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
683 *newsticker* buffer."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
684 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
685 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
686
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 (defcustom newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
688 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689 "Decides whether to automatically mark visited items as old.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690 If t an item is marked as old as soon as the associated link is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691 visited, i.e. after pressing RET or mouse2 on the item's
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 headline."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
693
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
694 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
696
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 (defcustom newsticker-keep-obsolete-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
698 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 "Decides whether to keep unread items which have been removed from feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
700 If t a new item, which has been removed from the feed, is kept in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701 the cache until it is marked as read."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
702 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
703 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
704
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
705 (defcustom newsticker-obsolete-item-max-age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
706 (* 60 60 24)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
707 "Maximal age of obsolete items, in seconds.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
708 Obsolete items which are older than this value will be silently
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
709 deleted at the next retrieval."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710 :type 'integer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
713 (defcustom newsticker-auto-mark-filter-list
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
715 "A list of filters for automatically marking headlines.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
716
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
717 This is an alist of the form (FEED-NAME PATTERN-LIST). I.e. each
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
718 element consists of a FEED-NAME a PATTERN-LIST. Each element of
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
719 the pattern-list has the form (AGE TITLE-OR-DESCRIPTION REGEXP).
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
720 AGE must be one of the symbols 'old or 'immortal.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
721 TITLE-OR-DESCRIPTION must be on of the symbols 'title,
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
722 'description, or 'all. REGEXP is a regular expression, i.e. a
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
723 string.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
724
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
725 This filter is checked after a new headline has been retrieved.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
726 If FEED-NAME matches the name of the corresponding news feed, the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
727 pattern-list is checked: The new headline will be marked as AGE
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
728 if REGEXP matches the headline's TITLE-OR-DESCRIPTION.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
729
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
730 If, for example, `newsticker-auto-mark-filter-list' looks like
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
731 \((slashdot ('old 'title \"^Forget me!$\") ('immortal 'title \"Read me\")
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
732 \('immortal 'all \"important\"))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
733
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
734 then all articles from slashdot are marked as old if they have
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
735 the title \"Forget me!\". All articles with a title containing
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
736 the string \"Read me\" are marked as immortal. All articles which
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
737 contain the string \"important\" in their title or their
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
738 description are marked as immortal."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
739 :type '(repeat (list :tag "Auto mark filter"
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
740 (string :tag "Feed name")
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
741 (repeat
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
742 (list :tag "Filter element"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
743 (choice
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
744 :tag "Auto-assigned age"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
745 (const :tag "Old" old)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
746 (const :tag "Immortal" immortal))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
747 (choice
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
748 :tag "Title/Description"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
749 (const :tag "Title" title)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
750 (const :tag "Description" description)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
751 (const :tag "All" all))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
752 (string :tag "Regexp")))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
753 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
754
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
755 ;; customization group layout
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
756 (defgroup newsticker-layout nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
757 "Settings for layout of the feed reader."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
758 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
759
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
760 (defcustom newsticker-sort-method
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
761 'sort-by-original-order
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
762 "Sort method for news items.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
763 The following sort methods are available:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
764 * `sort-by-original-order' keeps the order in which the items
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
765 appear in the headline file (please note that for immortal items,
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
766 which have been removed from the news feed, there is no original
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
767 order),
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
768 * `sort-by-time' looks at the time at which an item has been seen
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
769 the first time. The most recent item is put at top,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
770 * `sort-by-title' will put the items in an alphabetical order."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
771 :type '(choice
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
772 (const :tag "Keep original order" sort-by-original-order)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
773 (const :tag "Sort by time" sort-by-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
774 (const :tag "Sort by title" sort-by-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
775 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
776 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
777
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
778 (defcustom newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
779 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
780 "Decides whether to automatically hide old items in the *newsticker* buffer.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
781 If set to t old items will be completely folded and only new
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
782 items will show up in the *newsticker* buffer. Otherwise old as
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
783 well as new items will be visible."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
784 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
785 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
786 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
787
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
788 (defcustom newsticker-show-descriptions-of-new-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
789 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
790 "Whether to automatically show descriptions of new items in *newsticker*.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
791 If set to t old items will be folded and new items will be
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
792 unfolded. Otherwise old as well as new items will be folded."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
793 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
794 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
795 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
796
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
797 (defcustom newsticker-heading-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
798 "%l
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
799 %t %d %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
800 "Format string for feed headings.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
801 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
802 %d The date the feed was retrieved. See `newsticker-date-format'.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
803 %l The logo (image) of the feed. Most news feeds provide a small
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
804 image as logo. Newsticker can display them, if Emacs can --
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
805 see `image-types' for a list of supported image types.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
806 %L The logo (image) of the feed. If the logo is not available
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
807 the title of the feed is used.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
808 %s The statistical data of the feed. See `newsticker-statistics-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
809 %t The title of the feed, i.e. its name."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
810 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
811 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
812 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
813
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
814 (defcustom newsticker-item-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
815 "%t %d"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
816 "Format string for news item headlines.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
817 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818 %d The date the item was (first) retrieved. See `newsticker-date-format'.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
819 %l The logo (image) of the feed. Most news feeds provide a small
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
820 image as logo. Newsticker can display them, if Emacs can --
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
821 see `image-types' for a list of supported image types.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 %L The logo (image) of the feed. If the logo is not available
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
823 the title of the feed is used.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
824 %t The title of the item."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
825 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
826 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
827 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
828
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
829 (defcustom newsticker-desc-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
830 "%d %c"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831 "Format string for news descriptions (contents).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
832 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
833 %c The contents (description) of the item.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
834 %d The date the item was (first) retrieved. See
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
835 `newsticker-date-format'."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
836 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
838 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
839
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840 (defcustom newsticker-date-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
841 "(%A, %H:%M)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 "Format for the date part in item and feed lines.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843 See `format-time-string' for a list of valid specifiers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
845 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
846 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
847
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
848 (defcustom newsticker-statistics-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
849 "[%n + %i + %o + %O = %a]"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
850 "Format for the statistics part in feed lines.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
851 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
852 %a The number of all items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
853 %i The number of immortal items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
854 %n The number of new items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
855 %o The number of old items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
856 %O The number of obsolete items in the feed."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
859 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
860
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
861 (defcustom newsticker-show-all-news-elements
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
862 nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
863 "Show all news elements."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
864 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
865 ;;:set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
866 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
867
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
868 ;; image related things
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
869 (defcustom newsticker-enable-logo-manipulations
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
870 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
871 "If non-nil newsticker manipulates logo images.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
872 This enables the following image properties: heuristic mask for all
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
873 logos, and laplace-conversion for images without new items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
874 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
875 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
876
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
877
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
878 ;; rendering
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
879 (defcustom newsticker-justification
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
880 'left
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
881 "How to fill item descriptions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
882 If non-nil newsticker calls `fill-region' to wrap long lines in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
883 item descriptions. However, if an item description contains HTML
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
884 text and `newsticker-html-renderer' is non-nil, filling is not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
885 done."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
886 :type '(choice :tag "Justification"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
887 (const :tag "No filling" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
888 (const :tag "Left" left)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
889 (const :tag "Right" right)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
890 (const :tag "Center" center)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
891 (const :tag "Full" full))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
892 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
893 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
894
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
895 (defcustom newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
896 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
897 "Decides whether to use the full window width when filling.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
898 If non-nil newsticker sets `fill-column' so that the whole
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
899 window is used when filling. See also `newsticker-justification'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
900 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
901 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
904 (defcustom newsticker-html-renderer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
905 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
906 "Function for rendering HTML contents.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
907 If non-nil, newsticker.el will call this function whenever it finds
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
908 HTML-like tags in item descriptions. Possible functions are, for
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
909 example, `w3m-region', `w3-region', and (if you have htmlr.el installed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
910 `newsticker-htmlr-render'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
911
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
912 In order to make sure that the HTML renderer is loaded when you
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
913 run newsticker, you should add one of the following statements to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
914 your .emacs. If you use w3m,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
915
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
916 (autoload 'w3m-region \"w3m\"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
917 \"Render region in current buffer and replace with result.\" t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
918
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
919 or, if you use w3,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
920
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
921 (require 'w3-auto)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
922
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
923 or, if you use htmlr
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
924
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
925 (require 'htmlr)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
926 :type '(choice :tag "Function"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
927 (const :tag "None" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
928 (const :tag "w3" w3-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
929 (const :tag "w3m" w3m-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
930 (const :tag "htmlr" newsticker-htmlr-render))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
931 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
932 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
933
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
934
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
935 ;; faces
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
936 (defgroup newsticker-faces nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
937 "Settings for the faces of the feed reader."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
938 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
939
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
940 (defface newsticker-feed-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
941 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
942 (:family "helvetica" :bold t :height 1.2 :foreground "misty rose"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
943 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
944 (:family "helvetica" :bold t :height 1.2 :foreground "black")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
945 "Face for news feeds."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
946 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
947
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
948 (defface newsticker-new-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
949 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
950 (:family "helvetica" :bold t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
951 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
952 (:family "helvetica" :bold t)))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
953 "Face for new news items."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
954 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
955
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
956 (defface newsticker-old-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
957 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
958 (:family "helvetica" :bold t :foreground "orange3"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
959 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
960 (:family "helvetica" :bold t :foreground "red4")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
961 "Face for old news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
962 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
963
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
964 (defface newsticker-immortal-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
965 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966 (:family "helvetica" :bold t :italic t :foreground "orange"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
967 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
968 (:family "helvetica" :bold t :italic t :foreground "blue")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
969 "Face for immortal news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
970 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972 (defface newsticker-obsolete-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
974 (:family "helvetica" :bold t :strike-through t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
975 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 (:family "helvetica" :bold t :strike-through t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
977 "Face for old news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
978 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
979
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
980 (defface newsticker-date-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
981 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
982 (:family "helvetica" :italic t :height 0.8))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
983 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
984 (:family "helvetica" :italic t :height 0.8)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
985 "Face for newsticker dates."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
986 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
987
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
988 (defface newsticker-statistics-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
989 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
990 (:family "helvetica" :italic t :height 0.8))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
991 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
992 (:family "helvetica" :italic t :height 0.8)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
993 "Face for newsticker dates."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
994 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
995
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
996 (defface newsticker-enclosure-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
997 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
998 (:bold t :background "orange"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
999 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1000 (:bold t :background "orange")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1001 "Face for enclosed elements."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1002 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1003
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1004 (defface newsticker-extra-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1005 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1006 (:italic t :foreground "gray50" :height 0.8))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1007 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1008 (:italic t :foreground "gray50" :height 0.8)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1009 "Face for newsticker dates."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1010 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1011
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1012 ;; (defface newsticker-default-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1013 ;; '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1014 ;; (:inherit default))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1015 ;; (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1016 ;; (:inherit default)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1017 ;; "Face for the description of news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1018 ;; ;;:set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1019 ;; :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1020
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1021
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1022 ;; customization group ticker
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023 (defgroup newsticker-ticker nil
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
1024 "Settings for the headline ticker."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1025 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1026
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1027 (defcustom newsticker-display-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1028 0.3
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1029 "Time interval for displaying news items in the echo area (seconds).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1030 If equal or less than 0 no messages are shown in the echo area. For
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1031 smooth display (see `newsticker-scroll-smoothly') a value of 0.3 seems
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1032 reasonable. For non-smooth display a value of 10 is a good starting
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1033 point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1034 :type 'number
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1035 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1037
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1038 (defcustom newsticker-scroll-smoothly
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1040 "Decides whether to flash or scroll news items.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041 If t the news headlines are scrolled (more-or-less) smoothly in the echo
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042 area. If nil one headline after another is displayed in the echo area.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1043 The variable `newsticker-display-interval' determines how fast this
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1044 display moves/changes and whether headlines are shown in the echo area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1045 at all. If you change `newsticker-scroll-smoothly' you should also change
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1046 `newsticker-display-interval'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1047 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1048 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050 (defcustom newsticker-hide-immortal-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1051 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1052 "Decides whether to show immortal/non-expiring news items in the ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1053 If t the echo area will not show immortal items. See also
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
1054 `newsticker-hide-old-items-in-echo-area'."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1055 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1056 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1057 :group 'newsticker-ticker)
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
1058
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1059 (defcustom newsticker-hide-old-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1060 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1061 "Decides whether to show only the newest news items in the ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1062 If t the echo area will show only new items, i.e. only items which have
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1063 been added between the last two retrievals."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1064 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1065 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1066 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1067
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1068 (defcustom newsticker-hide-obsolete-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1069 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1070 "Decides whether to show obsolete items items in the ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1071 If t the echo area will not show obsolete items. See also
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
1072 `newsticker-hide-old-items-in-echo-area'."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1073 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1074 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1075 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1076
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1077 (defgroup newsticker-hooks nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1078 "Settings for newsticker hooks."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1079 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1080
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1081 (defcustom newsticker-start-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1082 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1083 "Hook run when starting newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1084 This hook is run at the very end of `newsticker-start'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1085 :options '(newsticker-start-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1086 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1087 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1088
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1089 (defcustom newsticker-stop-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1090 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1091 "Hook run when stopping newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1092 This hook is run at the very end of `newsticker-stop'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1093 :options nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1094 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1095 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1096
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1097 (defcustom newsticker-new-item-functions
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1098 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1099 "List of functions run after a new headline has been retrieved.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1100 Each function is called with the following three arguments:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1101 FEED the name of the corresponding news feed,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1102 TITLE the title of the headline,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1103 DESC the decoded description of the headline.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1104
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1105 See `newsticker-download-images', and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1106 `newsticker-download-enclosures' for sample functions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1107
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1108 Please note that these functions are called only once for a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1109 headline after it has been retrieved for the first time."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1110 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1111 :options '(newsticker-download-images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1112 newsticker-download-enclosures)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1113 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1114
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1115 (defcustom newsticker-select-item-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1116 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1117 "List of functions run after a headline has been selected.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1118 Each function is called after one of `newsticker-next-item',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1119 `newsticker-next-new-item', `newsticker-previous-item',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1120 `newsticker-previous-new-item' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1121
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1122 The default value 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1123 assures that the current item is always completely visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1124 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1125 :options '(newsticker--buffer-make-item-completely-visible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1126 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1127
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1128 (defcustom newsticker-select-feed-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1129 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1130 "List of functions run after a feed has been selected.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1131 Each function is called after one of `newsticker-next-feed', and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1132 `newsticker-previous-feed' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1133
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1134 The default value 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1135 assures that the current feed is completely visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1136 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1137 :options '(newsticker--buffer-make-item-completely-visible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1138 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1139
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1140 (defcustom newsticker-buffer-change-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1141 'newsticker-w3m-show-inline-images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1142 "List of functions run after the newsticker buffer has been updated.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1143 Each function is called after `newsticker-buffer-update' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1144
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1145 The default value '`newsticker-w3m-show-inline-images' loads inline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1146 images."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1147 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1148 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1149
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1150 (defcustom newsticker-narrow-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1151 'newsticker-w3m-show-inline-images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1152 "List of functions run after narrowing in newsticker buffer has changed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1153 Each function is called after
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1154 `newsticker-toggle-auto-narrow-to-feed' or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1155 `newsticker-toggle-auto-narrow-to-item' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1156
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1157 The default value '`newsticker-w3m-show-inline-images' loads inline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1158 images."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1159 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1160 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1161
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1162 (defgroup newsticker-miscellaneous nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1163 "Miscellaneous newsticker settings."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1164 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1165
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1166 (defcustom newsticker-cache-filename
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1167 "~/.newsticker-cache"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1168 "Name of the newsticker cache file."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1169 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1170 :group 'newsticker-miscellaneous)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1171
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1172 (defcustom newsticker-imagecache-dirname
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1173 "~/.newsticker-images"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1174 "Name of the directory where newsticker stores cached images."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1175 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1176 :group 'newsticker-miscellaneous)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1177
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1178 ;; debugging
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1179 (defcustom newsticker-debug
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1180 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1181 "Enables some features needed for debugging newsticker.el.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1182
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1183 If set to t newsticker.el will print lots of debugging messages, and the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1184 buffers *newsticker-wget-<feed>* will not be closed."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1185 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1186 ;;:set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1187 :group 'newsticker-miscellaneous)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1188
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1189 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1190 ;;; Compatibility section, XEmacs, Emacs
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1191 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1192 (unless (fboundp 'time-add)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1193 (require 'time-date);;FIXME
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1194 (defun time-add (t1 t2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1195 (seconds-to-time (+ (time-to-seconds t1) (time-to-seconds t2)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1196
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1197 (unless (fboundp 'match-string-no-properties)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1198 (defalias 'match-string-no-properties 'match-string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1199
85777
2ca0af23d79d * emulation/edt.el (edt-emacs19-p, edt-x-emacs19-p)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78229
diff changeset
1200 (when (featurep 'xemacs)
2ca0af23d79d * emulation/edt.el (edt-emacs19-p, edt-x-emacs19-p)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78229
diff changeset
1201 (unless (fboundp 'replace-regexp-in-string)
2ca0af23d79d * emulation/edt.el (edt-emacs19-p, edt-x-emacs19-p)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78229
diff changeset
1202 (defun replace-regexp-in-string (re rp st)
2ca0af23d79d * emulation/edt.el (edt-emacs19-p, edt-x-emacs19-p)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78229
diff changeset
1203 (save-match-data ;; apparently XEmacs needs save-match-data
2ca0af23d79d * emulation/edt.el (edt-emacs19-p, edt-x-emacs19-p)
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78229
diff changeset
1204 (replace-in-string st re rp)))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1205
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1206 ;; copied from subr.el
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1207 (unless (fboundp 'add-to-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1208 (defun add-to-invisibility-spec (arg)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1209 "Add elements to `buffer-invisibility-spec'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1210 See documentation for `buffer-invisibility-spec' for the kind of elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1211 that can be added."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1212 (if (eq buffer-invisibility-spec t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1213 (setq buffer-invisibility-spec (list t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1214 (setq buffer-invisibility-spec
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1215 (cons arg buffer-invisibility-spec))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1216
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1217 ;; copied from subr.el
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1218 (unless (fboundp 'remove-from-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1219 (defun remove-from-invisibility-spec (arg)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1220 "Remove elements from `buffer-invisibility-spec'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1221 (if (consp buffer-invisibility-spec)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
1222 (setq buffer-invisibility-spec
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
1223 (delete arg buffer-invisibility-spec)))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1224
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1225 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1226 ;;; Internal variables
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1227 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1228 (defvar newsticker--item-list nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1229 "List of newsticker items.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1230 (defvar newsticker--item-position 0
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1231 "Actual position in list of newsticker items.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1232 (defvar newsticker--prev-message "There was no previous message yet!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1233 "Last message that the newsticker displayed.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1234 (defvar newsticker--scrollable-text ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1235 "The text which is scrolled smoothly in the echo area.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1236 (defvar newsticker--buffer-uptodate-p nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1237 "Tells whether the newsticker buffer is up to date.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1238 (defvar newsticker--latest-update-time (current-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1239 "The time at which the latest news arrived.")
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
1240 (defvar newsticker--process-ids nil
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
1241 "List of PIDs of active newsticker processes.")
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1242
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1243 (defvar newsticker--cache nil "Cached newsticker data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1244 This is a list of the form
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1245
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1246 ((label1
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1247 (title description link time age index preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1248 preformatted-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1249 ...)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1250 (label2
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1251 (title description link time age index preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1252 preformatted-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1253 ...)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1254 ...)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1255
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1256 where LABEL is a symbol. TITLE, DESCRIPTION, and LINK are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1257 strings. TIME is a time value as returned by `current-time'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1258 AGE is a symbol: 'new, 'old, 'immortal, and 'obsolete denote
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1259 ordinary news items, whereas 'feed denotes an item which is not a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1260 headline but describes the feed itself. INDEX denotes the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1261 original position of the item -- used for restoring the original
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1262 order. PREFORMATTED-CONTENTS and PREFORMATTED-TITLE hold the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1263 formatted contents of the item's description and title. This
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1264 speeds things up if HTML rendering is used, which is rather
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1265 slow.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1266
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1267 (defvar newsticker--auto-narrow-to-feed nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1268 "Automatically narrow to current news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1269 If non-nil only the items of the current news feed are visible.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1270
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1271 (defvar newsticker--auto-narrow-to-item nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1272 "Automatically narrow to current news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1273 If non-nil only the current headline is visible.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1274
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1275 (defconst newsticker--error-headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1276 "[COULD NOT DOWNLOAD HEADLINES!]"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1277 "Title of error headline which will be inserted if news retrieval fails.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1278
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1279 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1280 ;;; Toolbar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1281 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1282 (defconst newsticker--next-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1283 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1284 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1285 static char * next_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1286 \"24 24 42 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1287 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1288 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1289 \"+ c #7EB6DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1290 \"@ c #82BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1291 \"# c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1292 \"$ c #88C1E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1293 \"% c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1294 \"& c #87C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1295 \"* c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1296 \"= c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1297 \"- c #8CC6EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1298 \"; c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1299 \"> c #8BC5E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1300 \", c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1301 \"' c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1302 \") c #8AC4E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1303 \"! c #8BC5EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1304 \"~ c #8BC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1305 \"{ c #88C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1306 \"] c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1307 \"^ c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1308 \"/ c #83BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1309 \"( c #82BBE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1310 \"_ c #86C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1311 \": c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1312 \"< c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1313 \"[ c #81B9E0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1314 \"} c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1315 \"| c #78B0D9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1316 \"1 c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1317 \"2 c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1318 \"3 c #7DB6DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1319 \"4 c #72A9D4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1320 \"5 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1321 \"6 c #76AED7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1322 \"7 c #77AFD8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1323 \"8 c #6BA1CD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1324 \"9 c #6EA4CF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1325 \"0 c #6FA6D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1326 \"a c #6298C6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1327 \"b c #659BC8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1328 \"c c #5C91C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1329 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1330 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1331 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1332 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1333 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1334 \" .@#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1335 \" .#$%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1336 \" .&*=-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1337 \" .;>,,,. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1338 \" .;>,,,=. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1339 \" .')!==~;. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1340 \" .#{]*%;^/. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1341 \" .(#_':#<. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1342 \" .+[@</}. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1343 \" .|1232. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1344 \" .4567. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1345 \" .890. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1346 \" .ab. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1347 \" .c. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1348 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1349 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1350 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1351 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1352 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1353 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1354 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1355 "Image for the next item button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1356
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1357 (defconst newsticker--previous-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1358 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1359 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1360 static char * previous_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1361 \"24 24 39 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1362 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1363 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1364 \"+ c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1365 \"@ c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1366 \"# c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1367 \"$ c #89C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1368 \"% c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1369 \"& c #83BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1370 \"* c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1371 \"= c #8BC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1372 \"- c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1373 \"; c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1374 \"> c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1375 \", c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1376 \"' c #8AC4E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1377 \") c #8BC5EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1378 \"! c #88C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1379 \"~ c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1380 \"{ c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1381 \"] c #86C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1382 \"^ c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1383 \"/ c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1384 \"( c #82BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1385 \"_ c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1386 \": c #7FB7DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1387 \"< c #7DB6DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1388 \"[ c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1389 \"} c #7CB4DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1390 \"| c #79B1DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1391 \"1 c #76ADD7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1392 \"2 c #77AFD8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1393 \"3 c #73AAD4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1394 \"4 c #70A7D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1395 \"5 c #6EA5D0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1396 \"6 c #6CA2CE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1397 \"7 c #689ECB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1398 \"8 c #6399C7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1399 \"9 c #6095C4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1400 \"0 c #5C90C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1401 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1402 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1403 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1404 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1405 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1406 \" .@#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1407 \" .$%&. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1408 \" .*=-;. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1409 \" .>>*,%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1410 \" .>>>*,%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1411 \" .')**=-;. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1412 \" .;!,~{-%&. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1413 \" .;]^/;@#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1414 \" .(@&_:+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1415 \" .<[}|1. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1416 \" .2134. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1417 \" .567. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1418 \" .89. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1419 \" .0. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1420 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1421 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1422 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1423 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1424 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1425 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1426 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1427 "Image for the previous item button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1428
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1429 (defconst newsticker--previous-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1430 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1431 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1432 static char * prev_feed_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1433 \"24 24 52 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1434 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1435 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1436 \"+ c #70A7D2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1437 \"@ c #75ADD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1438 \"# c #71A8D3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1439 \"$ c #79B1DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1440 \"% c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1441 \"& c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1442 \"* c #83BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1443 \"= c #7EB6DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1444 \"- c #78B0D9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1445 \"; c #7FB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1446 \"> c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1447 \", c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1448 \"' c #80B9E0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1449 \") c #80B8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1450 \"! c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1451 \"~ c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1452 \"{ c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1453 \"] c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1454 \"^ c #7CB4DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1455 \"/ c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1456 \"( c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1457 \"_ c #7BB3DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1458 \": c #7EB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1459 \"< c #8BC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1460 \"[ c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1461 \"} c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1462 \"| c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1463 \"1 c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1464 \"2 c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1465 \"3 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1466 \"4 c #7FB7DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1467 \"5 c #77AED8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1468 \"6 c #71A8D2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1469 \"7 c #70A7D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1470 \"8 c #76ADD7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1471 \"9 c #6CA2CE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1472 \"0 c #699FCC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1473 \"a c #73AAD4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1474 \"b c #6BA1CD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1475 \"c c #669CC9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1476 \"d c #6298C5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1477 \"e c #689ECB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1478 \"f c #6499C7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1479 \"g c #6095C3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1480 \"h c #5C91C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1481 \"i c #5E93C2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1482 \"j c #5B90C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1483 \"k c #588CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1484 \"l c #578CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1485 \"m c #5589BA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1486 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1487 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1488 \" ... . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1489 \" .+. .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1490 \" .@. .#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1491 \" .$. .%@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1492 \" .&. .*=-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1493 \" .;. .>,'%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1494 \" .). .!~{]^. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1495 \" ./. .(!~{]_. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1496 \" .:. .!!<>,'%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1497 \" .&. .~[}>{*=-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1498 \" .$. .|1,2/%@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1499 \" .3. .*]4%56. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1500 \" .7. .^$8#9. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1501 \" .0. .a7bc. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1502 \" .d. .efg. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1503 \" .h. .ij. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1504 \" .k. .l. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1505 \" .m. .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1506 \" ... . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1507 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1508 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1509 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1510 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1511 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1512 "Image for the previous feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1513
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1514 (defconst newsticker--next-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1515 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1516 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1517 static char * next_feed_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1518 \"24 24 57 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1519 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1520 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1521 \"+ c #6CA2CE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1522 \"@ c #75ADD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1523 \"# c #71A8D3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1524 \"$ c #79B1DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1525 \"% c #7EB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1526 \"& c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1527 \"* c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1528 \"= c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1529 \"- c #78B0D9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1530 \"; c #7FB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1531 \"> c #83BCE3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1532 \", c #87C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1533 \"' c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1534 \") c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1535 \"! c #80B8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1536 \"~ c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1537 \"{ c #8BC5E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1538 \"] c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1539 \"^ c #7CB4DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1540 \"/ c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1541 \"( c #84BDE3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1542 \"_ c #7BB3DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1543 \": c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1544 \"< c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1545 \"[ c #8AC4E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1546 \"} c #8BC5EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1547 \"| c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1548 \"1 c #88C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1549 \"2 c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1550 \"3 c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1551 \"4 c #7EB6DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1552 \"5 c #82BBE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1553 \"6 c #86C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1554 \"7 c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1555 \"8 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1556 \"9 c #7AB2DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1557 \"0 c #81B9E0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1558 \"a c #82BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1559 \"b c #71A8D2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1560 \"c c #70A7D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1561 \"d c #74ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1562 \"e c #699FCC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1563 \"f c #6EA5D0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1564 \"g c #72A9D4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1565 \"h c #669CC9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1566 \"i c #6298C5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1567 \"j c #679DCA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1568 \"k c #6BA1CD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1569 \"l c #6095C3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1570 \"m c #5C91C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1571 \"n c #5F94C2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1572 \"o c #5B90C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1573 \"p c #588CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1574 \"q c #578CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1575 \"r c #5589BA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1576 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1577 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1578 \" . ... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1579 \" .. .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1580 \" .@. .#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1581 \" .$%. .@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1582 \" .&*=. .-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1583 \" .;>,'. .). \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1584 \" .!=~{]. .^. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1585 \" ./(~{]]. ._. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1586 \" .%:<[}||. .). \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1587 \" .&*=12'3~. .-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1588 \" .$45=6<7. .@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1589 \" .8940a:. .b. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1590 \" .cd-)&. .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1591 \" .efg8. .h. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1592 \" .ijk. .l. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1593 \" .mn. .o. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1594 \" .p. .q. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1595 \" .. .r. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1596 \" . ... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1597 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1598 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1599 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1600 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1601 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1602 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1603
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1604 (defconst newsticker--mark-read-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1605 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1606 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1607 static char * mark_read_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1608 \"24 24 44 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1609 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1610 \". c #C20000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1611 \"+ c #BE0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1612 \"@ c #C70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1613 \"# c #CE0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1614 \"$ c #C90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1615 \"% c #BD0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1616 \"& c #CB0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1617 \"* c #D10000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1618 \"= c #D70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1619 \"- c #D30000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1620 \"; c #CD0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1621 \"> c #C60000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1622 \", c #D40000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1623 \"' c #DA0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1624 \") c #DE0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1625 \"! c #DB0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1626 \"~ c #D60000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1627 \"{ c #D00000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1628 \"] c #DC0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1629 \"^ c #E00000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1630 \"/ c #E40000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1631 \"( c #E10000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1632 \"_ c #DD0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1633 \": c #D80000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1634 \"< c #E50000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1635 \"[ c #E70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1636 \"} c #E60000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1637 \"| c #E20000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1638 \"1 c #E90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1639 \"2 c #E80000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1640 \"3 c #E30000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1641 \"4 c #DF0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1642 \"5 c #D90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1643 \"6 c #CC0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1644 \"7 c #C10000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1645 \"8 c #C30000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1646 \"9 c #BF0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1647 \"0 c #B90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1648 \"a c #BC0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1649 \"b c #BB0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1650 \"c c #B80000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1651 \"d c #B50000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1652 \"e c #B70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1653 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1654 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1655 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1656 \" . + \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1657 \" +@# $.% \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1658 \" &*= -;> \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1659 \" ,') !~{ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1660 \" ]^/ (_: \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1661 \" (<[ }|) \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1662 \" <[1 2<| \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1663 \" }222[< \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1664 \" }}}< \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1665 \" 333| \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1666 \" _4^4)] \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1667 \" ~:' 5=- \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1668 \" 6{- *#$ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1669 \" 7>$ @89 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1670 \" 0a+ %bc \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1671 \" ddc edd \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1672 \" ddd ddd \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1673 \" d d \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1674 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1675 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1676 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1677 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1678 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1679 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1680
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1681 (defconst newsticker--mark-immortal-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1682 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1683 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1684 static char * mark_immortal_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1685 \"24 24 93 2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1686 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1687 \". c #171717\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1688 \"+ c #030303\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1689 \"@ c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1690 \"# c #181818\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1691 \"$ c #090909\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1692 \"% c #FFC960\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1693 \"& c #FFCB61\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1694 \"* c #FFCB62\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1695 \"= c #FFC961\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1696 \"- c #FFC75F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1697 \"; c #FFC65E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1698 \"> c #FFCA61\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1699 \", c #FFCD63\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1700 \"' c #FFCF65\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1701 \") c #FFD065\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1702 \"! c #FFCE64\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1703 \"~ c #FFC35C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1704 \"{ c #FFC45D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1705 \"] c #FFD166\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1706 \"^ c #FFD267\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1707 \"/ c #FFD368\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1708 \"( c #FFD167\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1709 \"_ c #FFC05A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1710 \": c #010101\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1711 \"< c #040404\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1712 \"[ c #FFCC62\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1713 \"} c #FFD569\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1714 \"| c #FFD56A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1715 \"1 c #FFC860\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1716 \"2 c #FFC25B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1717 \"3 c #FFBB56\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1718 \"4 c #020202\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1719 \"5 c #060606\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1720 \"6 c #FFC15B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1721 \"7 c #FFC85F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1722 \"8 c #FFD469\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1723 \"9 c #FFD66A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1724 \"0 c #FFBC57\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1725 \"a c #1B1B1B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1726 \"b c #070707\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1727 \"c c #FFBA55\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1728 \"d c #FFB451\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1729 \"e c #FFB954\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1730 \"f c #FFB350\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1731 \"g c #FFB652\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1732 \"h c #FFBE58\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1733 \"i c #FFCD64\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1734 \"j c #FFD066\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1735 \"k c #FFC059\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1736 \"l c #FFB14E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1737 \"m c #0B0B0B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1738 \"n c #FFBB55\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1739 \"o c #FFC15A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1740 \"p c #FFB552\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1741 \"q c #FFAD4B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1742 \"r c #080808\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1743 \"s c #FFAF4C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1744 \"t c #FFB853\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1745 \"u c #FFA948\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1746 \"v c #050505\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1747 \"w c #FFB04E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1748 \"x c #FFB753\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1749 \"y c #FFBC56\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1750 \"z c #FFC55D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1751 \"A c #FFC55E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1752 \"B c #FFC45C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1753 \"C c #FFBD57\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1754 \"D c #FFB854\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1755 \"E c #FFB34F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1756 \"F c #FFAB4A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1757 \"G c #FFA545\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1758 \"H c #FFAA49\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1759 \"I c #FFB04D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1760 \"J c #FFB551\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1761 \"K c #FFBF58\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1762 \"L c #FFB24F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1763 \"M c #FFAC4A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1764 \"N c #FFA646\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1765 \"O c #FFA344\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1766 \"P c #FFA848\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1767 \"Q c #FFB14F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1768 \"R c #FFAF4D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1769 \"S c #FFA546\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1770 \"T c #FFA243\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1771 \"U c #FFA445\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1772 \"V c #FFAE4C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1773 \"W c #FFA444\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1774 \"X c #FFA142\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1775 \"Y c #FF9F41\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1776 \"Z c #0A0A0A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1777 \"` c #FF9E40\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1778 \" . c #FF9F40\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1779 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1780 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1781 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1782 \" . + @ @ + # \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1783 \" $ @ % & * * = - + + \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1784 \" @ ; > , ' ) ' ! * - ~ @ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1785 \" @ { > ! ] ^ / / ( ' * ; _ : \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1786 \" < _ ; [ ) / } | } / ] , 1 2 3 4 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1787 \" 5 6 7 , ] 8 9 9 9 } ^ ! = ~ 0 a \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1788 \" b c 6 - , ] 8 9 9 9 } ^ ! % ~ 0 d 5 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1789 \" : e _ ; * ) / 8 } } / ] , 1 2 3 f 5 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1790 \" : g h { = i j ^ / ^ ] ! * ; k e l m \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1791 \" : f n o ; > , ' ) ' ! * - 2 0 p q r \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1792 \" : s g 0 6 ; % > * * = - ~ h t l u r \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1793 \" v u w x y k ~ z A z B o C D E F G b \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1794 \" 5 H I J e 0 h K h C c x L M N . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1795 \" 4 O P q Q d g x g J L R H S T < \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1796 \" @ T U P F q V q M H N W X + \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1797 \" @ Y T O W G G W O X Y @ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1798 \" 4 Z ` Y Y Y .` 4 4 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1799 \" 5 : : @ @ Z \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1800 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1801 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1802 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1803 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1804 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1805 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1806
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1807
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1808 (defconst newsticker--narrow-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1809 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1810 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1811 static char * narrow_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1812 \"24 24 48 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1813 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1814 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1815 \"+ c #969696\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1816 \"@ c #9E9E9E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1817 \"# c #A4A4A4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1818 \"$ c #AAAAAA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1819 \"% c #AEAEAE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1820 \"& c #B1B1B1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1821 \"* c #B3B3B3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1822 \"= c #B4B4B4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1823 \"- c #B2B2B2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1824 \"; c #AFAFAF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1825 \"> c #ABABAB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1826 \", c #A6A6A6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1827 \"' c #A0A0A0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1828 \") c #989898\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1829 \"! c #909090\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1830 \"~ c #73AAD4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1831 \"{ c #7AB2DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1832 \"] c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1833 \"^ c #84BDE3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1834 \"/ c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1835 \"( c #8BC5E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1836 \"_ c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1837 \": c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1838 \"< c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1839 \"[ c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1840 \"} c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1841 \"| c #7BB3DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1842 \"1 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1843 \"2 c #6DA4CF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1844 \"3 c #979797\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1845 \"4 c #A3A3A3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1846 \"5 c #A8A8A8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1847 \"6 c #ADADAD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1848 \"7 c #ACACAC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1849 \"8 c #A9A9A9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1850 \"9 c #A5A5A5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1851 \"0 c #9A9A9A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1852 \"a c #929292\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1853 \"b c #8C8C8C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1854 \"c c #808080\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1855 \"d c #818181\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1856 \"e c #838383\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1857 \"f c #848484\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1858 \"g c #858585\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1859 \"h c #868686\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1860 \"i c #828282\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1861 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1862 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1863 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1864 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1865 \" .+@#$%&*=*-;>,')!. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1866 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1867 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1868 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1869 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1870 \" .~{]^/(___:<[}|12. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1871 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1872 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1873 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1874 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1875 \" .!3@45>666789'0ab. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1876 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1877 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1878 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1879 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1880 \" .cccdefghhgficccc. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1881 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1882 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1883 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1884 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1885 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1886 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1887 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1888
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1889 (defconst newsticker--get-all-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1890 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1891 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1892 static char * get_all_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1893 \"24 24 70 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1894 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1895 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1896 \"+ c #F3DA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1897 \"@ c #F5DF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1898 \"# c #F7E300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1899 \"$ c #F9E700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1900 \"% c #FAEA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1901 \"& c #FBEC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1902 \"* c #FBED00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1903 \"= c #FCEE00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1904 \"- c #FAEB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1905 \"; c #F9E800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1906 \"> c #F8E500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1907 \", c #F6E000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1908 \"' c #F4DB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1909 \") c #F1D500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1910 \"! c #EFD000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1911 \"~ c #B7CA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1912 \"{ c #BFD100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1913 \"] c #C5D700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1914 \"^ c #CBDB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1915 \"/ c #CFDF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1916 \"( c #D2E200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1917 \"_ c #D4E400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1918 \": c #D3E300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1919 \"< c #D0E000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1920 \"[ c #CCDD00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1921 \"} c #C7D800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1922 \"| c #C1D300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1923 \"1 c #BACC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1924 \"2 c #B1C500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1925 \"3 c #A8BC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1926 \"4 c #20A900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1927 \"5 c #22AF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1928 \"6 c #24B500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1929 \"7 c #26B900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1930 \"8 c #27BC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1931 \"9 c #27BE00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1932 \"0 c #28BF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1933 \"a c #27BD00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1934 \"b c #26BA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1935 \"c c #25B600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1936 \"d c #23B100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1937 \"e c #21AB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1938 \"f c #1FA400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1939 \"g c #1C9B00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1940 \"h c #21AA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1941 \"i c #24B300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1942 \"j c #25B800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1943 \"k c #25B700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1944 \"l c #24B400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1945 \"m c #23B000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1946 \"n c #1FA500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1947 \"o c #1D9E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1948 \"p c #20A800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1949 \"q c #21AC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1950 \"r c #23B200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1951 \"s c #22AD00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1952 \"t c #1D9F00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1953 \"u c #20A700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1954 \"v c #1EA100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1955 \"w c #1C9C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1956 \"x c #1DA000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1957 \"y c #1B9800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1958 \"z c #1A9600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1959 \"A c #1A9700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1960 \"B c #1A9500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1961 \"C c #199200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1962 \"D c #189100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1963 \"E c #178C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1964 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1965 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1966 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1967 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1968 \" ................... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1969 \" .+@#$%&*=*&-;>,')!. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1970 \" ................... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1971 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1972 \" ................... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1973 \" .~{]^/(___:<[}|123. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1974 \" ................... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1975 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1976 \" ................... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1977 \" .45678909abcdefg. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1978 \" .h5icj7jklmeno. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1979 \" .pq5drrmshft. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1980 \" .fu4h4pnvw. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1981 \" .oxvxtwy. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1982 \" .zAAzB. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1983 \" .CCD. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1984 \" .E. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1985 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1986 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1987 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1988 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1989 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1990 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1991
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1992
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1993 (defconst newsticker--update-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1994 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1995 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1996 static char * update_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1997 \"24 24 37 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1998 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1999 \". c #076D00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2000 \"+ c #0A8600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2001 \"@ c #0A8800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2002 \"# c #098400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2003 \"$ c #087200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2004 \"% c #087900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2005 \"& c #098500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2006 \"* c #098100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2007 \"= c #087600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2008 \"- c #097E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2009 \"; c #097F00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2010 \"> c #0A8700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2011 \", c #0A8C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2012 \"' c #097C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2013 \") c #098300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2014 \"! c #0A8900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2015 \"~ c #0A8E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2016 \"{ c #0B9200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2017 \"] c #087700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2018 \"^ c #076E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2019 \"/ c #076C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2020 \"( c #076B00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2021 \"_ c #076A00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2022 \": c #076900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2023 \"< c #076800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2024 \"[ c #066700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2025 \"} c #066500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2026 \"| c #066400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2027 \"1 c #066300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2028 \"2 c #066600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2029 \"3 c #066200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2030 \"4 c #076700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2031 \"5 c #065E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2032 \"6 c #066100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2033 \"7 c #065F00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2034 \"8 c #066000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2035 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2036 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2037 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2038 \" . +@@@+# \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2039 \" $% &@ +* \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2040 \" =-# ; \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2041 \" %*>, ' \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2042 \" ')!~{ = \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2043 \" ]$ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2044 \" ^ ^ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2045 \" . . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2046 \" / ( \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2047 \" _ : \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2048 \" < [ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2049 \" } | \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2050 \" [[ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2051 \" 1 $.:23 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2052 \" 3 4}35 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2053 \" 6 655 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2054 \" 76 85 55 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2055 \" 5555555 5 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2056 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2057 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2058 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2059 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2060 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2061 "Image for the update button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2062
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2063 (defconst newsticker--browse-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2064 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2065 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2066 static char * visit_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2067 \"24 24 39 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2068 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2069 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2070 \"+ c #FFFFFF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2071 \"@ c #00E63D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2072 \"# c #00E83E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2073 \"$ c #00E73D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2074 \"% c #00E93E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2075 \"& c #00E63C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2076 \"* c #00E53C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2077 \"= c #00E23B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2078 \"- c #00E33B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2079 \"; c #00E83D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2080 \"> c #00E13A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2081 \", c #00DD38\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2082 \"' c #00DE38\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2083 \") c #00E23A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2084 \"! c #00E43C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2085 \"~ c #00DF39\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2086 \"{ c #00DB37\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2087 \"] c #00D634\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2088 \"^ c #00D734\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2089 \"/ c #00E039\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2090 \"( c #00DC37\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2091 \"_ c #00D835\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2092 \": c #00D332\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2093 \"< c #00CD2F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2094 \"[ c #00DB36\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2095 \"} c #00D433\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2096 \"| c #00CF30\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2097 \"1 c #00DA36\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2098 \"2 c #00D936\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2099 \"3 c #00D533\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2100 \"4 c #00D131\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2101 \"5 c #00CE2F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2102 \"6 c #00CC2F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2103 \"7 c #00CA2D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2104 \"8 c #00C62B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2105 \"9 c #00C52A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2106 \"0 c #00BE27\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2107 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2108 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2109 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2110 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2111 \" .+++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2112 \" .++.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2113 \" .++.@.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2114 \" .++.##$.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2115 \" .++.%%%#&.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2116 \" .++.$%%%#*=.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2117 \" .++.-@;##$*>,.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2118 \" .++.')!&@@*=~{].++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2119 \" .++.^{~>---)/(_:<.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2120 \" .++.^[,~/~'(_}|.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2121 \" .++.]_1[12^:|.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2122 \" .++.:}33:45.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2123 \" .++.<5567.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2124 \" .++.889.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2125 \" .++.0.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2126 \" .++.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2127 \" .+++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2128 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2129 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2130 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2131 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2132 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2133 "Image for the browse button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2134
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2135
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2136 (defvar newsticker-tool-bar-map
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2137 (if (featurep 'xemacs)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2138 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2139 (let ((tool-bar-map (make-sparse-keymap)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2140 (define-key tool-bar-map [newsticker-sep-1]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2141 (list 'menu-item "--double-line"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2142 (define-key tool-bar-map [newsticker-browse-url]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2143 (list 'menu-item "newsticker-browse-url" 'newsticker-browse-url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2144 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2145 :help "Browse URL for item at point"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2146 :image newsticker--browse-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2147 (define-key tool-bar-map [newsticker-buffer-force-update]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2148 (list 'menu-item "newsticker-buffer-force-update"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2149 'newsticker-buffer-force-update
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2150 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2151 :help "Update newsticker buffer"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2152 :image newsticker--update-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2153 :enable '(not newsticker--buffer-uptodate-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2154 (define-key tool-bar-map [newsticker-get-all-news]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2155 (list 'menu-item "newsticker-get-all-news" 'newsticker-get-all-news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2156 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2157 :help "Get news for all feeds"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2158 :image newsticker--get-all-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2159 (define-key tool-bar-map [newsticker-mark-item-at-point-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2160 (list 'menu-item "newsticker-mark-item-at-point-as-read"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2161 'newsticker-mark-item-at-point-as-read
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2162 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2163 :image newsticker--mark-read-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2164 :help "Mark current item as read"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2165 :enable '(newsticker-item-not-old-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2166 (define-key tool-bar-map [newsticker-mark-item-at-point-as-immortal]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2167 (list 'menu-item "newsticker-mark-item-at-point-as-immortal"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2168 'newsticker-mark-item-at-point-as-immortal
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2169 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2170 :image newsticker--mark-immortal-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2171 :help "Mark current item as immortal"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2172 :enable '(newsticker-item-not-immortal-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2173 (define-key tool-bar-map [newsticker-toggle-auto-narrow-to-feed]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2174 (list 'menu-item "newsticker-toggle-auto-narrow-to-feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2175 'newsticker-toggle-auto-narrow-to-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2176 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2177 :help "Toggle visibility of other feeds"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2178 :image newsticker--narrow-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2179 (define-key tool-bar-map [newsticker-next-feed]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2180 (list 'menu-item "newsticker-next-feed" 'newsticker-next-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2181 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2182 :help "Go to next feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2183 :image newsticker--next-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2184 :enable '(newsticker-next-feed-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2185 (define-key tool-bar-map [newsticker-next-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2186 (list 'menu-item "newsticker-next-item" 'newsticker-next-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2187 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2188 :help "Go to next item"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2189 :image newsticker--next-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2190 :enable '(newsticker-next-item-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2191 (define-key tool-bar-map [newsticker-previous-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2192 (list 'menu-item "newsticker-previous-item" 'newsticker-previous-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2193 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2194 :help "Go to previous item"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2195 :image newsticker--previous-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2196 :enable '(newsticker-previous-item-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2197 (define-key tool-bar-map [newsticker-previous-feed]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2198 (list 'menu-item "newsticker-previous-feed" 'newsticker-previous-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2199 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2200 :help "Go to previous feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2201 :image newsticker--previous-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2202 :enable '(newsticker-previous-feed-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2203 ;; standard icons / actions
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2204 (tool-bar-add-item "close"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2205 'newsticker-close-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2206 'newsticker-close-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2207 :help "Close newsticker buffer")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2208 (tool-bar-add-item "preferences"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2209 'newsticker-customize
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2210 'newsticker-customize
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2211 :help "Customize newsticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2212 tool-bar-map)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2213
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2214 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2215 ;;; Newsticker mode
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2216 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2217
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2218 (define-derived-mode newsticker-mode fundamental-mode
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2219 "NewsTicker"
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2220 "Viewing news feeds in Emacs."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2221 (set (make-local-variable 'tool-bar-map) newsticker-tool-bar-map)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2222 (set (make-local-variable 'imenu-sort-function) nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2223 (set (make-local-variable 'scroll-conservatively) 999)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2224 (setq imenu-create-index-function 'newsticker--imenu-create-index)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2225 (setq imenu-default-goto-function 'newsticker--imenu-goto)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2226 (setq buffer-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2227 (auto-fill-mode -1) ;; turn auto-fill off!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2228 (font-lock-mode -1) ;; turn off font-lock!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2229 (set (make-local-variable 'font-lock-defaults) nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2230 (set (make-local-variable 'line-move-ignore-invisible) t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2231 (setq mode-line-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2232 (list "-"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2233 'mode-line-mule-info
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2234 'mode-line-modified
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2235 'mode-line-frame-identification
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2236 " Newsticker ("
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2237 '(newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2238 "up to date"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2239 "NEED UPDATE")
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2240 ") "
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2241 '(:eval (format "[%d]" (length newsticker--process-ids)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2242 " -- "
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2243 '(:eval (newsticker--buffer-get-feed-title-at-point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2244 ": "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2245 '(:eval (newsticker--buffer-get-item-title-at-point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2246 " %-"))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2247 (add-to-invisibility-spec 't)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2248 (unless newsticker-show-all-news-elements
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2249 (add-to-invisibility-spec 'extra))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2250 (newsticker--buffer-set-uptodate nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2251
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2252 ;; refine its mode-map
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2253 (define-key newsticker-mode-map "sO" 'newsticker-show-old-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2254 (define-key newsticker-mode-map "hO" 'newsticker-hide-old-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2255 (define-key newsticker-mode-map "sa" 'newsticker-show-all-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2256 (define-key newsticker-mode-map "ha" 'newsticker-hide-all-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2257 (define-key newsticker-mode-map "sf" 'newsticker-show-feed-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2258 (define-key newsticker-mode-map "hf" 'newsticker-hide-feed-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2259 (define-key newsticker-mode-map "so" 'newsticker-show-old-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2260 (define-key newsticker-mode-map "ho" 'newsticker-hide-old-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2261 (define-key newsticker-mode-map "sn" 'newsticker-show-new-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2262 (define-key newsticker-mode-map "hn" 'newsticker-hide-new-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2263 (define-key newsticker-mode-map "se" 'newsticker-show-entry)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2264 (define-key newsticker-mode-map "he" 'newsticker-hide-entry)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2265 (define-key newsticker-mode-map "sx" 'newsticker-show-extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2266 (define-key newsticker-mode-map "hx" 'newsticker-hide-extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2267
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2268 (define-key newsticker-mode-map " " 'scroll-up)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2269 (define-key newsticker-mode-map "q" 'newsticker-close-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2270 (define-key newsticker-mode-map "p" 'newsticker-previous-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2271 (define-key newsticker-mode-map "P" 'newsticker-previous-new-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2272 (define-key newsticker-mode-map "F" 'newsticker-previous-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2273 (define-key newsticker-mode-map "\t" 'newsticker-next-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2274 (define-key newsticker-mode-map "n" 'newsticker-next-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2275 (define-key newsticker-mode-map "N" 'newsticker-next-new-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2276 (define-key newsticker-mode-map "f" 'newsticker-next-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2277 (define-key newsticker-mode-map "M" 'newsticker-mark-all-items-as-read)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2278 (define-key newsticker-mode-map "m"
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2279 'newsticker-mark-all-items-at-point-as-read-and-redraw)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2280 (define-key newsticker-mode-map "o"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2281 'newsticker-mark-item-at-point-as-read)
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2282 (define-key newsticker-mode-map "O"
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2283 'newsticker-mark-all-items-at-point-as-read)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2284 (define-key newsticker-mode-map "G" 'newsticker-get-all-news)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2285 (define-key newsticker-mode-map "g" 'newsticker-get-news-at-point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2286 (define-key newsticker-mode-map "u" 'newsticker-buffer-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2287 (define-key newsticker-mode-map "U" 'newsticker-buffer-force-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2288 (define-key newsticker-mode-map "a" 'newsticker-add-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2289
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2290 (define-key newsticker-mode-map "i"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2291 'newsticker-mark-item-at-point-as-immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2292
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2293 (define-key newsticker-mode-map "xf"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2294 'newsticker-toggle-auto-narrow-to-feed)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2295 (define-key newsticker-mode-map "xi"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2296 'newsticker-toggle-auto-narrow-to-item)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2297
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2298 ;; maps for the clickable portions
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2299 (defvar newsticker--url-keymap (make-sparse-keymap)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2300 "Key map for click-able headings in the newsticker buffer.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2301 (define-key newsticker--url-keymap [mouse-2]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2302 'newsticker-mouse-browse-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2303 (define-key newsticker--url-keymap "\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2304 'newsticker-browse-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2305 (define-key newsticker--url-keymap "\C-m"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2306 'newsticker-browse-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2307 (define-key newsticker--url-keymap [(control return)]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2308 'newsticker-handle-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2309
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2310 ;; newsticker menu
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2311 (defvar newsticker-menu (make-sparse-keymap "Newsticker"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2312
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2313 (define-key newsticker-menu [newsticker-browse-url]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2314 '("Browse URL for item at point" . newsticker-browse-url))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2315 (define-key newsticker-menu [newsticker-separator-1]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2316 '("--"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2317 (define-key newsticker-menu [newsticker-buffer-update]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2318 '("Update buffer" . newsticker-buffer-update))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2319 (define-key newsticker-menu [newsticker-separator-2]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2320 '("--"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2321 (define-key newsticker-menu [newsticker-get-all-news]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2322 '("Get news from all feeds" . newsticker-get-all-news))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2323 (define-key newsticker-menu [newsticker-get-news-at-point]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2324 '("Get news from feed at point" . newsticker-get-news-at-point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2325 (define-key newsticker-menu [newsticker-separator-3]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2326 '("--"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2327 (define-key newsticker-menu [newsticker-mark-all-items-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2328 '("Mark all items as read" . newsticker-mark-all-items-as-read))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2329 (define-key newsticker-menu [newsticker-mark-all-items-at-point-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2330 '("Mark all items in feed at point as read" .
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2331 newsticker-mark-all-items-at-point-as-read))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2332 (define-key newsticker-menu [newsticker-mark-item-at-point-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2333 '("Mark item at point as read" .
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2334 newsticker-mark-item-at-point-as-read))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2335 (define-key newsticker-menu [newsticker-mark-item-at-point-as-immortal]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2336 '("Toggle immortality for item at point" .
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2337 newsticker-mark-item-at-point-as-immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2338 (define-key newsticker-menu [newsticker-separator-4]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2339 '("--"))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2340 (define-key newsticker-menu [newsticker-toggle-auto-narrow-to-item]
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2341 '("Narrow to single item" . newsticker-toggle-auto-narrow-to-item))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2342 (define-key newsticker-menu [newsticker-toggle-auto-narrow-to-feed]
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2343 '("Narrow to single news feed" . newsticker-toggle-auto-narrow-to-feed))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2344 (define-key newsticker-menu [newsticker-hide-old-items]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2345 '("Hide old items" . newsticker-hide-old-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2346 (define-key newsticker-menu [newsticker-show-old-items]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2347 '("Show old items" . newsticker-show-old-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2348 (define-key newsticker-menu [newsticker-next-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2349 '("Go to next item" . newsticker-next-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2350 (define-key newsticker-menu [newsticker-previous-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2351 '("Go to previous item" . newsticker-previous-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2352
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2353 ;; bind menu to mouse
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2354 (define-key newsticker-mode-map [down-mouse-3] newsticker-menu)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2355 ;; Put menu in menu-bar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2356 (define-key newsticker-mode-map [menu-bar Newsticker]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2357 (cons "Newsticker" newsticker-menu))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2358
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2359
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2360 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2361 ;;; shortcuts
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2362 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2363 (defsubst newsticker--title (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2364 "Return title of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2365 (nth 0 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2366 (defsubst newsticker--desc (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2367 "Return description of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2368 (nth 1 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2369 (defsubst newsticker--link (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2370 "Return link of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2371 (nth 2 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2372 (defsubst newsticker--time (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2373 "Return time of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2374 (nth 3 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2375 (defsubst newsticker--age (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2376 "Return age of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2377 (nth 4 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2378 (defsubst newsticker--pos (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2379 "Return position/index of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2380 (nth 5 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2381 (defsubst newsticker--preformatted-contents (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2382 "Return pre-formatted text of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2383 (nth 6 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2384 (defsubst newsticker--preformatted-title (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2385 "Return pre-formatted title of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2386 (nth 7 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2387 (defsubst newsticker--extra (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2388 "Return extra attributes of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2389 (nth 8 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2390 (defsubst newsticker--guid (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2391 "Return guid of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2392 (let ((guid (assoc 'guid (newsticker--extra item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2393 (if (stringp guid)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2394 guid
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2395 (car (xml-node-children guid)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2396 (defsubst newsticker--enclosure (item)
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
2397 "Return enclosure element of ITEM in the form \(...FIXME...\) or nil."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2398 (let ((enclosure (assoc 'enclosure (newsticker--extra item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2399 (if enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2400 (xml-node-attributes enclosure))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2401
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2402 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2403 ;;; User fun
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2404 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2405
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
2406 ;;;###autoload
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2407 (defun newsticker-start (&optional do-not-complain-if-running)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2408 "Start the newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2409 Start the timers for display and retrieval. If the newsticker, i.e. the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2410 timers, are running already a warning message is printed unless
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2411 DO-NOT-COMPLAIN-IF-RUNNING is not nil.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2412 Run `newsticker-start-hook' if newsticker was not running already."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2413 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2414 (let ((running (newsticker-running-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2415 ;; read old cache if it exists and newsticker is not running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2416 (unless running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2417 (let* ((coding-system-for-read 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2418 (buf (find-file-noselect newsticker-cache-filename)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2419 (when buf
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2420 (set-buffer buf)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2421 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2422 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2423 (setq newsticker--cache (read buf))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2424 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2425 (message "Error while reading newsticker cache file!")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2426 (setq newsticker--cache nil))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2427 ;; start retrieval timers -- for sake of simplicity we will start
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2428 ;; one timer for each feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2429 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2430 (let* ((feed-name (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2431 (start-time (nth 2 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2432 (interval (or (nth 3 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2433 newsticker-retrieval-interval))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2434 (timer (assoc (car item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2435 newsticker--retrieval-timer-list)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2436 (if timer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2437 (or do-not-complain-if-running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2438 (message "Timer for %s is running already!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2439 feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2440 (newsticker--debug-msg "Starting timer for %s: %s, %d"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2441 feed-name start-time interval)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2442 ;; do not repeat retrieval if interval not positive
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2443 (if (<= interval 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2444 (setq interval nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2445 ;; Suddenly XEmacs doesn't like start-time 0
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2446 (if (or (not start-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2447 (and (numberp start-time) (= start-time 0)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2448 (setq start-time 1))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2449 ;; (message "start-time %s" start-time)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2450 (setq timer (run-at-time start-time interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2451 'newsticker-get-news feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2452 (if interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2453 (add-to-list 'newsticker--retrieval-timer-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2454 (cons feed-name timer))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2455 (append newsticker-url-list-defaults newsticker-url-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2456 (unless running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2457 (run-hooks 'newsticker-start-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2458 (message "Newsticker started!"))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2459
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2460 ;;;###autoload
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2461 (defun newsticker-start-ticker ()
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2462 "Start newsticker's ticker (but not the news retrieval).
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2463 Start display timer for the actual ticker if wanted and not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2464 running already."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2465 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2466 (if (and (> newsticker-display-interval 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2467 (not newsticker--display-timer))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2468 (setq newsticker--display-timer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2469 (run-at-time newsticker-display-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2470 newsticker-display-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2471 'newsticker--display-tick))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
2472
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2473 (defun newsticker-stop ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2474 "Stop the newsticker and the newsticker-ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2475 Cancel the timers for display and retrieval. Run `newsticker-stop-hook'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2476 if newsticker has been running."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2477 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2478 (newsticker--cache-update t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2479 (newsticker-stop-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2480 (when (newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2481 (mapc (lambda (name-and-timer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2482 (cancel-timer (cdr name-and-timer)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2483 newsticker--retrieval-timer-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2484 (setq newsticker--retrieval-timer-list nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2485 (run-hooks 'newsticker-stop-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2486 (message "Newsticker stopped!")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2487
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2488 (defun newsticker-stop-ticker ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2489 "Stop newsticker's ticker (but not the news retrieval)."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2490 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2491 (when newsticker--display-timer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2492 (cancel-timer newsticker--display-timer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2493 (setq newsticker--display-timer nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2494
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2495 ;; the functions we need for retrieval and display
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
2496 ;;;###autoload
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2497 (defun newsticker-show-news ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2498 "Switch to newsticker buffer. You may want to bind this to a key."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2499 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2500 (newsticker-start t) ;; will start only if not running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2501 (newsticker-buffer-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2502 (switch-to-buffer "*newsticker*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2503
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2504 (defun newsticker-buffer-force-update ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2505 "Update the newsticker buffer, even if not necessary."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2506 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2507 (newsticker-buffer-update t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2508
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2509 (defun newsticker-buffer-update (&optional force)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2510 "Update the *newsticker* buffer.
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
2511 Unless FORCE is t this is done only if necessary, i.e. when the
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2512 *newsticker* buffer is not up-to-date."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2513 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2514 ;; bring cache data into proper order....
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2515 (newsticker--cache-sort)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2516 ;; fill buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2517 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2518 (let ((buf (get-buffer "*newsticker*")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2519 (if buf
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2520 (switch-to-buffer buf)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2521 (switch-to-buffer (get-buffer-create "*newsticker*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2522 (newsticker--buffer-set-uptodate nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2523 (when (or force
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2524 (not newsticker--buffer-uptodate-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2525 (message "Preparing newsticker buffer...")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2526 (setq buffer-undo-list t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2527 (let ((inhibit-read-only t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2528 (set-buffer-modified-p nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2529 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2530 (newsticker-mode)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2531 ;; Emacs 21.3.50 does not care if we turn off auto-fill in the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2532 ;; definition of newsticker-mode, so we do it here (again)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2533 (auto-fill-mode -1)
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
2534
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2535 (set-buffer-file-coding-system 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2536
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2537 (if newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2538 (set (make-local-variable 'fill-column) (1- (window-width))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2539 (newsticker--buffer-insert-all-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2540
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2541 ;; FIXME: needed for methods buffer in ecb
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2542 ;; (set-visited-file-name "*newsticker*")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2543
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2544 (set-buffer-modified-p nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2545 (newsticker-hide-all-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2546 (if newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2547 (newsticker-hide-old-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2548 (if newsticker-show-descriptions-of-new-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2549 (newsticker-show-new-item-desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2550 )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2551 (message ""))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2552 (newsticker--buffer-set-uptodate t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2553 (run-hooks 'newsticker-buffer-change-hook)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2554
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2555 (defun newsticker-get-all-news ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2556 "Launch retrieval of news from all configured newsticker sites.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2557 This does NOT start the retrieval timers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2558 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2559 ;; launch retrieval of news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2560 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2561 (newsticker-get-news (car item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2562 (append newsticker-url-list-defaults newsticker-url-list)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2563
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2564 (defun newsticker-get-news-at-point ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2565 "Launch retrieval of news for the feed point is in.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2566 This does NOT start the retrieval timers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2567 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2568 ;; launch retrieval of news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2569 (let ((feed (get-text-property (point) 'feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2570 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2571 (newsticker--debug-msg "Getting news for %s" (symbol-name feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2572 (newsticker-get-news (symbol-name feed)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2573
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2574 (defun newsticker-add-url (url name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2575 "Add given URL under given NAME to `newsticker-url-list'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2576 If URL is nil it is searched at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2577 (interactive
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2578 (list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2579 (read-string "URL: "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2580 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2581 (end-of-line)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2582 (and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2583 (re-search-backward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2584 "http://"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2585 (if (> (point) (+ (point-min) 100))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2586 (- (point) 100)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2587 (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2588 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2589 (re-search-forward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2590 "http://[-a-zA-Z0-9&/_.]*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2591 (if (< (point) (- (point-max) 200))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2592 (+ (point) 200)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2593 (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2594 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2595 (buffer-substring-no-properties (match-beginning 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2596 (match-end 0)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2597 (read-string "Name: ")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2598 (add-to-list 'newsticker-url-list (list name url nil nil nil) t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2599 (customize-variable 'newsticker-url-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2600
86818
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
2601 ;; External.
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
2602 (declare-function w3m-toggle-inline-image "ext:w3m" (&optional force no-cache))
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
2603
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2604 (defun newsticker-w3m-show-inline-images ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2605 "Show inline images in visible text ranges.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2606 In-line images in invisible text ranges are hidden. This function
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2607 calls `w3m-toggle-inline-image'. It works only if
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
2608 `newsticker-html-renderer' is set to `w3m-region'."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2609 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2610 (if (eq newsticker-html-renderer 'w3m-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2611 (let ((inhibit-read-only t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2612 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2613 (save-restriction
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2614 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2615 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2616 (let ((pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2617 (while pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2618 (setq pos (next-single-property-change pos 'w3m-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2619 (when pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2620 (goto-char pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2621 (when (get-text-property pos 'w3m-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2622 (let ((invis (newsticker--lists-intersect-p
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2623 (get-text-property (1- (point))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2624 'invisible)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2625 buffer-invisibility-spec)))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2626 (unless (car (get-text-property (1- (point))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2627 'display))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2628 (unless invis
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2629 (w3m-toggle-inline-image t)))))))))))))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2630
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2631 (defadvice w3m-insert-image (after newsticker activate)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2632 (newsticker--buffer-after-w3m-insert-image (ad-get-arg 0) (ad-get-arg 1)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2633
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2634 (defun newsticker--buffer-after-w3m-insert-image (beg end)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2635 "Save preformatted contents after an image has been inserted
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2636 between BEG and END."
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2637 (when (string= (buffer-name) "*newsticker*")
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2638 (save-excursion
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2639 (newsticker--buffer-beginning-of-item)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2640 (let* ((pos (point))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2641 (feed (get-text-property pos 'feed))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2642 (age (get-text-property pos 'nt-age))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2643 (title (get-text-property pos 'nt-title))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2644 (guid (get-text-property pos 'nt-guid))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2645 (nt-desc (get-text-property pos 'nt-desc))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2646 (item (newsticker--cache-contains newsticker--cache
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2647 feed title nt-desc
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2648 nil nil guid))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2649 (desc-beg (newsticker--buffer-goto '(desc)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2650 (desc-end (newsticker--buffer-end-of-item)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2651 ;;(add-text-properties beg end (list nt-type desc))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2652 (add-text-properties beg end (list 'invisible
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2653 (get-text-property end 'invisible)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2654 ;;(message "newsticker--buffer-after-w3m-insert-image at %s, %s: `%s'"
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2655 ;; beg feed title)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2656 (if item
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2657 (newsticker--cache-set-preformatted-contents
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2658 item (buffer-substring desc-beg desc-end))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2659 (message "ooops in newsticker--buffer-after-w3m-insert-image at %s, %s: `%s'"
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2660 beg feed title))))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
2661
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2662 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2663 ;;; keymap stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2664 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2665 (defun newsticker-close-buffer ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2666 "Close the newsticker buffer."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2667 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2668 (newsticker--cache-update t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2669 (bury-buffer))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2670
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2671 (defun newsticker-next-new-item (&optional do-not-wrap-at-eob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2672 "Go to next new news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2673 If no new item is found behind point, search is continued at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2674 beginning of buffer unless optional argument DO-NOT-WRAP-AT-EOB
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2675 is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2676 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2677 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2678 (let ((go-ahead t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2679 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2680 (unless (newsticker--buffer-goto '(item) 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2681 ;; found nothing -- wrap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2682 (unless do-not-wrap-at-eob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2683 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2684 (newsticker-next-new-item t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2685 (setq go-ahead nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2686 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2687 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2688 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2689 ;; this item is invisible -- continue search
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2690 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2691 (run-hooks 'newsticker-select-item-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2692 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2693
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2694 (defun newsticker-previous-new-item (&optional do-not-wrap-at-bob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2695 "Go to previous new news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2696 If no new item is found before point, search is continued at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2697 beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2698 is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2699 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2700 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2701 (let ((go-ahead t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2702 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2703 (unless (newsticker--buffer-goto '(item) 'new t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2704 (unless do-not-wrap-at-bob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2705 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2706 (newsticker--buffer-goto '(item) 'new t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2707 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2708 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2709 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2710 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2711 (run-hooks 'newsticker-select-item-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2712 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2713
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2714 (defun newsticker-next-item (&optional do-not-wrap-at-eob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2715 "Go to next news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2716 Return new buffer position.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2717 If no item is found below point, search is continued at beginning
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2718 of buffer unless optional argument DO-NOT-WRAP-AT-EOB is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2719 non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2720 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2721 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2722 (let ((go-ahead t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2723 (search-list '(item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2724 (if newsticker--auto-narrow-to-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2725 (setq search-list '(item feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2726 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2727 (unless (newsticker--buffer-goto search-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2728 ;; found nothing -- wrap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2729 (unless do-not-wrap-at-eob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2730 (goto-char (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2731 (setq go-ahead nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2732 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2733 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2734 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2735 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2736 (run-hooks 'newsticker-select-item-hook)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2737 (force-mode-line-update)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2738 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2739
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2740 (defun newsticker-next-item-same-feed ()
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2741 "Go to next news item in the same feed.
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2742 Return new buffer position. If no item is found below point or if
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2743 auto-narrow-to-item is enabled, nil is returned."
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2744 (interactive)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2745 (if newsticker--auto-narrow-to-item
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2746 nil
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2747 (let ((go-ahead t)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2748 (current-pos (point))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2749 (end-of-feed (save-excursion (newsticker--buffer-end-of-feed))))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2750 (while go-ahead
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2751 (unless (newsticker--buffer-goto '(item))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2752 (setq go-ahead nil))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2753 (unless (newsticker--lists-intersect-p
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2754 (get-text-property (point) 'invisible)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2755 buffer-invisibility-spec)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2756 (setq go-ahead nil)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2757 (if (and (> (point) current-pos)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2758 (< (point) end-of-feed))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2759 (point)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2760 (goto-char current-pos)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2761 nil))))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2762
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2763 (defun newsticker-previous-item (&optional do-not-wrap-at-bob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2764 "Go to previous news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2765 Return new buffer position.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2766 If no item is found before point, search is continued at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2767 beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2768 is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2769 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2770 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2771 (let ((go-ahead t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2772 (search-list '(item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2773 (if newsticker--auto-narrow-to-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2774 (setq search-list '(item feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2775 (when (bobp)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2776 (unless do-not-wrap-at-bob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2777 (goto-char (point-max))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2778 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2779 (if (newsticker--buffer-goto search-list nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2780 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2781 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2782 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2783 (setq go-ahead nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2784 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2785 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2786 (run-hooks 'newsticker-select-item-hook)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2787 (force-mode-line-update)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2788 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2789
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2790 (defun newsticker-next-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2791 "Go to next news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2792 Return new buffer position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2793 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2794 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2795 (newsticker--buffer-goto '(feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2796 (run-hooks 'newsticker-select-feed-hook)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2797 (force-mode-line-update)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2798 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2799
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2800 (defun newsticker-previous-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2801 "Go to previous news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2802 Return new buffer position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2803 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2804 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2805 (newsticker--buffer-goto '(feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2806 (run-hooks 'newsticker-select-feed-hook)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
2807 (force-mode-line-update)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2808 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2809
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2810 (defun newsticker-mark-all-items-at-point-as-read-and-redraw ()
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2811 "Mark all items as read and clear ticker contents."
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2812 (interactive)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2813 (when (or newsticker--buffer-uptodate-p
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2814 (y-or-n-p
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2815 "Buffer is not up to date -- really mark items as read? "))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2816 (newsticker-mark-all-items-of-feed-as-read
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2817 (get-text-property (point) 'feed))))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2818
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2819 (defun newsticker-mark-all-items-of-feed-as-read (feed)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2820 "Mark all items as read, clear ticker, and redraw *newsticker* buffer."
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2821 (when feed
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2822 (let ((pos (point)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2823 (message "Marking all items as read for %s" (symbol-name feed))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2824 (newsticker--cache-replace-age newsticker--cache feed 'new 'old)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2825 (newsticker--cache-replace-age newsticker--cache feed 'obsolete
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2826 'old)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2827 (newsticker--cache-update)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2828 (newsticker--buffer-set-uptodate nil)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2829 (newsticker--ticker-text-setup)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2830 (newsticker-buffer-update)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2831 ;; go back to where we came frome
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2832 (goto-char pos)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2833 (end-of-line)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2834 (newsticker--buffer-goto '(feed) nil t))))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2835
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2836 (defun newsticker-mark-all-items-at-point-as-read ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2837 "Mark all items as read and clear ticker contents."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2838 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2839 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2840 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2841 "Buffer is not up to date -- really mark items as read? "))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2842 (newsticker--do-mark-item-at-point-as-read t)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2843 (while (newsticker-next-item-same-feed)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2844 (newsticker--do-mark-item-at-point-as-read t))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2845 (newsticker-next-item t)))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2846
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2847 (defun newsticker-mark-item-at-point-as-read (&optional respect-immortality)
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2848 "Mark item at point as read and move to next item.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2849 If optional argument RESPECT-IMMORTALITY is not nil immortal items do
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2850 not get changed."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2851 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2852 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2853 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2854 "Buffer is not up to date -- really mark this item as read? "))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2855 (newsticker--do-mark-item-at-point-as-read respect-immortality)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2856 ;; move forward
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2857 (newsticker-next-item t)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2858
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2859 (defun newsticker--do-mark-item-at-point-as-read (&optional respect-immortality)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2860 "Mark item at point as read.
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2861 If optional argument RESPECT-IMMORTALITY is not nil immortal items do
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2862 not get changed."
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2863 (let ((feed (get-text-property (point) 'feed)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2864 (when feed
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2865 (save-excursion
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2866 (newsticker--buffer-beginning-of-item)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2867 (let ((inhibit-read-only t)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2868 (age (get-text-property (point) 'nt-age))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2869 (title (get-text-property (point) 'nt-title))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2870 (guid (get-text-property (point) 'nt-guid))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2871 (nt-desc (get-text-property (point) 'nt-desc))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2872 (pos (save-excursion (newsticker--buffer-end-of-item)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2873 item)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2874 (when (or (eq age 'new)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2875 (eq age 'obsolete)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2876 (and (eq age 'immortal)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2877 (not respect-immortality)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2878 ;; find item
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2879 (setq item (newsticker--cache-contains newsticker--cache
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2880 feed title nt-desc
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2881 nil nil guid))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2882 ;; mark as old
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2883 (when item
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2884 (setcar (nthcdr 4 item) 'old)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2885 (newsticker--do-forget-preformatted item))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2886 ;; clean up ticker
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2887 (if (or (and (eq age 'new)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2888 newsticker-hide-immortal-items-in-echo-area)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2889 (and (memq age '(old immortal))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2890 (not
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2891 (eq newsticker-hide-old-items-in-newsticker-buffer
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2892 newsticker-hide-immortal-items-in-echo-area))))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2893 (newsticker--ticker-text-remove feed title))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2894 ;; set faces etc.
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2895 (save-excursion
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2896 (save-restriction
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2897 (widen)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2898 (put-text-property (point) pos 'nt-age 'old)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2899 (newsticker--buffer-set-faces (point) pos)))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
2900 (set-buffer-modified-p nil)))))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2901
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2902 (defun newsticker-mark-item-at-point-as-immortal ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2903 "Mark item at point as read."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2904 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2905 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2906 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2907 "Buffer is not up to date -- really mark this item as read? "))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2908 (let ((feed (get-text-property (point) 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2909 (item nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2910 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2911 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2912 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2913 (let ((inhibit-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2914 (oldage (get-text-property (point) 'nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2915 (title (get-text-property (point) 'nt-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2916 (guid (get-text-property (point) 'nt-guid))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2917 (pos (save-excursion (newsticker--buffer-end-of-item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2918 (let ((newage 'immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2919 (if (eq oldage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2920 (setq newage 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2921 (setq item (newsticker--cache-contains newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2922 feed title nil nil nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2923 guid))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2924 ;; change age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2925 (when item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2926 (setcar (nthcdr 4 item) newage)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2927 (newsticker--do-forget-preformatted item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2928 (if (or (and (eq newage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2929 newsticker-hide-immortal-items-in-echo-area)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2930 (and (eq newage 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2931 newsticker-hide-obsolete-items-in-echo-area)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2932 (and (eq oldage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2933 (not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2934 (eq newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2935 newsticker-hide-immortal-items-in-echo-area))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2936 (newsticker--ticker-text-remove feed title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2937 (newsticker--ticker-text-setup))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2938 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2939 (save-restriction
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2940 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2941 (put-text-property (point) pos 'nt-age newage)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2942 (if (eq newage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2943 (put-text-property (point) pos 'nt-age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2944 (put-text-property (point) pos 'nt-age 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2945 (newsticker--buffer-set-faces (point) pos))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2946 (if item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2947 (newsticker-next-item t))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2948
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2949 (defun newsticker-mark-all-items-as-read ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2950 "Mark all items as read and clear ticker contents."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2951 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2952 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2953 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2954 "Buffer is not up to date -- really mark items as read? "))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2955 (newsticker--cache-replace-age newsticker--cache 'any 'new 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2956 (newsticker--buffer-set-uptodate nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2957 (newsticker--ticker-text-setup)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2958 (newsticker--cache-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2959 (newsticker-buffer-update)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2960
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2961 (defun newsticker-hide-extra ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2962 "Hide the extra elements of items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2963 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2964 (newsticker--buffer-hideshow 'extra nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2965 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2966
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2967 (defun newsticker-show-extra ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2968 "Show the extra elements of items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2969 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2970 (newsticker--buffer-hideshow 'extra t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2971 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2972
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2973 (defun newsticker-hide-old-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2974 "Hide the description of old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2975 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2976 (newsticker--buffer-hideshow 'desc-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2977 (newsticker--buffer-redraw))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
2978
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2979 (defun newsticker-show-old-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2980 "Show the description of old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2981 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2982 (newsticker--buffer-hideshow 'item-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2983 (newsticker--buffer-hideshow 'desc-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2984 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2985
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2986 (defun newsticker-hide-new-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2987 "Hide the description of new items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2988 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2989 (newsticker--buffer-hideshow 'desc-new nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2990 (newsticker--buffer-hideshow 'desc-immortal nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2991 (newsticker--buffer-hideshow 'desc-obsolete nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2992 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2993
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2994 (defun newsticker-show-new-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2995 "Show the description of new items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2996 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2997 (newsticker--buffer-hideshow 'desc-new t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2998 (newsticker--buffer-hideshow 'desc-immortal t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2999 (newsticker--buffer-hideshow 'desc-obsolete t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3000 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3001
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3002 (defun newsticker-hide-feed-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3003 "Hide the description of feeds."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3004 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3005 (newsticker--buffer-hideshow 'desc-feed nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3006 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3007
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3008 (defun newsticker-show-feed-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3009 "Show the description of old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3010 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3011 (newsticker--buffer-hideshow 'desc-feed t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3012 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3013
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3014 (defun newsticker-hide-all-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3015 "Hide the descriptions of feeds and all items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3016 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3017 (newsticker--buffer-hideshow 'desc-feed nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3018 (newsticker--buffer-hideshow 'desc-immortal nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3019 (newsticker--buffer-hideshow 'desc-obsolete nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3020 (newsticker--buffer-hideshow 'desc-new nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3021 (newsticker--buffer-hideshow 'desc-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3022 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3023
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3024 (defun newsticker-show-all-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3025 "Show the descriptions of feeds and all items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3026 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3027 (newsticker--buffer-hideshow 'desc-feed t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3028 (newsticker--buffer-hideshow 'desc-immortal t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3029 (newsticker--buffer-hideshow 'desc-obsolete t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3030 (newsticker--buffer-hideshow 'desc-new t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3031 (newsticker--buffer-hideshow 'desc-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3032 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3033
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3034 (defun newsticker-hide-old-items ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3035 "Hide old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3036 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3037 (newsticker--buffer-hideshow 'desc-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3038 (newsticker--buffer-hideshow 'item-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3039 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3040
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3041 (defun newsticker-show-old-items ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3042 "Show old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3043 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3044 (newsticker--buffer-hideshow 'item-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3045 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3046
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3047 (defun newsticker-hide-entry ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3048 "Hide description of entry at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3049 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3050 (save-excursion
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
3051 (let* (pos1 pos2
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3052 (inhibit-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3053 inv-prop org-inv-prop
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3054 is-invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3055 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3056 (newsticker--buffer-goto '(desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3057 (setq pos1 (max (point-min) (1- (point))))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3058 (newsticker--buffer-goto '(extra feed item nil))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3059 (setq pos2 (max (point-min) (1- (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3060 (setq inv-prop (get-text-property pos1 'invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3061 (setq org-inv-prop (get-text-property pos1 'org-invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3062 (cond ((eq inv-prop t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3063 ;; do nothing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3064 )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3065 ((eq org-inv-prop nil)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3066 (add-text-properties pos1 pos2
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3067 (list 'invisible (list t)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3068 'org-invisible inv-prop)))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3069 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3070 ;; toggle
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3071 (add-text-properties pos1 pos2
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3072 (list 'invisible org-inv-prop))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3073 (remove-text-properties pos1 pos2 '(org-invisible))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3074 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3075
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3076 (defun newsticker-show-entry ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3077 "Show description of entry at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3078 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3079 (save-excursion
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
3080 (let* (pos1 pos2
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3081 (inhibit-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3082 inv-prop org-inv-prop
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3083 is-invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3084 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3085 (newsticker--buffer-goto '(desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3086 (setq pos1 (max (point-min) (1- (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3087 (newsticker--buffer-goto '(extra feed item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3088 (setq pos2 (max (point-min) (1- (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3089 (setq inv-prop (get-text-property pos1 'invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3090 (setq org-inv-prop (get-text-property pos1 'org-invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3091 (cond ((eq org-inv-prop nil)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3092 (add-text-properties pos1 pos2
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3093 (list 'invisible nil
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3094 'org-invisible inv-prop)))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3095 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3096 ;; toggle
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3097 (add-text-properties pos1 pos2
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3098 (list 'invisible org-inv-prop))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3099 (remove-text-properties pos1 pos2 '(org-invisible))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3100 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3101
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3102 (defun newsticker-toggle-auto-narrow-to-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3103 "Toggle narrowing to current news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3104 If auto-narrowing is active, only news item of the current feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3105 are visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3106 (interactive)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3107 (newsticker-set-auto-narrow-to-feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3108 (not newsticker--auto-narrow-to-feed)))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3109
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3110 (defun newsticker-set-auto-narrow-to-feed (value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3111 "Turn narrowing to current news feed on or off.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3112 If VALUE is nil, auto-narrowing is turned off, otherwise it is turned on."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3113 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3114 (setq newsticker--auto-narrow-to-item nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3115 (setq newsticker--auto-narrow-to-feed value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3116 (widen)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3117 (newsticker--buffer-make-item-completely-visible)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3118 (run-hooks 'newsticker-narrow-hook))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3119
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3120 (defun newsticker-toggle-auto-narrow-to-item ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3121 "Toggle narrowing to current news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3122 If auto-narrowing is active, only one item of the current feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3123 is visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3124 (interactive)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3125 (newsticker-set-auto-narrow-to-item
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3126 (not newsticker--auto-narrow-to-item)))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3127
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3128 (defun newsticker-set-auto-narrow-to-item (value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3129 "Turn narrowing to current news item on or off.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3130 If VALUE is nil, auto-narrowing is turned off, otherwise it is turned on."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3131 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3132 (setq newsticker--auto-narrow-to-feed nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3133 (setq newsticker--auto-narrow-to-item value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3134 (widen)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3135 (newsticker--buffer-make-item-completely-visible)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3136 (run-hooks 'newsticker-narrow-hook))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3137
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3138 (defun newsticker-customize ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3139 "Open the newsticker customization group."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3140 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3141 (customize-group "newsticker"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3142
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3143 (defun newsticker-next-feed-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3144 "Return t if position is before last feed, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3145 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3146 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3147 (newsticker--buffer-goto '(feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3148 (not (= p (point))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3149
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3150 (defun newsticker-previous-feed-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3151 "Return t if position is behind first feed, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3152 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3153 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3154 (newsticker--buffer-goto '(feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3155 (not (= p (point))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3156
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3157 (defun newsticker-next-item-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3158 "Return t if position is before last feed, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3159 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3160 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3161 (while (< (point) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3162 (unless (newsticker--buffer-goto '(item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3163 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3164 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3165 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3166 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3167 (throw 'result t))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3168
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3169 (defun newsticker-previous-item-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3170 "Return t if position is behind first item, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3171 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3172 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3173 (while (> (point) (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3174 (unless (newsticker--buffer-goto '(item) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3175 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3176 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3177 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3178 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3179 (throw 'result t))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3180
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3181 (defun newsticker-item-not-old-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3182 "Return t if there is an item at point which is not old, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3183 (when (get-text-property (point) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3184 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3185 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3186 (let ((age (get-text-property (point) 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3187 (and (memq age '(new immortal obsolete)) t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3188
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3189 (defun newsticker-item-not-immortal-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3190 "Return t if there is an item at point which is not immortal, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3191 (when (get-text-property (point) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3192 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3193 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3194 (let ((age (get-text-property (point) 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3195 (and (memq age '(new old obsolete)) t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3196
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3197 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3198 ;;; local stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3199 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3200 (defun newsticker-get-news (feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3201 "Get news from the site FEED-NAME and load feed logo.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3202 FEED-NAME must be a string which occurs as the label (i.e. the first element)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3203 in an element of `newsticker-url-list' or `newsticker-url-list-defaults'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3204 (newsticker--debug-msg "%s: Getting news for %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3205 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3206 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3207 (let* ((buffername (concat " *newsticker-wget-" feed-name "*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3208 (item (or (assoc feed-name newsticker-url-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3209 (assoc feed-name newsticker-url-list-defaults)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3210 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3211 "Cannot get news for %s: Check newsticker-url-list"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3212 feed-name)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3213 (url (cadr item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3214 (wget-arguments (or (car (cdr (cdr (cdr (cdr item)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3215 newsticker-wget-arguments)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3216 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3217 (set-buffer (get-buffer-create buffername))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3218 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3219 ;; throw an error if there is an old wget-process around
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3220 (if (get-process feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3221 (error "Another wget-process is running for %s" feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3222 ;; start wget
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3223 (let* ((args (append wget-arguments (list url)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3224 (proc (apply 'start-process feed-name buffername
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3225 newsticker-wget-name args)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3226 (set-process-coding-system proc 'no-conversion 'no-conversion)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3227 (set-process-sentinel proc 'newsticker--sentinel)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3228 (setq newsticker--process-ids (cons (process-id proc)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3229 newsticker--process-ids))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3230 (force-mode-line-update)))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
3231
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3232 (defun newsticker-mouse-browse-url (event)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3233 "Call `browse-url' for the link of the item at which the EVENT occurred."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3234 (interactive "e")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3235 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3236 (switch-to-buffer (window-buffer (posn-window (event-end event))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3237 (let ((url (get-text-property (posn-point (event-end event))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3238 'nt-link)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3239 (when url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3240 (browse-url url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3241 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3242 (goto-char (posn-point (event-end event)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3243 (if newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3244 (newsticker-mark-item-at-point-as-read t)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3245
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3246 (defun newsticker-browse-url ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3247 "Call `browse-url' for the link of the item at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3248 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3249 (let ((url (get-text-property (point) 'nt-link)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3250 (when url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3251 (browse-url url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3252 (if newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3253 (newsticker-mark-item-at-point-as-read t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3254
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3255 (defvar newsticker-open-url-history
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3256 '("wget" "xmms" "realplay")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3257 "...")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3258
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3259 (defun newsticker-handle-url ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3260 "Ask for a program to open the link of the item at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3261 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3262 (let ((url (get-text-property (point) 'nt-link)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3263 (when url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3264 (let ((prog (read-string "Open url with: " nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3265 'newsticker-open-url-history)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3266 (when prog
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3267 (message "%s %s" prog url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3268 (start-process prog prog prog url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3269 (if newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3270 (newsticker-mark-item-at-point-as-read t)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3271
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3272 (defun newsticker--sentinel (process event)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3273 "Sentinel for extracting news titles from an RDF buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3274 Argument PROCESS is the process which has just changed its state.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3275 Argument EVENT tells what has happened to the process."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3276 (let* ((p-status (process-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3277 (exit-status (process-exit-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3278 (time (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3279 (name (process-name process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3280 (name-symbol (intern name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3281 (something-was-added nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3282 ;; catch known errors (zombie processes, rubbish-xml etc.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3283 ;; if an error occurs the news feed is not updated!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3284 (catch 'oops
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3285 (unless (and (eq p-status 'exit)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3286 (= exit-status 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3287 (setq newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3288 (newsticker--cache-add
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3289 newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3290 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3291 newsticker--error-headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3292 (format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3293 (concat "%s: Newsticker could not retrieve news from %s.\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3294 "Return status: `%s'\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3295 "Command was `%s'")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3296 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3297 name event (process-command process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3298 ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3299 (current-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3300 'new
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3301 0 nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3302 (message "%s: Error while retrieving news from %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3303 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3304 (process-name process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3305 (throw 'oops nil))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3306 (let* ((coding-system 'utf-8)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3307 (node-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3308 (save-current-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3309 (set-buffer (process-buffer process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3310 ;; a very very dirty workaround to overcome the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3311 ;; problems with the newest (20030621) xml.el:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3312 ;; remove all unnecessary whitespace
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3313 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3314 (while (re-search-forward ">[ \t\r\n]+<" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3315 (replace-match "><" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3316 ;; and another brutal workaround (20031105)! For some
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3317 ;; reason the xml parser does not like the colon in the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3318 ;; doctype name "rdf:RDF"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3319 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3320 (if (re-search-forward "<!DOCTYPE[ \t\n]+rdf:RDF" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3321 (replace-match "<!DOCTYPE rdfColonRDF" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3322 ;; finally.... ~##^°!!!!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3323 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3324 (while (search-forward "\r\n" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3325 (replace-match "\n" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3326 ;; still more brutal workarounds (20040309)! The xml
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3327 ;; parser does not like doctype rss
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3328 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3329 (if (re-search-forward "<!DOCTYPE[ \t\n]+rss[ \t\n]*>" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3330 (replace-match "" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3331 ;; And another one (20050618)! (Fixed in GNU Emacs 22.0.50.18)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3332 ;; Remove comments to avoid this xml-parsing bug:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3333 ;; "XML files can have only one toplevel tag"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3334 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3335 (while (search-forward "<!--" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3336 (let ((start (match-beginning 0)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3337 (unless (search-forward "-->" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3338 (error "Can't find end of comment"))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
3339 (delete-region start (point))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3340 ;; And another one (20050702)! If description is HTML
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3341 ;; encoded and starts with a `<', wrap the whole
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3342 ;; description in a CDATA expression. This happened for
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3343 ;; http://www.thefreedictionary.com/_/WoD/rss.aspx?type=quote
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3344 (goto-char (point-min))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3345 (while (re-search-forward
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3346 "<description>\\(<img.*?\\)</description>" nil t)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3347 (replace-match
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3348 "<description><![CDATA[ \\1 ]]></description>"))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3349 ;; And another one (20051123)! XML parser does not like this:
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3350 ;; <yweather:location city="Frankfurt/Main" region="" country="GM" />
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3351 ;; try to "fix" empty attributes
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3352 ;; This happened for
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3353 ;; http://xml.weather.yahoo.com/forecastrss?p=GMXX0040&u=f
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3354 (goto-char (point-min))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3355 (while (re-search-forward "\\(<[^>]*\\)=\"\"" nil t)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
3356 (replace-match "\\1=\" \""))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3357 ;;
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3358 (set-buffer-modified-p nil)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3359 ;; check coding system
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3360 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3361 (if (re-search-forward "encoding=\"\\([^\"]+\\)\""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3362 nil t)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3363 (setq coding-system (intern (downcase (match-string 1))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3364 (setq coding-system
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3365 (condition-case nil
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3366 (check-coding-system coding-system)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3367 (coding-system-error
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3368 (message
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3369 "newsticker.el: ignoring coding system %s for %s"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3370 coding-system name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3371 nil))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3372 ;; Decode if possible
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3373 (when coding-system
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3374 (decode-coding-region (point-min) (point-max)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3375 coding-system))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3376 (condition-case errordata
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3377 ;; The xml parser might fail
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3378 ;; or the xml might be bugged
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3379 (xml-parse-region (point-min) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3380 (error (message "Could not parse %s: %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3381 (buffer-name) (cadr errordata))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3382 (throw 'oops nil)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3383 (topnode (car node-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3384 (channelnode (car (xml-get-children topnode 'channel)))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3385 (imageurl nil))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3386 ;; mark all items as obsolete
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3387 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3388 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3389 'new 'obsolete-new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3390 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3391 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3392 'old 'obsolete-old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3393 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3394 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3395 'feed 'obsolete-old)
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
3396
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3397 ;; check Atom/RSS version and call corresponding parser
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3398 (condition-case error-data
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3399 (if (cond
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3400 ;; RSS 0.91
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3401 ((and (eq 'rss (xml-node-name topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3402 (string= "0.91" (xml-get-attribute topnode 'version)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3403 (setq imageurl (newsticker--get-logo-url-rss-0.91 topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3404 (newsticker--parse-rss-0.91 name time topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3405 ;; RSS 0.92
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3406 ((and (eq 'rss (xml-node-name topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3407 (string= "0.92" (xml-get-attribute topnode 'version)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3408 (setq imageurl (newsticker--get-logo-url-rss-0.92 topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3409 (newsticker--parse-rss-0.92 name time topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3410 ;; RSS 1.0
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3411 ((eq 'rdf:RDF (xml-node-name topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3412 (setq imageurl (newsticker--get-logo-url-rss-1.0 topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3413 (newsticker--parse-rss-1.0 name time topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3414 ;; RSS 2.0
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3415 ((and (eq 'rss (xml-node-name topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3416 (string= "2.0" (xml-get-attribute topnode 'version)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3417 (setq imageurl (newsticker--get-logo-url-rss-2.0 topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3418 (newsticker--parse-rss-2.0 name time topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3419 ;; Atom 0.3
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3420 ((and (eq 'feed (xml-node-name topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3421 (string= "http://purl.org/atom/ns#"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3422 (xml-get-attribute topnode 'xmlns)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3423 (setq imageurl (newsticker--get-logo-url-atom-0.3 topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3424 (newsticker--parse-atom-0.3 name time topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3425 ;; Atom 1.0
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3426 ((and (eq 'feed (xml-node-name topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3427 (string= "http://www.w3.org/2005/Atom"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3428 (xml-get-attribute topnode 'xmlns)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3429 (setq imageurl (newsticker--get-logo-url-atom-1.0 topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3430 (newsticker--parse-atom-1.0 name time topnode))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3431 ;; unknown feed type
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3432 (t
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3433 (newsticker--debug-msg "Feed type unknown: %s: %s"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3434 (xml-node-name topnode) name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3435 nil))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3436 (setq something-was-added t))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3437 (xerror (message "sentinelerror in %s: %s" name error-data)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3438
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3439 ;; Remove those old items from cache which have been removed from
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3440 ;; the feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3441 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3442 name-symbol 'obsolete-old 'deleteme)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3443 (newsticker--cache-remove newsticker--cache name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3444 'deleteme)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3445 ;; Remove those new items from cache which have been removed from
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3446 ;; the feed. Or keep them as `obsolete'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3447 (if (not newsticker-keep-obsolete-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3448 (newsticker--cache-remove newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3449 name-symbol 'obsolete-new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3450 (setq newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3451 (newsticker--cache-mark-expired
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3452 newsticker--cache name-symbol 'obsolete 'obsolete-expired
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3453 newsticker-obsolete-item-max-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3454 (newsticker--cache-remove newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3455 name-symbol 'obsolete-expired)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3456 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3457 name-symbol 'obsolete-new
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3458 'obsolete))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3459 (newsticker--update-process-ids)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3460 ;; setup scrollable text
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3461 (when (= 0 (length newsticker--process-ids))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3462 (newsticker--ticker-text-setup))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3463 (setq newsticker--latest-update-time (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3464 (when something-was-added
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3465 ;; FIXME: should we care about removed items as well?
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3466 (newsticker--cache-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3467 (newsticker--buffer-set-uptodate nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3468 ;; kill the process buffer if wanted
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3469 (unless newsticker-debug
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3470 (kill-buffer (process-buffer process)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3471 ;; launch retrieval of image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3472 (when (and imageurl
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3473 (string-match "%l" newsticker-heading-format))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3474 (newsticker--image-get name imageurl))))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
3475
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3476 (defun newsticker--get-logo-url-atom-1.0 (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3477 "Return logo URL from atom 1.0 data in NODE."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3478 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3479 (car (xml-get-children node 'logo)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3480
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3481 (defun newsticker--get-logo-url-atom-0.3 (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3482 "Return logo URL from atom 0.3 data in NODE."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3483 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3484 (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3485
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3486 (defun newsticker--get-logo-url-rss-2.0 (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3487 "Return logo URL from RSS 2.0 data in NODE."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3488 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3489 (car (xml-get-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3490 (car (xml-get-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3491 (car (xml-get-children node 'channel)) 'image)) 'url)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3492
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3493 (defun newsticker--get-logo-url-rss-1.0 (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3494 "Return logo URL from RSS 1.0 data in NODE."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3495 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3496 (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3497
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3498 (defun newsticker--get-logo-url-rss-0.92 (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3499 "Return logo URL from RSS 0.92 data in NODE."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3500 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3501 (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3502
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3503 (defun newsticker--get-logo-url-rss-0.91 (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3504 "Return logo URL from RSS 0.91 data in NODE."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3505 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3506 (car (xml-get-children (car (xml-get-children node 'image)) 'url)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3507
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3508 (defun newsticker--parse-atom-0.3 (name time topnode)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3509 "Parse Atom 0.3 data.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3510 Return value as well as arguments NAME, TIME, and TOPNODE are the
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
3511 same as in `newsticker--parse-atom-1.0'."
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3512 (newsticker--debug-msg "Parsing Atom 0.3 feed %s" name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3513 (let (new-feed new-item)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3514 (setq new-feed (newsticker--parse-generic-feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3515 name time
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3516 ;; title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3517 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3518 (car (xml-get-children topnode 'title))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3519 ;; desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3520 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3521 (car (xml-get-children topnode 'content))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3522 ;; link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3523 (xml-get-attribute
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3524 (car (xml-get-children topnode 'link)) 'href)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3525 ;; extra-elements
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3526 (xml-node-children topnode)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3527 (setq new-item (newsticker--parse-generic-items
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3528 name time (xml-get-children topnode 'entry)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3529 ;; title-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3530 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3531 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3532 (car (xml-get-children node 'title)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3533 ;; desc-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3534 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3535 (or (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3536 (car (xml-get-children node 'content))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3537 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3538 (car (xml-get-children node 'summary))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3539 ;; link-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3540 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3541 (xml-get-attribute
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3542 (car (xml-get-children node 'link)) 'href))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3543 ;; time-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3544 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3545 (newsticker--decode-rfc822-date
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3546 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3547 (car (xml-get-children node 'modified))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3548 ;; guid-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3549 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3550 (let ((tguid (assoc 'guid (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3551 (if (stringp tguid)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3552 tguid
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3553 (car (xml-node-children tguid)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3554 ;; extra-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3555 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3556 (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3557 (or new-item new-feed)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3558
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3559 (defun newsticker--parse-atom-1.0 (name time topnode)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3560 "Parse Atom 1.0 data.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3561 Argument NAME gives the name of a news feed. TIME gives the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3562 system time at which the data have been retrieved. TOPNODE
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3563 contains the feed data as returned by the xml parser.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3564
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3565 For the Atom 1.0 specification see
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3566 http://www.atompub.org/2005/08/17/draft-ietf-atompub-format-11.html"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3567 (newsticker--debug-msg "Parsing Atom 1.0 feed %s" name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3568 (let (new-feed new-item)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3569 (setq new-feed (newsticker--parse-generic-feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3570 name time
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3571 ;; title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3572 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3573 (car (xml-get-children topnode 'title))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3574 ;; desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3575 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3576 (car (xml-get-children topnode 'subtitle))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3577 ;; link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3578 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3579 (car (xml-get-children topnode 'link))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3580 ;; extra-elements
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3581 (xml-node-children topnode)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3582 (setq new-item (newsticker--parse-generic-items
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3583 name time (xml-get-children topnode 'entry)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3584 ;; title-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3585 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3586 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3587 (car (xml-get-children node 'title)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3588 ;; desc-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3589 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3590 (or (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3591 (car (xml-get-children node 'content))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3592 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3593 (car (xml-get-children node 'summary))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3594 ;; link-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3595 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3596 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3597 (car (xml-get-children node 'link)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3598 ;; time-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3599 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3600 (newsticker--decode-iso8601-date
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3601 (or (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3602 (car (xml-get-children node 'updated))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3603 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3604 (car (xml-get-children node 'published)))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3605 ;; guid-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3606 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3607 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3608 (car (xml-get-children node 'id)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3609 ;; extra-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3610 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3611 (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3612 (or new-item new-feed)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3613
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3614 (defun newsticker--parse-rss-0.91 (name time topnode)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3615 "Parse RSS 0.91 data.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3616 Return value as well as arguments NAME, TIME, and TOPNODE are the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3617 same as in `newsticker--parse-atom-1.0'.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3618
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3619 For the RSS 0.91 specification see http://backend.userland.com/rss091 or
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3620 http://my.netscape.com/publish/formats/rss-spec-0.91.html."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3621 (newsticker--debug-msg "Parsing RSS 0.91 feed %s" name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3622 (let* ((channelnode (car (xml-get-children topnode 'channel)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3623 (pub-date (newsticker--decode-rfc822-date
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3624 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3625 (car (xml-get-children channelnode 'pubDate))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3626 is-new-feed has-new-items)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3627 (setq is-new-feed (newsticker--parse-generic-feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3628 name time
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3629 ;; title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3630 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3631 (car (xml-get-children channelnode 'title))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3632 ;; desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3633 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3634 (car (xml-get-children channelnode
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3635 'description))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3636 ;; link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3637 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3638 (car (xml-get-children channelnode 'link))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3639 ;; extra-elements
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3640 (xml-node-children channelnode)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3641 (setq has-new-items (newsticker--parse-generic-items
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3642 name time (xml-get-children channelnode 'item)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3643 ;; title-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3644 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3645 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3646 (car (xml-get-children node 'title)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3647 ;; desc-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3648 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3649 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3650 (car (xml-get-children node 'description)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3651 ;; link-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3652 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3653 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3654 (car (xml-get-children node 'link)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3655 ;; time-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3656 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3657 pub-date)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3658 ;; guid-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3659 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3660 nil)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3661 ;; extra-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3662 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3663 (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3664 (or has-new-items is-new-feed)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3665
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3666 (defun newsticker--parse-rss-0.92 (name time topnode)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3667 "Parse RSS 0.92 data.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3668 Return value as well as arguments NAME, TIME, and TOPNODE are the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3669 same as in `newsticker--parse-atom-1.0'.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3670
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3671 For the RSS 0.92 specification see http://backend.userland.com/rss092."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3672 (newsticker--debug-msg "Parsing RSS 0.92 feed %s" name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3673 (let* ((channelnode (car (xml-get-children topnode 'channel)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3674 (pub-date (newsticker--decode-rfc822-date
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3675 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3676 (car (xml-get-children channelnode 'pubDate))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3677 is-new-feed has-new-items)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3678 (setq is-new-feed (newsticker--parse-generic-feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3679 name time
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3680 ;; title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3681 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3682 (car (xml-get-children channelnode 'title))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3683 ;; desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3684 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3685 (car (xml-get-children channelnode
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3686 'description))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3687 ;; link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3688 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3689 (car (xml-get-children channelnode 'link))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3690 ;; extra-elements
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3691 (xml-node-children channelnode)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3692 (setq has-new-items (newsticker--parse-generic-items
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3693 name time (xml-get-children channelnode 'item)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3694 ;; title-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3695 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3696 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3697 (car (xml-get-children node 'title)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3698 ;; desc-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3699 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3700 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3701 (car (xml-get-children node 'description)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3702 ;; link-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3703 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3704 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3705 (car (xml-get-children node 'link)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3706 ;; time-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3707 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3708 pub-date)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3709 ;; guid-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3710 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3711 nil)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3712 ;; extra-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3713 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3714 (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3715 (or has-new-items is-new-feed)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3716
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3717 (defun newsticker--parse-rss-1.0 (name time topnode)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3718 "Parse RSS 1.0 data.
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
3719 Return value as well as arguments NAME, TIME, and TOPNODE are the
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
3720 same as in `newsticker--parse-atom-1.0'.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3721
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3722 For the RSS 1.0 specification see http://web.resource.org/rss/1.0/spec."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3723 (newsticker--debug-msg "Parsing RSS 1.0 feed %s" name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3724 (let* ((channelnode (car (xml-get-children topnode 'channel)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3725 is-new-feed has-new-items)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3726 (setq is-new-feed (newsticker--parse-generic-feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3727 name time
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3728 ;; title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3729 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3730 (car (xml-get-children channelnode 'title))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3731 ;; desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3732 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3733 (car (xml-get-children channelnode
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3734 'description))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3735 ;; link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3736 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3737 (car (xml-get-children channelnode 'link))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3738 ;; extra-elements
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3739 (xml-node-children channelnode)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3740 (setq has-new-items (newsticker--parse-generic-items
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3741 name time (xml-get-children topnode 'item)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3742 ;; title-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3743 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3744 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3745 (car (xml-get-children node 'title)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3746 ;; desc-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3747 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3748 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3749 (car (xml-get-children node
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3750 'description)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3751 ;; link-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3752 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3753 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3754 (car (xml-get-children node 'link)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3755 ;; time-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3756 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3757 (newsticker--decode-iso8601-date
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3758 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3759 (car (xml-get-children node 'dc:date))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3760 ;; guid-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3761 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3762 nil)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3763 ;; extra-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3764 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3765 (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3766 (or has-new-items is-new-feed)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3767
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3768 (defun newsticker--parse-rss-2.0 (name time topnode)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3769 "Parse RSS 2.0 data.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3770 Return value as well as arguments NAME, TIME, and TOPNODE are the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3771 same as in `newsticker--parse-atom-1.0'.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3772
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3773 For the RSS 2.0 specification see http://blogs.law.harvard.edu/tech/rss."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3774 (newsticker--debug-msg "Parsing RSS 2.0 feed %s" name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3775 (let* ((channelnode (car (xml-get-children topnode 'channel)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3776 is-new-feed has-new-items)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3777 (setq is-new-feed (newsticker--parse-generic-feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3778 name time
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3779 ;; title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3780 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3781 (car (xml-get-children channelnode 'title))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3782 ;; desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3783 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3784 (car (xml-get-children channelnode
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3785 'description))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3786 ;; link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3787 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3788 (car (xml-get-children channelnode 'link))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3789 ;; extra-elements
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3790 (xml-node-children channelnode)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3791 (setq has-new-items (newsticker--parse-generic-items
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3792 name time (xml-get-children channelnode 'item)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3793 ;; title-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3794 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3795 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3796 (car (xml-get-children node 'title)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3797 ;; desc-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3798 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3799 (or (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3800 (car (xml-get-children node
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3801 'content:encoded))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3802 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3803 (car (xml-get-children node
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3804 'description))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3805 ;; link-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3806 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3807 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3808 (car (xml-get-children node 'link)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3809 ;; time-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3810 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3811 (newsticker--decode-rfc822-date
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3812 (car (xml-node-children
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3813 (car (xml-get-children node 'pubDate))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3814 ;; guid-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3815 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3816 (let* ((tguid (assoc 'guid
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3817 (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3818 (if (stringp tguid)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3819 tguid
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3820 (car (xml-node-children tguid)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3821 ;; extra-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3822 (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3823 (xml-node-children node))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3824 (or has-new-items is-new-feed)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3825
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3826 (defun newsticker--parse-generic-feed (name time title desc link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3827 extra-elements)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3828 "Parse generic news feed data.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3829 Argument NAME gives the name of a news feed. TIME gives the
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
3830 system time at which the data have been retrieved.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3831
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3832 The arguments TITLE, DESC, LINK, and EXTRA-ELEMENTS give the feed's title,
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3833 description, link, and extra elements resp."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3834 (let ((title (or title "[untitled]"))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3835 (link (or link ""))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3836 (old-item nil)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3837 (position 0)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3838 (something-was-added nil))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3839 ;; decode numeric entities
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3840 (setq title (newsticker--decode-numeric-entities title))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3841 (setq desc (newsticker--decode-numeric-entities desc))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3842 (setq link (newsticker--decode-numeric-entities link))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3843 ;; remove whitespace from title, desc, and link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3844 (setq title (newsticker--remove-whitespace title))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3845 (setq desc (newsticker--remove-whitespace desc))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3846 (setq link (newsticker--remove-whitespace link))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3847
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3848 ;; handle the feed itself
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3849 (unless (newsticker--cache-contains newsticker--cache
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3850 (intern name) title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3851 desc link 'feed)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3852 (setq something-was-added t))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3853 (setq newsticker--cache
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3854 (newsticker--cache-add newsticker--cache (intern name)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3855 title desc link time 'feed position
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3856 extra-elements 'feed time))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3857 something-was-added))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3858
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3859 (defun newsticker--parse-generic-items (name time itemlist
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3860 title-fn desc-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3861 link-fn time-fn
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3862 guid-fn extra-fn)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3863 "Parse generic news feed data.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3864 Argument NAME gives the name of a news feed. TIME gives the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3865 system time at which the data have been retrieved. ITEMLIST
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3866 contains the news items returned by the xml parser.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3867
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3868 The arguments TITLE-FN, DESC-FN, LINK-FN, TIME-FN, GUID-FN, and
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3869 EXTRA-FN give functions for extracting title, description, link,
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3870 time, guid, and extra-elements resp. They are called with one
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3871 argument, which is one of the items in ITEMLIST."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3872 (let (title desc link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3873 (old-item nil)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3874 (position 0)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3875 (something-was-added nil))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3876 ;; gather all items for this feed
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3877 (mapc (lambda (node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3878 (setq position (1+ position))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3879 (setq title (or (funcall title-fn node) "[untitled]"))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3880 (setq desc (funcall desc-fn node))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3881 (setq link (or (funcall link-fn node) ""))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3882 (setq time (or (funcall time-fn node) time))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3883 ;; It happened that the title or description
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3884 ;; contained evil HTML code that confused the
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3885 ;; xml parser. Therefore:
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3886 (unless (stringp title)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3887 (setq title (prin1-to-string title)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3888 (unless (or (stringp desc) (not desc))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3889 (setq desc (prin1-to-string desc)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3890 ;; ignore items with empty title AND empty desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3891 (when (or (> (length title) 0)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3892 (> (length desc) 0))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3893 ;; decode numeric entities
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3894 (setq title (newsticker--decode-numeric-entities title))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3895 (when desc
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3896 (setq desc (newsticker--decode-numeric-entities desc)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3897 (setq link (newsticker--decode-numeric-entities link))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3898 ;; remove whitespace from title, desc, and link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3899 (setq title (newsticker--remove-whitespace title))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3900 (setq desc (newsticker--remove-whitespace desc))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3901 (setq link (newsticker--remove-whitespace link))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3902 ;; add data to cache
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3903 ;; do we have this item already?
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3904 (let* ((guid (funcall guid-fn node)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3905 ;;(message "guid=%s" guid)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3906 (setq old-item
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3907 (newsticker--cache-contains newsticker--cache
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3908 (intern name) title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3909 desc link nil guid)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3910 ;; add this item, or mark it as old, or do nothing
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3911 (let ((age1 'new)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3912 (age2 'old)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3913 (item-new-p nil))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3914 (if old-item
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3915 (let ((prev-age (newsticker--age old-item)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3916 (unless
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3917 newsticker-automatically-mark-items-as-old
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3918 (if (eq prev-age 'obsolete-old)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3919 (setq age2 'old)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3920 (setq age2 'new)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3921 (if (eq prev-age 'immortal)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3922 (setq age2 'immortal)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3923 ;; item was not there
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3924 (setq item-new-p t)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3925 (setq something-was-added t))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3926 (setq newsticker--cache
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3927 (newsticker--cache-add
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3928 newsticker--cache (intern name) title desc link
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3929 time age1 position (funcall extra-fn node)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3930 age2))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3931 (when item-new-p
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3932 (let ((item (newsticker--cache-contains
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3933 newsticker--cache (intern name) title
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3934 desc link nil)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3935 (if newsticker-auto-mark-filter-list
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3936 (newsticker--run-auto-mark-filter name item))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3937 (run-hook-with-args
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3938 'newsticker-new-item-functions name item))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3939 itemlist)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3940 something-was-added))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
3941
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3942 (defun newsticker--display-tick ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3943 "Called from the display timer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3944 This function calls a display function, according to the variable
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3945 `newsticker-scroll-smoothly'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3946 (if newsticker-scroll-smoothly
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3947 (newsticker--display-scroll)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3948 (newsticker--display-jump)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3949
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3950 (defsubst newsticker--echo-area-clean-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3951 "Check whether somebody is using the echo area / minibuffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3952 Return t if echo area and minibuffer are unused."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3953 (not (or (active-minibuffer-window)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3954 (and (current-message)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3955 (not (string= (current-message)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3956 newsticker--prev-message))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3957
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3958 (defun newsticker--display-jump ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3959 "Called from the display timer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3960 This function displays the next ticker item in the echo area, unless
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3961 there is another message displayed or the minibuffer is active."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3962 (let ((message-log-max nil));; prevents message text from being logged
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3963 (when (newsticker--echo-area-clean-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3964 (setq newsticker--item-position (1+ newsticker--item-position))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3965 (when (>= newsticker--item-position (length newsticker--item-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3966 (setq newsticker--item-position 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3967 (setq newsticker--prev-message
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3968 (nth newsticker--item-position newsticker--item-list))
65586
86bece058ee5 Message format fixes (commit no. 5)
Deepak Goel <deego@gnufans.org>
parents: 65490
diff changeset
3969 (message "%s" newsticker--prev-message))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3970
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3971 (defun newsticker--display-scroll ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3972 "Called from the display timer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3973 This function scrolls the ticker items in the echo area, unless
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3974 there is another message displayed or the minibuffer is active."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3975 (when (newsticker--echo-area-clean-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3976 (let* ((width (- (frame-width) 1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3977 (message-log-max nil);; prevents message text from being logged
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3978 (i newsticker--item-position)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3979 subtext
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3980 (s-text newsticker--scrollable-text)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3981 (l (length s-text)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3982 ;; don't show anything if there is nothing to show
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3983 (unless (< (length s-text) 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3984 ;; repeat the ticker string if it is shorter than frame width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3985 (while (< (length s-text) width)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3986 (setq s-text (concat s-text s-text)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3987 ;; get the width of the printed string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3988 (setq l (length s-text))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3989 (cond ((< i (- l width))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3990 (setq subtext (substring s-text i (+ i width))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3991 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3992 (setq subtext (concat
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3993 (substring s-text i l)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3994 (substring s-text 0 (- width (- l i)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3995 ;; Take care of multibyte strings, for which (string-width) is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3996 ;; larger than (length).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3997 ;; Actually, such strings may be smaller than (frame-width)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3998 ;; because return values of (string-width) are too large:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3999 ;; (string-width "<japanese character>") => 2
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4000 (let ((t-width (1- (length subtext))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4001 (while (> (string-width subtext) width)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4002 (setq subtext (substring subtext 0 t-width))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4003 (setq t-width (1- t-width))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4004 ;; show the ticker text and save current position
65586
86bece058ee5 Message format fixes (commit no. 5)
Deepak Goel <deego@gnufans.org>
parents: 65490
diff changeset
4005 (message "%s" subtext)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4006 (setq newsticker--prev-message subtext)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4007 (setq newsticker--item-position (1+ i))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4008 (when (>= newsticker--item-position l)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4009 (setq newsticker--item-position 0))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4010
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4011 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4012 ;;; misc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4013 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4014 (defun newsticker--decode-numeric-entities (string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4015 "Decode SGML numeric entities by their respective utf characters.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4016 This function replaces numeric entities in the input STRING and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4017 returns the modified string. For example \"&#42;\" gets replaced
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4018 by \"*\"."
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4019 (if (and string (stringp string))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4020 (let ((start 0))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4021 (while (string-match "&#\\([0-9]+\\);" string start)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4022 (condition-case nil
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4023 (setq string (replace-match
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4024 (string (read (substring string
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4025 (match-beginning 1)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4026 (match-end 1))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4027 nil nil string))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4028 (error nil))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4029 (setq start (1+ (match-beginning 0))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4030 string)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4031 nil))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4032
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4033 (defun newsticker--remove-whitespace (string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4034 "Remove leading and trailing whitespace from STRING."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4035 ;; we must have ...+ but not ...* in the regexps otherwise xemacs loops
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4036 ;; endlessly...
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4037 (when (and string (stringp string))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4038 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4039 "[ \t\r\n]+$" ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4040 (replace-regexp-in-string "^[ \t\r\n]+" "" string))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4041
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4042 (defun newsticker--do-forget-preformatted (item)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4043 "Forget pre-formatted data for ITEM.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4044 Remove the pre-formatted from `newsticker--cache'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4045 (if (nthcdr 7 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4046 (setcar (nthcdr 7 item) nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4047 (if (nthcdr 6 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4048 (setcar (nthcdr 6 item) nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4049
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4050 (defun newsticker--forget-preformatted ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4051 "Forget all cached pre-formatted data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4052 Remove the pre-formatted from `newsticker--cache'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4053 (mapc (lambda (feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4054 (mapc 'newsticker--do-forget-preformatted
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4055 (cdr feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4056 newsticker--cache)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4057 (newsticker--buffer-set-uptodate nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4058
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4059 (defun newsticker--debug-msg (string &rest args)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4060 "Print newsticker debug messages.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4061 This function calls `message' with arguments STRING and ARGS, if
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4062 `newsticker-debug' is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4063 (and newsticker-debug
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4064 ;;(not (active-minibuffer-window))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4065 ;;(not (current-message))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4066 (apply 'message string args)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4067
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4068 (defun newsticker--decode-iso8601-date (iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4069 "Return ISO8601-STRING in format like `decode-time'.
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
4070 Converts from ISO-8601 to Emacs representation.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4071 Examples:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4072 2004-09-17T05:09:49+00:00
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4073 2004-09-17T05:09+00:00
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4074 2004-09-17T05:09:49
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4075 2004-09-17T05:09
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4076 2004-09-17
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4077 2004-09
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4078 2004"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4079 (if iso8601-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4080 (when (string-match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4081 (concat
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4082 "^ *\\([0-9]\\{4\\}\\)"
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4083 "\\(-\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4084 "\\(-\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4085 "\\(T"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4086 "\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4087 "\\(:\\([0-9]\\{2\\}\\)\\)?"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4088 "\\(\\([-+Z]\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)?"
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4089 "\\)?\\)?\\)? *$")
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4090 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4091 (let ((year (read (match-string 1 iso8601-string)))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4092 (month (read (or (match-string 3 iso8601-string)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4093 "1")))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4094 (day (read (or (match-string 5 iso8601-string)
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4095 "1")))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4096 (hour (read (or (match-string 7 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4097 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4098 (minute (read (or (match-string 8 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4099 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4100 ;;(second (read (or (match-string 10 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4101 ;; "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4102 (sign (match-string 12 iso8601-string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4103 (offset-hour (read (or (match-string 14 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4104 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4105 (offset-minute (read (or (match-string 15 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4106 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4107 (second 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4108 (cond ((string= sign "+")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4109 (setq hour (- hour offset-hour))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4110 (setq minute (- minute offset-minute)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4111 ((string= sign "-")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4112 (setq hour (+ hour offset-hour))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4113 (setq minute (+ minute offset-minute))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4114 ;; if UTC subtract current-time-zone offset
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4115 ;;(setq second (+ (car (current-time-zone)) second)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4116
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4117 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4118 (encode-time second minute hour day month year t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4119 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4120 (message "Cannot decode \"%s\"" iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4121 nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4122 nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4123
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4124 (defun newsticker--decode-rfc822-date (rfc822-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4125 "Return RFC822-STRING in format like `decode-time'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4126 Converts from RFC822 to Emacs representation.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4127 Examples:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4128 Sat, 07 Sep 2002 00:00:01 GMT
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4129 07 Sep 2002 00:00:01 GMT
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4130 07 Sep 2002"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4131 (if (and rfc822-string (stringp rfc822-string))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4132 (when (string-match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4133 (concat
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4134 "\\s-*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4135 ;; week day
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4136 "\\(\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\)\\s-*,?\\)?\\s-*"
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4137 ;; day
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4138 "\\([0-9]\\{1,2\\}\\)\\s-+"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4139 ;; month
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4140 "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4141 "Sep\\|Oct\\|Nov\\|Dec\\)\\s-+"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4142 ;; year
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4143 "\\([0-9]\\{2,4\\}\\)"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4144 ;; time may be missing
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4145 "\\(\\s-+"
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4146 ;; hour
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4147 "\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4148 ;; minute
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4149 ":\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4150 ;; second
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4151 "\\(:\\([0-9]\\{2\\}\\)\\)?"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4152 ;; zone -- fixme
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4153 "\\(\\s-+.*\\)?"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4154 "\\)?")
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4155 rfc822-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4156 (let ((day (read (match-string 3 rfc822-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4157 (month-name (match-string 4 rfc822-string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4158 (month 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4159 (year (read (match-string 5 rfc822-string)))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4160 (hour (read (or (match-string 7 rfc822-string) "0")))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4161 (minute (read (or (match-string 8 rfc822-string) "0")))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4162 (second (read (or (match-string 10 rfc822-string) "0")))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4163 ;;(zone (match-string 11 rfc822-string))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4164 )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4165 (condition-case error-data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4166 (let ((i 1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4167 (mapc (lambda (m)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4168 (if (string= month-name m)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4169 (setq month i))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4170 (setq i (1+ i)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4171 '("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4172 "Sep" "Oct" "Nov" "Dec"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4173 (encode-time second minute hour day month year t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4174 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4175 (message "Cannot decode \"%s\": %s %s" rfc822-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4176 (car error-data) (cdr error-data))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4177 nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4178 nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4179
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4180 (defun newsticker--lists-intersect-p (list1 list2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4181 "Return t if LIST1 and LIST2 share elements."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4182 (let ((result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4183 (mapc (lambda (elt)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4184 (if (memq elt list2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4185 (setq result t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4186 list1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4187 result))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4188
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4189 (defun newsticker--update-process-ids ()
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4190 "Update list of ids of active newsticker processes.
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4191 Checks list of active processes against list of newsticker processes."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4192 (let ((active-procs (process-list))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4193 (new-list nil))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4194 (mapc (lambda (proc)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4195 (let ((id (process-id proc)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4196 (if (memq id newsticker--process-ids)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4197 (setq new-list (cons id new-list)))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4198 active-procs)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4199 (setq newsticker--process-ids new-list))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4200 (force-mode-line-update))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4201
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4202 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4203 ;;; images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4204 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4205 (defun newsticker--image-get (feed-name url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4206 "Get image of the news site FEED-NAME from URL.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4207 If the image has been downloaded in the last 24h do nothing."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4208 (let ((image-name (concat newsticker-imagecache-dirname "/"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4209 feed-name)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4210 (if (and (file-exists-p image-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4211 (time-less-p (current-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4212 (time-add (nth 5 (file-attributes image-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4213 (seconds-to-time 86400))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4214 (newsticker--debug-msg "%s: Getting image for %s skipped"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4215 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4216 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4217 ;; download
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4218 (newsticker--debug-msg "%s: Getting image for %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4219 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4220 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4221 (let* ((buffername (concat " *newsticker-wget-image-" feed-name "*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4222 (item (or (assoc feed-name newsticker-url-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4223 (assoc feed-name newsticker-url-list-defaults)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4224 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4225 "Cannot get news for %s: Check newsticker-url-list"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4226 feed-name)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4227 (wget-arguments (or (car (cdr (cdr (cdr (cdr item)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4228 newsticker-wget-arguments)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4229 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4230 (set-buffer (get-buffer-create buffername))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4231 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4232 ;; throw an error if there is an old wget-process around
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4233 (if (get-process feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4234 (error "Another wget-process is running for image %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4235 feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4236 ;; start wget
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4237 (let* ((args (append wget-arguments (list url)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4238 (proc (apply 'start-process feed-name buffername
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4239 newsticker-wget-name args)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4240 (set-process-coding-system proc 'no-conversion 'no-conversion)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4241 (set-process-sentinel proc 'newsticker--image-sentinel)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4242
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4243 (defun newsticker--image-sentinel (process event)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4244 "Sentinel for image-retrieving PROCESS caused by EVENT."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4245 (let* ((p-status (process-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4246 (exit-status (process-exit-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4247 (feed-name (process-name process)))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4248 ;; catch known errors (zombie processes, rubbish-xml, etc.)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4249 ;; if an error occurs the news feed is not updated!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4250 (catch 'oops
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4251 (unless (and (eq p-status 'exit)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4252 (= exit-status 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4253 (message "%s: Error while retrieving image from %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4254 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4255 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4256 (throw 'oops nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4257 (let (image-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4258 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4259 (set-buffer (process-buffer process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4260 (setq image-name (concat newsticker-imagecache-dirname "/"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4261 feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4262 (set-buffer-file-coding-system 'no-conversion)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4263 ;; make sure the cache dir exists
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4264 (unless (file-directory-p newsticker-imagecache-dirname)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4265 (make-directory newsticker-imagecache-dirname))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4266 ;; write and close buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4267 (let ((require-final-newline nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4268 (backup-inhibited t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4269 (coding-system-for-write 'no-conversion))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4270 (write-region nil nil image-name nil 'quiet))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4271 (set-buffer-modified-p nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4272 (kill-buffer (current-buffer)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4273
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4274 (defun newsticker--image-read (feed-name-symbol disabled)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4275 "Read the cached image for FEED-NAME-SYMBOL from disk.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4276 If DISABLED is non-nil the image will be converted to a disabled look
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4277 \(unless `newsticker-enable-logo-manipulations' is not t\).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4278 Return the image."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4279 (let ((image-name (concat newsticker-imagecache-dirname "/"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4280 (symbol-name feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4281 (img nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4282 (when (file-exists-p image-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4283 (condition-case error-data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4284 (setq img (create-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4285 image-name nil nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4286 :conversion (and newsticker-enable-logo-manipulations
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4287 disabled
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4288 'disabled)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4289 :mask (and newsticker-enable-logo-manipulations
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4290 'heuristic)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4291 :ascent 70))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4292 (error
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4293 (message "Error: cannot create image for %s: %s"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4294 feed-name-symbol error-data))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4295 img))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4296
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4297 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4298 ;;; imenu stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4299 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4300 (defun newsticker--imenu-create-index ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4301 "Scan newsticker buffer and return an index for imenu."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4302 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4303 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4304 (let ((index-alist nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4305 (feed-list nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4306 (go-ahead t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4307 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4308 (let ((type (get-text-property (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4309 (title (get-text-property (point) 'nt-title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4310 (cond ((eq type 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4311 ;; we're on a feed heading
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4312 (when feed-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4313 (if index-alist
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4314 (nconc index-alist (list feed-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4315 (setq index-alist (list feed-list))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4316 (setq feed-list (list title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4317 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4318 (nconc feed-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4319 (list (cons title (point)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4320 (setq go-ahead (newsticker--buffer-goto '(item feed))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4321 (if index-alist
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4322 (nconc index-alist (list feed-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4323 (setq index-alist (list feed-list)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4324 index-alist)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4325
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4326 (defun newsticker--imenu-goto (name pos &rest args)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4327 "Go to item NAME at position POS and show item.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4328 ARGS are ignored."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4329 (goto-char pos)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4330 ;; show headline
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4331 (newsticker--buffer-goto '(desc extra feed item))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4332 (let* ((inhibit-read-only t)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4333 (pos1 (max (point-min) (1- pos)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4334 (pos2 (max pos1 (1- (point))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4335 (inv-prop (get-text-property pos 'invisible))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4336 (org-inv-prop (get-text-property pos 'org-invisible)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4337 (when (eq org-inv-prop nil)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4338 (add-text-properties pos1 pos2 (list 'invisible nil
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4339 'org-invisible inv-prop))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4340 ;; show desc
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4341 (newsticker-show-entry))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4342
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4343 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4344 ;;; buffer stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4345 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4346 (defun newsticker--buffer-set-uptodate (value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4347 "Set the uptodate-status of the newsticker buffer to VALUE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4348 The mode-line is changed accordingly."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4349 (setq newsticker--buffer-uptodate-p value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4350 (let ((b (get-buffer "*newsticker*")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4351 (when b
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4352 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4353 (set-buffer b)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4354 (if value
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4355 (setq mode-name "Newsticker -- up to date -- ")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4356 (setq mode-name "Newsticker -- NEED UPDATE -- ")))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4357 (force-mode-line-update 0))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4358
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4359 (defun newsticker--buffer-redraw ()
75646
56945fba998d (newsticker--insert-image): Update docstring. Insert the image directly.
Chong Yidong <cyd@stupidchicken.com>
parents: 75606
diff changeset
4360 "Redraw the newsticker window."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4361 (if (fboundp 'force-window-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4362 (force-window-update (current-buffer))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4363 (redraw-frame (selected-frame)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4364 (run-hooks 'newsticker-buffer-change-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4365 (sit-for 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4366
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4367 (defun newsticker--buffer-insert-all-items ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4368 "Insert all cached newsticker items into the current buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4369 Keeps order of feeds as given in `newsticker-url-list' and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4370 `newsticker-url-list-defaults'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4371 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4372 (mapc (lambda (url-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4373 (let* ((feed-name (car url-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4374 (feed-name-symbol (intern feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4375 (feed (assoc feed-name-symbol newsticker--cache))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4376 (items (cdr feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4377 (pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4378 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4379 ;; insert the feed description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4380 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4381 (when (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4382 (newsticker--buffer-insert-item item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4383 feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4384 items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4385 ;;insert the items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4386 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4387 (if (memq (newsticker--age item) '(new immortal old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4388 obsolete))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4389 (newsticker--buffer-insert-item item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4390 feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4391 items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4392 (put-text-property pos (point) 'feed (car feed))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4393
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4394 ;; insert empty line between feeds
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4395 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4396 (insert "\n")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4397 (put-text-property p (point) 'hard t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4398 (append newsticker-url-list newsticker-url-list-defaults))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4399
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4400 (newsticker--buffer-set-faces (point-min) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4401 (newsticker--buffer-set-invisibility (point-min) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4402 (goto-char (point-min)))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4403
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4404 (defun newsticker--buffer-insert-item (item &optional feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4405 "Insert a news item in the current buffer.
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
4406 Insert a formatted representation of the ITEM. The optional parameter
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
4407 FEED-NAME-SYMBOL determines how the item is formatted and whether the
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
4408 item-retrieval time is added as well."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4409 ;; insert headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4410 (if (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4411 (newsticker--buffer-do-insert-text item 'feed feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4412 (newsticker--buffer-do-insert-text item 'item feed-name-symbol))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4413 ;; insert the description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4414 (newsticker--buffer-do-insert-text item 'desc feed-name-symbol))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4415
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4416 (defun newsticker--buffer-do-insert-text (item type feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4417 "Actually insert contents of news item, format it, render it and all that.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4418 ITEM is a news item, TYPE tells which part of the item shall be inserted,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4419 FEED-NAME-SYMBOL tells to which feed this item belongs."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4420 (let* ((pos (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4421 (format newsticker-desc-format)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4422 (pos-date-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4423 (pos-date-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4424 (pos-stat-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4425 (pos-stat-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4426 (pos-text-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4427 (pos-text-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4428 (pos-extra-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4429 (pos-extra-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4430 (pos-enclosure-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4431 (pos-enclosure-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4432 (age (newsticker--age item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4433 (preformatted-contents (newsticker--preformatted-contents item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4434 (preformatted-title (newsticker--preformatted-title item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4435 (cond ((and preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4436 (not (eq (aref preformatted-contents 0) ?\n));; we must
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4437 ;; NOT have a line
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4438 ;; break!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4439 (eq type 'desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4440 (insert preformatted-contents))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4441 ((and preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4442 (not (eq (aref preformatted-title 0) ?\n));; we must NOT have a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4443 ;; line break!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4444 (eq type 'item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4445 (insert preformatted-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4446 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4447 ;; item was not formatted before.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4448 ;; Let's go.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4449 (if (eq type 'item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4450 (setq format newsticker-item-format)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4451 (if (eq type 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4452 (setq format newsticker-heading-format)))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4453
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4454 (while (> (length format) 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4455 (let ((prefix (if (> (length format) 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4456 (substring format 0 2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4457 "")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4458 (cond ((string= "%c" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4459 ;; contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4460 (when (newsticker--desc item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4461 (setq pos-text-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4462 (insert (newsticker--desc item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4463 (setq pos-text-end (point-marker)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4464 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4465 ((string= "%d" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4466 ;; date
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4467 (setq pos-date-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4468 (if (newsticker--time item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4469 (insert (format-time-string newsticker-date-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4470 (newsticker--time item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4471 (setq pos-date-end (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4472 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4473 ((string= "%l" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4474 ;; logo
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4475 (let ((disabled (cond ((eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4476 (= (newsticker--stat-num-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4477 feed-name-symbol 'new) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4478 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4479 (not (eq (newsticker--age item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4480 'new))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4481 (let ((img (newsticker--image-read feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4482 disabled)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4483 (when img
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4484 (newsticker--insert-image img (car item)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4485 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4486 ((string= "%L" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4487 ;; logo or title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4488 (let ((disabled (cond ((eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4489 (= (newsticker--stat-num-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4490 feed-name-symbol 'new) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4491 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4492 (not (eq (newsticker--age item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4493 'new))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4494 (let ((img (newsticker--image-read feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4495 disabled)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4496 (if img
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4497 (newsticker--insert-image img (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4498 (when (car item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4499 (setq pos-text-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4500 (if (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4501 (insert (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4502 ;; FIXME: This is not the "real" title!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4503 (insert (format "%s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4504 (car (newsticker--cache-get-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4505 feed-name-symbol)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4506 (setq pos-text-end (point-marker))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4507 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4508 ((string= "%s" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4509 ;; statistics
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4510 (setq pos-stat-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4511 (if (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4512 (insert (newsticker--buffer-statistics
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4513 feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4514 (setq pos-stat-end (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4515 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4516 ((string= "%t" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4517 ;; title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4518 (when (car item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4519 (setq pos-text-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4520 (insert (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4521 (setq pos-text-end (point-marker)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4522 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4523 ((string-match "%." prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4524 ;; unknown specifier!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4525 (insert prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4526 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4527 ((string-match "^\\([^%]*\\)\\(.*\\)" format) ;; FIXME!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4528 ;; everything else
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4529 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4530 (insert (substring format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4531 (match-beginning 1) (match-end 1)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4532 ;; in case that the format string contained newlines
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4533 (put-text-property p (point) 'hard t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4534 (setq format (substring format (match-beginning 2)))))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4535
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4536 ;; decode HTML if possible...
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4537 (let ((is-rendered-HTML nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4538 (when (and newsticker-html-renderer pos-text-start pos-text-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4539 (condition-case error-data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4540 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4541 ;; check whether it is necessary to call html renderer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4542 ;; (regexp inspired by htmlr.el)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4543 (goto-char pos-text-start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4544 (when (re-search-forward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4545 "</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" pos-text-end t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4546 ;; (message "%s" (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4547 (let ((w3m-fill-column (if newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4548 -1 fill-column))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4549 (w3-maximum-line-length
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4550 (if newsticker-use-full-width nil fill-column)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4551 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4552 (funcall newsticker-html-renderer pos-text-start
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4553 pos-text-end)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4554 (cond ((eq newsticker-html-renderer 'w3m-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4555 (add-text-properties pos (point-max)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4556 (list 'keymap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4557 w3m-minor-mode-map)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4558 ((eq newsticker-html-renderer 'w3-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4559 (add-text-properties pos (point-max)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4560 (list 'keymap w3-mode-map))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4561 (setq is-rendered-HTML t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4562 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4563 (message "Error: HTML rendering failed: %s, %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4564 (car error-data) (cdr error-data)))))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4565 ;; After html rendering there might be chunks of blank
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4566 ;; characters between rendered text and date, statistics or
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4567 ;; whatever. Remove it
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4568 (when (and (eq type 'item) is-rendered-HTML)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4569 (goto-char pos)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4570 (while (re-search-forward "[ \t]*\n[ \t]*" nil t)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4571 (replace-match " " nil nil))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4572 (goto-char (point-max)))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4573 (when (and newsticker-justification
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4574 (memq type '(item desc))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4575 (not is-rendered-HTML))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4576 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4577 (let ((use-hard-newlines t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4578 (fill-region pos (point-max) newsticker-justification))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4579 (error nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4580
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4581 ;; remove leading and trailing newlines
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4582 (goto-char pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4583 (unless (= 0 (skip-chars-forward " \t\r\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4584 (delete-region pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4585 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4586 (let ((end (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4587 (unless (= 0 (skip-chars-backward " \t\r\n" (1+ pos)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4588 (delete-region (point) end)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4589 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4590 ;; closing newline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4591 (unless nil ;;(eq pos (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4592 (insert "\n")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4593 (put-text-property (1- (point)) (point) 'hard t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4594
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4595 ;; insert enclosure element
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4596 (when (eq type 'desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4597 (setq pos-enclosure-start (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4598 (newsticker--buffer-insert-enclosure item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4599 (setq pos-enclosure-end (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4600
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4601 ;; show extra elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4602 (when (eq type 'desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4603 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4604 (setq pos-extra-start (point))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4605 (newsticker--buffer-print-extra-elements item)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4606 (setq pos-extra-end (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4607
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4608 ;; text properties
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4609 (when (memq type '(feed item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4610 (add-text-properties pos (1- (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4611 (list 'mouse-face 'highlight
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4612 'nt-link (newsticker--link item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4613 'help-echo
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4614 (format "mouse-2: visit item (%s)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4615 (newsticker--link item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4616 'keymap newsticker--url-keymap))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4617 (add-text-properties pos (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4618 (list 'nt-title (newsticker--title item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4619 'nt-desc (newsticker--desc item))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4620
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4621 (add-text-properties pos (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4622 (list 'nt-type type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4623 'nt-face type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4624 'nt-age age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4625 'nt-guid (newsticker--guid item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4626 (when (and pos-date-start pos-date-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4627 (put-text-property pos-date-start pos-date-end 'nt-face 'date))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4628 (when (and pos-stat-start pos-stat-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4629 (put-text-property pos-stat-start pos-stat-end 'nt-face 'stat))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4630 (when (and pos-extra-start pos-extra-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4631 (put-text-property pos-extra-start pos-extra-end
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4632 'nt-face 'extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4633 (put-text-property pos-extra-start pos-extra-end
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4634 'nt-type 'extra))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4635 (when (and pos-enclosure-start pos-enclosure-end
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4636 (> pos-enclosure-end pos-enclosure-start))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4637 (put-text-property pos-enclosure-start (1- pos-enclosure-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4638 'nt-face 'enclosure))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4639
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4640 ;; left margin
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4641 ;;(unless (memq type '(feed item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4642 ;;(set-left-margin pos (1- (point)) 1))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4643
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4644 ;; save rendered stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4645 (cond ((eq type 'desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4646 ;; preformatted contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4647 (newsticker--cache-set-preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4648 item (buffer-substring pos (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4649 ((eq type 'item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4650 ;; preformatted title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4651 (newsticker--cache-set-preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4652 item (buffer-substring pos (point)))))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4653
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4654 (defun newsticker--buffer-print-extra-elements (item)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4655 "Insert extra-elements of ITEM in a pretty form into the current buffer."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4656 (let ((ignored-elements '(items link title description
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4657 content:encoded
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4658 dc:subject dc:date item guid
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4659 pubDate enclosure))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4660 (left-column-width 1))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4661 (mapc (lambda (extra-element)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4662 (unless (memq (car extra-element) ignored-elements)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4663 (setq left-column-width (max left-column-width
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4664 (length (symbol-name
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4665 (car extra-element)))))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4666 (newsticker--extra item))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4667 (mapc (lambda (extra-element)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4668 (unless (memq (car extra-element) ignored-elements)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4669 (newsticker--buffer-do-print-extra-element extra-element
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4670 left-column-width)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4671 (newsticker--extra item))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4672
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4673 (defun newsticker--buffer-do-print-extra-element (extra-element width)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4674 "Actually print an EXTRA-ELEMENT using the given WIDTH."
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4675 (let ((name (symbol-name (car extra-element))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4676 (insert (format "%s: " name))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4677 (insert (make-string (- width (length name)) ? )))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4678 (let (;;(attributes (cadr extra-element)) ;FIXME!!!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4679 (contents (cddr extra-element)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4680 (cond ((listp contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4681 (mapc (lambda (i)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4682 (if (and (stringp i)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4683 (string-match "^http://.*" i))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4684 (let ((pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4685 (insert i " ") ; avoid self-reference from the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4686 ; nt-link thing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4687 (add-text-properties
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4688 pos (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4689 (list 'mouse-face 'highlight
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4690 'nt-link i
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4691 'help-echo
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4692 (format "mouse-2: visit (%s)" i)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4693 'keymap newsticker--url-keymap)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4694 (insert (format "%s" i))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4695 contents))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4696 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4697 (insert (format "%s" contents))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4698 (insert "\n")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4699
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4700 (defun newsticker--buffer-insert-enclosure (item)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4701 "Insert enclosure element of a news ITEM into the current buffer."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4702 (let ((enclosure (newsticker--enclosure item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4703 (beg (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4704 (when enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4705 (let ((url (cdr (assoc 'url enclosure)))
75606
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4706 (length (string-to-number (or (cdr (assoc 'length enclosure))
b4a41bf661e9 (newsticker-version): Changed to "1.10".
Eli Zaretskii <eliz@gnu.org>
parents: 75347
diff changeset
4707 "0")))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4708 (type (cdr (assoc 'type enclosure))))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4709 (cond ((> length 1048576)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4710 (insert (format "Enclosed file (%s, %1.2f MBytes)" type
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4711 (/ length 1048576))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4712 ((> length 1024)
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4713 (insert (format "Enclosed file (%s, %1.2f KBytes)" type
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
4714 (/ length 1024)))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4715 (add-text-properties beg (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4716 (list 'mouse-face 'highlight
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4717 'nt-link url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4718 'help-echo (format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4719 "mouse-2: visit (%s)" url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4720 'keymap newsticker--url-keymap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4721 'nt-face 'enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4722 'nt-type 'desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4723 (insert "\n")))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4724
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4725 (defun newsticker--buffer-statistics (feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4726 "Return a statistic string for the feed given by FEED-NAME-SYMBOL.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4727 See `newsticker-statistics-format'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4728 (let ((case-fold-search nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4729 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4730 "%a"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4731 (format "%d" (newsticker--stat-num-items feed-name-symbol))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4732 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4733 "%i"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4734 (format "%d" (newsticker--stat-num-items feed-name-symbol 'immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4735 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4736 "%n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4737 (format "%d" (newsticker--stat-num-items feed-name-symbol 'new))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4738 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4739 "%o"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4740 (format "%d" (newsticker--stat-num-items feed-name-symbol 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4741 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4742 "%O"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4743 (format "%d" (newsticker--stat-num-items feed-name-symbol 'obsolete))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4744 newsticker-statistics-format)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4745
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4746 (defun newsticker--buffer-set-faces (start end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4747 "Add face properties according to mark property.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4748 Scans the buffer between START and END."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4749 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4750 ;;(put-text-property start end 'face 'newsticker-default-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4751 (goto-char start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4752 (let ((pos1 start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4753 (pos2 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4754 (nt-face (get-text-property start 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4755 (nt-age (get-text-property start 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4756 (when nt-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4757 (setq pos2 (next-single-property-change (point) 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4758 (newsticker--set-face-properties pos1 pos2 nt-face nt-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4759 (setq nt-face (get-text-property pos2 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4760 (setq pos1 pos2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4761 (while (and (setq pos2 (next-single-property-change pos1 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4762 (<= pos2 end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4763 (> pos2 pos1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4764 (newsticker--set-face-properties pos1 pos2 nt-face nt-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4765 (setq nt-face (get-text-property pos2 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4766 (setq nt-age (get-text-property pos2 'nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4767 (setq pos1 pos2)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4768
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4769 (defun newsticker--buffer-set-invisibility (start end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4770 "Add invisibility properties according to nt-type property.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4771 Scans the buffer between START and END. Sets the 'invisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4772 property to '(<nt-type>-<nt-age> <nt-type> <nt-age>)."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4773 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4774 ;; reset invisibility settings
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4775 (put-text-property start end 'invisible nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4776 ;; let's go
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4777 (goto-char start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4778 (let ((pos1 start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4779 (pos2 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4780 (nt-type (get-text-property start 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4781 (nt-age (get-text-property start 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4782 (when nt-type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4783 (setq pos2 (next-single-property-change (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4784 (put-text-property (max (point-min) pos1) (1- pos2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4785 'invisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4786 (list (intern
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4787 (concat
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4788 (symbol-name
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4789 (if (eq nt-type 'extra) 'desc nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4790 "-"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4791 (symbol-name nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4792 nt-type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4793 nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4794 (setq nt-type (get-text-property pos2 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4795 (setq pos1 pos2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4796 (while (and (setq pos2 (next-single-property-change pos1 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4797 (<= pos2 end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4798 (> pos2 pos1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4799 ;; must shift one char to the left in order to handle inivisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4800 ;; newlines, motion in invisible text areas and all that correctly
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4801 (put-text-property (1- pos1) (1- pos2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4802 'invisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4803 (list (intern
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4804 (concat
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4805 (symbol-name
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4806 (if (eq nt-type 'extra) 'desc nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4807 "-"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4808 (symbol-name nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4809 nt-type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4810 nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4811 (setq nt-type (get-text-property pos2 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4812 (setq nt-age (get-text-property pos2 'nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4813 (setq pos1 pos2)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4814
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4815 (defun newsticker--set-face-properties (pos1 pos2 nt-face age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4816 "Set the face for the text between the positions POS1 and POS2.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4817 The face is chosen according the values of NT-FACE and AGE."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4818 (let ((face (cond ((eq nt-face 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4819 'newsticker-feed-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4820 ((eq nt-face 'item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4821 (cond ((eq age 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4822 'newsticker-new-item-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4823 ((eq age 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4824 'newsticker-old-item-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4825 ((eq age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4826 'newsticker-immortal-item-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4827 ((eq age 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4828 'newsticker-obsolete-item-face)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4829 ((eq nt-face 'date)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4830 'newsticker-date-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4831 ((eq nt-face 'stat)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4832 'newsticker-statistics-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4833 ((eq nt-face 'extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4834 'newsticker-extra-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4835 ((eq nt-face 'enclosure)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4836 'newsticker-enclosure-face))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4837 (when face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4838 (put-text-property pos1 (max pos1 pos2) 'face face))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4839
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4840 (defun newsticker--insert-image (img string)
75646
56945fba998d (newsticker--insert-image): Update docstring. Insert the image directly.
Chong Yidong <cyd@stupidchicken.com>
parents: 75606
diff changeset
4841 "Insert IMG with STRING at point."
56945fba998d (newsticker--insert-image): Update docstring. Insert the image directly.
Chong Yidong <cyd@stupidchicken.com>
parents: 75606
diff changeset
4842 (insert-image img string))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4843
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4844 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4845 ;;; HTML rendering
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4846 ;; ======================================================================
86818
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
4847
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
4848 ;; External.
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
4849 (declare-function htmlr-reset "ext:htmlr" ())
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
4850 (declare-function htmlr-step "ext:htmlr" ())
45b24827f3b3 (w3m-toggle-inline-image, htmlr-reset)
Glenn Morris <rgm@gnu.org>
parents: 85777
diff changeset
4851
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4852 (defun newsticker-htmlr-render (pos1 pos2) ;
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4853 "Replacement for `htmlr-render'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4854 Renders the HTML code in the region POS1 to POS2 using htmlr."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4855 (let ((str (buffer-substring-no-properties pos1 pos2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4856 (delete-region pos1 pos2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4857 (insert
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4858 (with-temp-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4859 (insert str)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4860 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4861 ;; begin original htmlr-render
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4862 (htmlr-reset)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4863 ;; something omitted here...
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4864 (while (< (point) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4865 (htmlr-step))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4866 ;; end original htmlr-render
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4867 (newsticker--remove-whitespace (buffer-string))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4868
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4869 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4870 ;;; Functions working on the *newsticker* buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4871 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4872 (defun newsticker--buffer-make-item-completely-visible ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4873 "Scroll buffer until current item is completely visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4874 (when newsticker--auto-narrow-to-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4875 (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4876 (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4877 (max (or (save-excursion (newsticker--buffer-end-of-feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4878 (point-max))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4879 (narrow-to-region min max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4880 (when newsticker--auto-narrow-to-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4881 (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4882 (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4883 (max (or (save-excursion (newsticker--buffer-end-of-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4884 (point-max))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4885 (narrow-to-region min max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4886 (sit-for 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4887 ;; do not count lines and stuff because that does not work when images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4888 ;; are displayed. Do it the simple way:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4889 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4890 (newsticker--buffer-end-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4891 (unless (pos-visible-in-window-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4892 (recenter -1)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4893 (unless (pos-visible-in-window-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4894 (recenter 0)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4895
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4896 (defun newsticker--buffer-get-feed-title-at-point ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4897 "Return feed symbol of headline at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4898 (format "%s" (or (get-text-property (point) 'feed) " ")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4899
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4900 (defun newsticker--buffer-get-item-title-at-point ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4901 "Return feed symbol of headline at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4902 (format "%s" (or (get-text-property (point) 'nt-title) " ")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4903
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4904 (defun newsticker--buffer-goto (types &optional age backwards)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4905 "Search next occurrence of TYPES in current buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4906 TYPES is a list of symbols. If TYPES is found point is moved, if
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4907 not point is left unchanged. If optional parameter AGE is not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4908 nil, the type AND the age must match. If BACKWARDS is t, search
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4909 backwards."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4910 (let ((pos (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4911 (save-restriction
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4912 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4913 (catch 'found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4914 (let ((tpos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4915 (while (setq tpos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4916 (if backwards
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4917 (if (eq tpos (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4918 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4919 (or (previous-single-property-change
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4920 tpos 'nt-type)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4921 (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4922 (next-single-property-change
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4923 tpos 'nt-type)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4924 (and (memq (get-text-property tpos 'nt-type) types)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4925 (or (not age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4926 (eq (get-text-property tpos 'nt-age) age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4927 (throw 'found tpos)))))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4928 (when pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4929 (goto-char pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4930 pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4931
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
4932 (defun newsticker--buffer-hideshow (mark-age onoff)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4933 "Hide or show items of type MARK-AGE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4934 If ONOFF is nil the item is hidden, otherwise it is shown."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4935 (if onoff
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
4936 (remove-from-invisibility-spec mark-age)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4937 (add-to-invisibility-spec mark-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4938
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4939 (defun newsticker--buffer-beginning-of-item ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4940 "Move point to the beginning of the item at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4941 Return new position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4942 (if (bobp)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4943 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4944 (let ((type (get-text-property (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4945 (typebefore (get-text-property (1- (point)) 'nt-type)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4946 (if (and (memq type '(item feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4947 (not (eq type typebefore)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4948 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4949 (newsticker--buffer-goto '(item feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4950 (point)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4951
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4952 (defun newsticker--buffer-beginning-of-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4953 "Move point to the beginning of the feed at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4954 Return new position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4955 (if (bobp)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4956 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4957 (let ((type (get-text-property (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4958 (typebefore (get-text-property (1- (point)) 'nt-type)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4959 (if (and (memq type '(feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4960 (not (eq type typebefore)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4961 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4962 (newsticker--buffer-goto '(feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4963 (point)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4964
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4965 (defun newsticker--buffer-end-of-item ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4966 "Move point to the end of the item at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4967 Take care: end of item is at the end of its last line!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4968 (when (newsticker--buffer-goto '(item feed nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4969 (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4970
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4971 (defun newsticker--buffer-end-of-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4972 "Move point to the end of the last item of the feed at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4973 Take care: end of item is at the end of its last line!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4974 (when (newsticker--buffer-goto '(feed nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4975 (backward-char 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4976 (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4977
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4978 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4979 ;;; manipulation of ticker text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4980 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4981 (defun newsticker--ticker-text-setup ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4982 "Build the ticker text which is scrolled or flashed in the echo area."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4983 ;; reset scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4984 (setq newsticker--scrollable-text "")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4985 (setq newsticker--item-list nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4986 (setq newsticker--item-position 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4987 ;; build scrollable text from cache data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4988 (let ((have-something nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4989 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4990 (lambda (feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4991 (let ((feed-name (symbol-name (car feed))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4992 (let ((num-new (newsticker--stat-num-items (car feed) 'new))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4993 (num-old (newsticker--stat-num-items (car feed) 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4994 (num-imm (newsticker--stat-num-items (car feed) 'immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4995 (num-obs (newsticker--stat-num-items (car feed) 'obsolete)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4996 (when (or (> num-new 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4997 (and (> num-old 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4998 (not newsticker-hide-old-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4999 (and (> num-imm 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5000 (not newsticker-hide-immortal-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5001 (and (> num-obs 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5002 (not newsticker-hide-obsolete-items-in-echo-area)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5003 (setq have-something t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5004 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5005 (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5006 (let ((title (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5007 "[\r\n]+" " "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5008 (newsticker--title item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5009 (age (newsticker--age item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5010 (unless (string= title newsticker--error-headline)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5011 (when
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5012 (or (eq age 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5013 (and (eq age 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5014 (not newsticker-hide-old-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5015 (and (eq age 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5016 (not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5017 newsticker-hide-obsolete-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5018 (and (eq age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5019 (not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5020 newsticker-hide-immortal-items-in-echo-area)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5021 (setq title (newsticker--remove-whitespace title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5022 ;; add to flash list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5023 (add-to-list 'newsticker--item-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5024 (concat feed-name ": " title) t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5025 ;; and to the scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5026 (setq newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5027 (concat newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5028 " " feed-name ": " title " +++"))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5029 (cdr feed))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5030 newsticker--cache)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5031 (when have-something
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5032 (setq newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5033 (concat "+++ "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5034 (format-time-string "%A, %H:%M"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5035 newsticker--latest-update-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5036 " ++++++" newsticker--scrollable-text)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5037
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5038 (defun newsticker--ticker-text-remove (feed title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5039 "Remove the item of FEED with TITLE from the ticker text."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5040 ;; reset scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5041 (setq newsticker--item-position 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5042 (let ((feed-name (symbol-name feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5043 (t-title (replace-regexp-in-string "[\r\n]+" " " title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5044 ;; remove from flash list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5045 (setq newsticker--item-list (remove (concat feed-name ": " t-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5046 newsticker--item-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5047 ;; and from the scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5048 (setq newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5049 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5050 (regexp-quote (concat " " feed-name ": " t-title " +++"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5051 ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5052 newsticker--scrollable-text))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5053 (if (string-match (concat "^\\+\\+\\+ [A-Z][a-z]+, "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5054 "[012]?[0-9]:[0-9][0-9] \\+\\+\\+\\+\\+\\+$")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5055 newsticker--scrollable-text)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5056 (setq newsticker--scrollable-text ""))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5057
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5058 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5059 ;;; manipulation of cached data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5060 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5061 (defun newsticker--cache-set-preformatted-contents (item contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5062 "Set preformatted contents of ITEM to CONTENTS."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5063 (if (nthcdr 6 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5064 (setcar (nthcdr 6 item) contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5065 (setcdr (nthcdr 5 item) (list contents))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5066
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5067 (defun newsticker--cache-set-preformatted-title (item title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5068 "Set preformatted title of ITEM to TITLE."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5069 (if (nthcdr 7 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5070 (setcar (nthcdr 7 item) title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5071 (setcdr (nthcdr 6 item) title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5072
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5073 (defun newsticker--cache-replace-age (data feed old-age new-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5074 "Mark all items in DATA in FEED which carry age OLD-AGE with NEW-AGE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5075 If FEED is 'any it applies to all feeds. If OLD-AGE is 'any,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5076 all marks are replaced by NEW-AGE. Removes all pre-formatted contents."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5077 (mapc (lambda (a-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5078 (when (or (eq feed 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5079 (eq (car a-feed) feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5080 (let ((items (cdr a-feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5081 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5082 (when (or (eq old-age 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5083 (eq (newsticker--age item) old-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5084 (setcar (nthcdr 4 item) new-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5085 (newsticker--do-forget-preformatted item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5086 items))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5087 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5088 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5089
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5090 (defun newsticker--cache-mark-expired (data feed old-age new-age time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5091 "Mark all expired entries.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5092 This function sets the age entries in DATA in the feed FEED. If
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5093 an item's age is OLD-AGE it is set to NEW-AGE if the item is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5094 older than TIME."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5095 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5096 (lambda (a-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5097 (when (or (eq feed 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5098 (eq (car a-feed) feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5099 (let ((items (cdr a-feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5100 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5101 (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5102 (when (eq (newsticker--age item) old-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5103 (let ((exp-time (time-add (newsticker--time item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5104 (seconds-to-time time))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5105 (when (time-less-p exp-time (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5106 (newsticker--debug-msg
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5107 "Item `%s' from %s has expired on %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5108 (newsticker--title item)
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
5109 (format-time-string "%Y-%02m-%d, %H:%M"
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5110 (newsticker--time item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5111 (format-time-string "%Y-%02m-%d, %H:%M" exp-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5112 (setcar (nthcdr 4 item) new-age)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5113 items))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5114 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5115 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5116
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5117 (defun newsticker--cache-contains (data feed title desc link age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5118 &optional guid)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5119 "Check DATA whether FEED contains an item with the given properties.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5120 This function returns the contained item or nil if it is not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5121 contained.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5122 The properties which are checked are TITLE, DESC, LINK, AGE, and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5123 GUID. In general all properties must match in order to return a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5124 certain item, except for the following cases.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5125
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5126 If AGE equals 'feed the TITLE, DESCription and LINK do not
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
5127 matter. If DESC is nil it is ignored as well. If
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5128 `newsticker-desc-comp-max' is non-nil, only the first
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5129 `newsticker-desc-comp-max' characters of DESC are taken into
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5130 account.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5131
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5132 If GUID is non-nil it is sufficient to match this value, and the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5133 other properties are ignored."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5134 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5135 (catch 'found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5136 (when (and desc newsticker-desc-comp-max
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5137 (> (length desc) newsticker-desc-comp-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5138 (setq desc (substring desc 0 newsticker-desc-comp-max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5139 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5140 (lambda (this-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5141 (when (eq (car this-feed) feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5142 (mapc (lambda (anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5143 (when (or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5144 ;; global unique id can match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5145 (and guid
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5146 (string= guid (newsticker--guid anitem)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5147 ;; or title, desc, etc.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5148 (and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5149 ;;(or (not (eq age 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5150 ;; (eq (newsticker--age anitem) 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5151 (string= (newsticker--title anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5152 title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5153 (or (not link)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5154 (string= (newsticker--link anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5155 link))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5156 (or (not desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5157 (if (and desc newsticker-desc-comp-max
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5158 (> (length (newsticker--desc anitem))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5159 newsticker-desc-comp-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5160 (string= (substring
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5161 (newsticker--desc anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5162 0 newsticker-desc-comp-max)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5163 desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5164 (string= (newsticker--desc anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5165 desc)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5166 (throw 'found anitem)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5167 (cdr this-feed))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5168 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5169 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5170 (error nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5171
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5172 (defun newsticker--cache-add (data feed-name-symbol title desc link time age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5173 position extra-elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5174 &optional updated-age updated-time
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5175 preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5176 preformatted-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5177 "Add another item to cache data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5178 Add to DATA in the FEED-NAME-SYMBOL an item with TITLE, DESC,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5179 LINK, TIME, AGE, POSITION, and EXTRA-ELEMENTS. If this item is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5180 contained already, its mark is set to UPDATED-AGE, its time is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5181 set to UPDATED-TIME, and its pre-formatted contents is set to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5182 PREFORMATTED-CONTENTS and PREFORMATTED-TITLE. Returns the age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5183 which the item got."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5184 (let ((item (newsticker--cache-contains data feed-name-symbol title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5185 desc link age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5186 (if item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5187 ;; does exist already -- change age, update time and position
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5188 (progn
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5189 (if (nthcdr 5 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5190 (setcar (nthcdr 5 item) position)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5191 (setcdr (nthcdr 4 item) (list position)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5192 (setcar (nthcdr 4 item) updated-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5193 (if updated-time
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5194 (setcar (nthcdr 3 item) updated-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5195 ;; replace cached pre-formatted contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5196 (newsticker--cache-set-preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5197 item preformatted-contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5198 (newsticker--cache-set-preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5199 item preformatted-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5200 ;; did not exist or age equals 'feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5201 (catch 'found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5202 (mapc (lambda (this-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5203 (when (eq (car this-feed) feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5204 (setcdr this-feed (nconc (cdr this-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5205 (list (list title desc link
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5206 time age position
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5207 preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5208 preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5209 extra-elements))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5210 (throw 'found this-feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5211 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5212 ;; the feed is not contained
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5213 (add-to-list 'data (list feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5214 (list title desc link time age position
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5215 preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5216 preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5217 extra-elements))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5218 t))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5219 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5220
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5221 (defun newsticker--cache-remove (data feed-symbol age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5222 "Remove all entries from DATA in the feed FEED-SYMBOL with AGE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5223 FEED-SYMBOL may be 'any. Entries from old feeds, which are no longer in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5224 `newsticker-url-list' or `newsticker-url-list-defaults', are removed as
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5225 well."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5226 (let* ((pos data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5227 (feed (car pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5228 (last-pos nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5229 (while feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5230 (if (or (assoc (symbol-name (car feed)) newsticker-url-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5231 (assoc (symbol-name (car feed)) newsticker-url-list-defaults))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5232 ;; feed is still valid=active
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5233 ;; (message "Keeping feed %s" (car feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5234 (if (or (eq feed-symbol 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5235 (eq feed-symbol (car feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5236 (let* ((item-pos (cdr feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5237 (item (car item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5238 (prev-pos nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5239 (while item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5240 ;;(message "%s" (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5241 (if (eq age (newsticker--age item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5242 ;; remove this item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5243 (progn
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5244 ;;(message "Removing item %s" (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5245 (if prev-pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5246 (setcdr prev-pos (cdr item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5247 (setcdr feed (cdr item-pos))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5248 ;;(message "Keeping item %s" (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5249 (setq prev-pos item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5250 (setq item-pos (cdr item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5251 (setq item (car item-pos)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5252 ;; feed is not active anymore
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5253 ;; (message "Removing feed %s" (car feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5254 (if last-pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5255 (setcdr last-pos (cdr pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5256 (setq data (cdr pos))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5257 (setq last-pos pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5258 (setq pos (cdr pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5259 (setq feed (car pos)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5260
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5261 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5262 ;;; Sorting
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5263 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5264 (defun newsticker--cache-item-compare-by-time (item1 item2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5265 "Compare two news items ITEM1 and ITEM2 by comparing their time values."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5266 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5267 (let ((age1 (newsticker--age item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5268 (age2 (newsticker--age item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5269 (if (not (eq age1 age2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5270 (cond ((eq age1 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5271 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5272 ((eq age2 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5273 (throw 'result t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5274 (let* ((time1 (newsticker--time item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5275 (time2 (newsticker--time item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5276 (cond ((< (nth 0 time1) (nth 0 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5277 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5278 ((> (nth 0 time1) (nth 0 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5279 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5280 ((< (nth 1 time1) (nth 1 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5281 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5282 ((> (nth 1 time1) (nth 1 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5283 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5284 ((< (or (nth 2 time1) 0) (or (nth 2 time2) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5285 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5286 ((> (or (nth 2 time1) 0) (or (nth 2 time2) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5287 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5288 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5289 nil)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5290
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5291 (defun newsticker--cache-item-compare-by-title (item1 item2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5292 "Compare ITEM1 and ITEM2 by comparing their titles."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5293 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5294 (let ((age1 (newsticker--age item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5295 (age2 (newsticker--age item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5296 (if (not (eq age1 age2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5297 (cond ((eq age1 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5298 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5299 ((eq age2 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5300 (throw 'result t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5301 (string< (newsticker--title item1) (newsticker--title item2))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5302
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5303 (defun newsticker--cache-item-compare-by-position (item1 item2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5304 "Compare ITEM1 and ITEM2 by comparing their original positions."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5305 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5306 (let ((age1 (newsticker--age item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5307 (age2 (newsticker--age item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5308 (if (not (eq age1 age2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5309 (cond ((eq age1 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5310 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5311 ((eq age2 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5312 (throw 'result t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5313 (< (or (newsticker--pos item1) 0) (or (newsticker--pos item2) 0))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5314
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5315 (defun newsticker--cache-sort ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5316 "Sort the newsticker cache data."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5317 (let ((sort-fun (cond ((eq newsticker-sort-method 'sort-by-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5318 'newsticker--cache-item-compare-by-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5319 ((eq newsticker-sort-method 'sort-by-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5320 'newsticker--cache-item-compare-by-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5321 ((eq newsticker-sort-method 'sort-by-original-order)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5322 'newsticker--cache-item-compare-by-position))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5323 (mapc (lambda (feed-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5324 (setcdr feed-list (sort (cdr feed-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5325 sort-fun)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5326 newsticker--cache)))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
5327
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5328 (defun newsticker--cache-update (&optional save)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5329 "Update newsticker cache file.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5330 If optional argument SAVE is not nil the cache file is saved to disk."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5331 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5332 (let ((coding-system-for-write 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5333 (buf (find-file-noselect newsticker-cache-filename)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5334 (when buf
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5335 (set-buffer buf)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5336 (setq buffer-undo-list t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5337 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5338 (insert ";; -*- coding: utf-8 -*-\n")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5339 (insert (prin1-to-string newsticker--cache))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5340 (when save
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5341 (save-buffer))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5342
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5343 (defun newsticker--cache-get-feed (feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5344 "Return the cached data for the feed FEED.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5345 FEED is a symbol!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5346 (assoc feed newsticker--cache))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5347
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5348 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5349 ;;; Statistics
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5350 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5351 (defun newsticker--stat-num-items (feed &optional age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5352 "Return number of items in the given FEED which have the given AGE.
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
5353 If AGE is nil, the total number of items is returned."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5354 (let ((items (cdr (newsticker--cache-get-feed feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5355 (num 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5356 (while items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5357 (if age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5358 (if (eq (newsticker--age (car items)) age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5359 (setq num (1+ num)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5360 (if (memq (newsticker--age (car items)) '(new old immortal obsolete))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5361 (setq num (1+ num))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5362 (setq items (cdr items)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5363 num))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5364
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5365 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5366 ;;; OPML
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5367 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5368 (defun newsticker-opml-export ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5369 "OPML subscription export.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5370 Export subscriptions to a buffer in OPML Format."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5371 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5372 (with-current-buffer (get-buffer-create "*OPML Export*")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5373 (set-buffer-file-coding-system 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5374 (insert (concat
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5375 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5376 "<!-- OPML generated by Emacs newsticker.el -->\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5377 "<opml version=\"1.0\">\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5378 " <head>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5379 " <title>mySubscriptions</title>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5380 " <dateCreated>" (format-time-string "%a, %d %b %Y %T %z")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5381 "</dateCreated>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5382 " <ownerEmail>" user-mail-address "</ownerEmail>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5383 " <ownerName>" (user-full-name) "</ownerName>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5384 " </head>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5385 " <body>\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5386 (mapc (lambda (sub)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5387 (insert " <outline text=\"")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5388 (insert (newsticker--title sub))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5389 (insert "\" xmlUrl=\"")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5390 (insert (cadr sub))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5391 (insert "\"/>\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5392 (append newsticker-url-list newsticker-url-list-defaults))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5393 (insert " </body>\n</opml>\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5394 (pop-to-buffer "*OPML Export*")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5395 (when (fboundp 'sgml-mode)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5396 (sgml-mode)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5397
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5398 (defun newsticker-opml-import (filename)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5399 "Import OPML data from FILENAME."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5400 (interactive "fOPML file: ")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5401 (set-buffer (find-file-noselect filename))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5402 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5403 (let* ((node-list (xml-parse-region (point-min) (point-max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5404 (body (car (xml-get-children (car node-list) 'body)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5405 (outlines (xml-get-children body 'outline)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5406 (mapc (lambda (outline)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5407 (let ((name (xml-get-attribute outline 'text))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5408 (url (xml-get-attribute outline 'xmlUrl)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5409 (add-to-list 'newsticker-url-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5410 (list name url nil nil nil) t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5411 outlines))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5412 (customize-variable 'newsticker-url-list))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
5413
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5414 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5415 ;;; Auto marking
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5416 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5417 (defun newsticker--run-auto-mark-filter (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5418 "Automatically mark an item as old or immortal.
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5419 This function checks the variable `newsticker-auto-mark-filter-list'
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5420 for an entry that matches FEED and ITEM."
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5421 (let ((case-fold-search t))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5422 (mapc (lambda (filter)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5423 (let ((filter-feed (car filter))
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5424 (pattern-list (cadr filter)))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5425 (when (string-match filter-feed feed)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5426 (newsticker--do-run-auto-mark-filter item pattern-list))))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5427 newsticker-auto-mark-filter-list)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5428
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5429 (defun newsticker--do-run-auto-mark-filter (item list)
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
5430 "Actually compare ITEM against the pattern-LIST
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
5431 \(from `newsticker-auto-mark-filter-list')."
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5432 (mapc (lambda (pattern)
66704
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5433 (let ((age (nth 0 pattern))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5434 (place (nth 1 pattern))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5435 (regexp (nth 2 pattern))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5436 (title (newsticker--title item))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5437 (desc (newsticker--desc item)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5438 (when (or (eq place 'title) (eq place 'all))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5439 (when (and title (string-match regexp title))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5440 (newsticker--debug-msg "Auto-marking as %s: `%s'"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5441 age (newsticker--title item))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5442 (setcar (nthcdr 4 item) age)))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5443 (when (or (eq place 'description) (eq place 'all))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5444 (when (and desc (string-match regexp desc))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5445 (newsticker--debug-msg "Auto-marking as %s: `%s'"
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5446 age (newsticker--title item))
768e9c3f6b5a Commentary updated. Code formatting changed.
Eli Zaretskii <eliz@gnu.org>
parents: 65998
diff changeset
5447 (setcar (nthcdr 4 item) age)))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5448 list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5449
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5450
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5451 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5452 ;;; hook samples
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5453 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5454 (defun newsticker-new-item-functions-sample (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5455 "Demonstrate the use of the `newsticker-new-item-functions' hook.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5456 This function just prints out the values of the FEED and title of the ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5457 (message (concat "newsticker-new-item-functions-sample: feed=`%s', "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5458 "title=`%s'")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5459 feed (newsticker--title item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5460
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5461 (defun newsticker-download-images (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5462 "Download the first image.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5463 If FEED equals \"imagefeed\" download the first image URL found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5464 in the description=contents of ITEM to the directory
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5465 \"~/tmp/newsticker/FEED/TITLE\" where TITLE is the title of the item."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5466 (when (string= feed "imagefeed")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5467 (let ((title (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5468 (desc (newsticker--desc item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5469 (when (string-match "<img src=\"\\(http://[^ \"]+\\)\"" desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5470 (let ((url (substring desc (match-beginning 1) (match-end 1)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5471 (temp-dir (concat "~/tmp/newsticker/" feed "/" title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5472 (org-dir default-directory))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5473 (unless (file-directory-p temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5474 (make-directory temp-dir t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5475 (cd temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5476 (message "Getting image %s" url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5477 (apply 'start-process "wget-image"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5478 " *newsticker-wget-download-images*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5479 newsticker-wget-name
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5480 (list url))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5481 (cd org-dir))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5482
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5483 (defun newsticker-download-enclosures (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5484 "In all FEEDs download the enclosed object of the news ITEM.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5485 The object is saved to the directory \"~/tmp/newsticker/FEED/TITLE\", which
68573
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
5486 is created if it does not exist. TITLE is the title of the news
f6bc825f1a5b (newsticker--decode-iso8601-date, newsticker--set-customvar,
Juanma Barranquero <lekktu@gmail.com>
parents: 67593
diff changeset
5487 item. Argument FEED is ignored.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5488 This function is suited for adding it to `newsticker-new-item-functions'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5489 (let ((title (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5490 (enclosure (newsticker--enclosure item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5491 (when enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5492 (let ((url (cdr (assoc 'url enclosure)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5493 (temp-dir (concat "~/tmp/newsticker/" feed "/" title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5494 (org-dir default-directory))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5495 (unless (file-directory-p temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5496 (make-directory temp-dir t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5497 (cd temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5498 (message "Getting enclosure %s" url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5499 (apply 'start-process "wget-enclosure"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5500 " *newsticker-wget-download-enclosures*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5501 newsticker-wget-name
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5502 (list url))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5503 (cd org-dir)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5504
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5505
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5506 (provide 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5507
65481
59060d7bf36c Add arch tagline
Miles Bader <miles@gnu.org>
parents: 65468
diff changeset
5508 ;; arch-tag: ab761dfa-67bc-4207-bc64-4307271dc381
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5509 ;;; newsticker.el ends here