annotate lisp/net/newsticker.el @ 83384:08b4dd6a6e87

Merged from miles@gnu.org--gnu-2005 (patch 578-592) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-578 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-579 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-580 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-581 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-582 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-583 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-584 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-585 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-586 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-587 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-588 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-589 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-590 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-591 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-592 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-424
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 12 Oct 2005 16:14:04 +0000
parents 2a679c81f552 e6b90c8b34d8
children 693e794b57bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
1 ;;; newsticker.el --- A news-ticker for Emacs.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
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
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; Keywords: News, RSS
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; This program is free software; you can redistribute it and/or modify
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2 of the License, or (at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; your option) any later version.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; This program is distributed in the hope that it will be useful, but
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; General Public License for more details.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
65638
e274642bf5d5 Update FSF street address; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 65617
diff changeset
24 ;; along with this program; if not, write to the Free Software Foundation,
e274642bf5d5 Update FSF street address; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 65617
diff changeset
25 ;; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
27 (defconst newsticker-version "1.8" "Version number of newsticker.el.")
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
28
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; ======================================================================
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 ;;; Commentary:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; Overview
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; --------
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 ;; Newsticker provides a newsticker for Emacs. A newsticker is a thing that
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; asynchronously retrieves headlines from a list of news sites, prepares
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;; these headlines for reading, and allows for loading the corresponding
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ;; articles in a web browser.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 ;; Headlines consist of a title and (possibly) a small description. They
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 ;; are contained in RSS (RDF Site Summary) files. Newsticker should work
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;; with all RSS files that follow the RDF Rich Site Summary 1.0
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;; specification. It should also work with version 2.0 as well as
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 ;; other/older/alternative RSS formats (like 0.9<something> or such). In
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 ;; other words: Newsticker is a "RSS reader" or "RSS aggregator".
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 ;; Newsticker provides several commands for reading headlines, navigating
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; through them, marking them as read/unread, hiding old headlines
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;; etc. Headlines can be displayed as plain text or as rendered HTML.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; Headlines can be displayed in the echo area, either scrolling like
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ;; messages in a stock-quote ticker, or just changing.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;; Newsticker allows for automatic processing of headlines by providing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; hooks and (sample) functions for automatically downloading images and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57 ;; enclosed files (as delivered by podcasts, e.g.).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59
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 ;; Requirements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;; ------------
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
63 ;; Newsticker can be used with Emacs version 21.1 or later as well as
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
64 ;; XEmacs. It requires an XML-parser (`xml.el') which is part of
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; Emacs. If you are using XEmacs you want to get the `net-utils' package
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;; which contains `xml.el' for XEmacs.
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 requires a program which can retrieve files via http and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ;; prints them to stdout. By default Newsticker will use wget for this
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; task.
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 ;; Usage
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;; -----
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ;; The command newsticker-show-news will display all available headlines in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 ;; a special buffer, called `*newsticker*'. It will also start the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ;; asynchronous download of headlines. The modeline in the `*newsticker*'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 ;; buffer informs whenever new headlines have arrived. Clicking
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 ;; 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
79 ;; browse-url to load the corresponding news story in your favourite web
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 ;; browser.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 ;; The scrolling, or flashing of headlines in the echo area, can be started
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ;; with the command newsticker-start-ticker. It can be stopped with
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 ;; newsticker-stop-ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ;; If you just want to start the periodic download of headlines use the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 ;; command newsticker-start. Calling newsticker-stop will stop the periodic
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ;; download, but will call newsticker-stop-ticker as well.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 ;; Configuration
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 ;; -------------
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 ;; All Newsticker options are customizable, i.e. they can be changed with
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 ;; Emacs customization methods: Call the command customize-group and enter
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 ;; `newsticker' for the customization group.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 ;; All Newsticker options have reasonable default values, so that in most
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 ;; cases it is not necessary to customize settings before starting
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 ;; Newsticker for the first time.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ;; Newsticker options are organized in the following groups.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 ;; * newsticker-feed contains options that define which news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 ;; feeds are retrieved and how this is done.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 ;; o newsticker-url-list defines the list of headlines which are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 ;; retrieved.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 ;; o newsticker-retrieval-interval defines how often headlines are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 ;; retrieved.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 ;; * newsticker-headline-processing contains options that define how the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 ;; retrieved headlines are processed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 ;; o newsticker-keep-obsolete-items decides whether unread headlines that
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 ;; have been removed from the feed are kept in the Newsticker cache.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 ;; * newsticker-layout contains options that define how the buffer for
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 ;; reading RSS headlines is formatted.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 ;; o newsticker-item-format defines how the title of a headline is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 ;; formatted.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 ;; * newsticker-ticker contains options that define how headlines are shown
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 ;; in the echo area.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 ;; o newsticker-display-interval and newsticker-scroll-smoothly define
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 ;; how headlines are shown in the echo area.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 ;; * newsticker-hooks contains options for hooking other Emacs commands to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 ;; newsticker functions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 ;; o newsticker-new-item-functions allows for automatic processing of
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 ;; headlines. See `newsticker-download-images', and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 ;; `newsticker-download-enclosures' for sample functions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 ;; * newsticker-miscellaneous contains other Newsticker options.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 ;; 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
128 ;; options.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 ;; Remarks
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 ;; -------
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 ;; This newsticker is designed do its job silently in the background
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 ;; without disturbing you. However, it is probably impossible to prevent
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 ;; such a tool from slightly attenuating your Editor's responsiveness every
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 ;; once in a while.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
137 ;; Newsticker-mode supports imenu. It allows for navigating with the help
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
138 ;; of a menu. In order to use this feature you should also add the
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
139 ;; following.
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
140 ;; (add-hook 'newsticker-mode-hook 'imenu-add-menubar-index)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 ;;; History:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 ;; 1.8 (2005-08-26)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 ;; * Added commands `newsticker-show-extra' and `newsticker-hide-extra'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 ;; to show and hide extra RSS elements, bound to "sx" and "hx"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148 ;; resp. Changed default value of `newsticker-show-all-rss-elements'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 ;; to nil.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 ;; * mode-line: Introduced special mode-line-format for newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 ;; * Get feed logos only once every 24 h.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 ;; * Default faces changed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 ;; * Minor fixes.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 ;; 1.7 (2005-06-25)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 ;; * Tool-bar support: most important commands can be called from
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 ;; tool-bar buttons.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 ;; * Auto-Narrowing introduced: *newsticker* buffer can be narrowed to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 ;; a single item (bound to key `xi') or a single feed (bound to `xf').
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 ;; * Enclosure support: enclosed items are shown (see
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 ;; `newsticker-enclosure-face') and can be (automatically) downloaded
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 ;; (see below). For those of you who read "podcasts".
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 ;; * Added variable `newsticker-auto-mark-filter' for automatically
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 ;; marking items as immortal or old.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 ;; * Added hook variable `newsticker-new-item-functions' for handling
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 ;; new items. Added sample functions `newsticker-download-images',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 ;; and `newsticker-download-enclosures'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 ;; * Added hook variable `newsticker-select-item-hook' which is run
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 ;; after `newsticker-(next|previous)-(new-)?-item'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 ;; * Added hook variable `newsticker-select-feed-hook' which is run
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 ;; after `newsticker-(next|previous)-feed'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 ;; * Added hook variable `newsticker-buffer-change-hook' which is run
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 ;; after the contents or visibility of the newsticker buffer has
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 ;; changed, e.g. after `newsticker-buffer-update' or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 ;; `newsticker-show-feed-desc'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 ;; * Added command `newsticker-handle-url' for interactively launching
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 ;; arbitrary programs for URLs, bound to `C-RET'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 ;; * URLs in extra elements are clickable.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 ;; * Better support for w3, added command
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 ;; `newsticker-w3m-show-inline-images' for displaying all inline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 ;; images.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 ;; * Insert an artificial headline which notifies about failed retrievals.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 ;; * Use pubDate element (RSS 2.0) instead of retrieval time when
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 ;; available.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 ;; * Customizable options grouped.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 ;; * Bugfixes: `newsticker--imenu-create-index'; strip whitespace
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 ;; from links; apply coding-system to extra-elements; time-comparison
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 ;; for obsolete items; and others which I have forgotten.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 ;; * Workaround for another bug in xml-parse-region -- thanks to anonymous
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 ;; for sending patch.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 ;; * Renamed invisible buffers ` *wget-newsticker-<feed>*' to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 ;; ` *newsticker-wget-<feed>*'.
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
193 ;; * Tested with Emacs versions 21.3 and 22.0 and XEmacs 21.something.
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 ;; 1.6 * Support for (some) optional RSS elements: guid, dc:date. See
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 ;; `newsticker-show-all-rss-elements' `newsticker-extra-face'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 ;; * Better support for w3m -- `newsticker-default-face' is obsolete
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 ;; now, removed `newsticker-w3m-toggle-inline-image'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199 ;; * Added `newsticker-desc-comp-max' -- comparison of item descriptions
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 ;; can take quite some time.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
201 ;; * Added `newsticker--buffer-make-item-completely-visible' to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 ;; ensure that the current item is fully visible.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
203 ;; * Allow for non-positive retrieval-interval, which make newsticker
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
204 ;; get news only once.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205 ;; * Use :set for customizable variables.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 ;; * Added `newsticker-buffer-force-update', bound to key `U'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 ;; * Added concept of obsolete items, see
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 ;; `newsticker-keep-obsolete-items', `newsticker-obsolete-item-face',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
209 ;; `newsticker-obsolete-item-max-age'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 ;; * Added `newsticker-add-url'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 ;; * OPML export.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 ;; * Save pre-formatted titles => even better performance!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 ;; * `newsticker-*-new-item' wraps at beginning/end of buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 ;; * Always sort obsolete items to end of item list.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 ;; * Bugfixes:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 ;; - newsticker-hide-entry,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 ;; - changes of feed-titles led to duplicate feed items,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 ;; - faces for rendered HTML texts,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 ;; - length of ticker-text (for "exotic"/multibyte texts),
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 ;; Thanks to Hiroshi Maruyama.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 ;; - suppress items with empty title and description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 ;; - newsticker-sort-method was ignored!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 ;; - prevent call of fill-region on HTML-rendered descriptions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 ;; 1.5 * Rewrote the visibility stuff. newsticker does not inherit
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 ;; outline anymore. Now you have complete freedom for
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 ;; `newsticker-*-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 ;; * Save pre-formatted descriptions => incredible performance boost!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 ;; * Introduced `newsticker-(start|stop)-ticker'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 ;; * Introduced statistics for heading-format and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231 ;; `newsticker-statistics-face'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 ;; * Introduced `newsticker-enable-logo-manipulations'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 ;; * Compare link of items (as well as title and desc).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 ;; * Added `newsticker-start-hook' and `newsticker-stop-hook', thanks
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 ;; to mace.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 ;; * Bugfixes -- thanks to Ryan Yeske, Jari Aalto, Bruce Ingalls.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 ;; * 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
238
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 ;; 1.4 * Enabled HTML rendering, added `newsticker-html-renderer' to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 ;; choose a HTML rendering engine, thanks to Greg Scott for testing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 ;; * New Outline handling using text properties instead of "**"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242 ;; prefixes.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 ;; * Added possibility to mark single item as old (bound to key
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244 ;; `o' (`newsticker-mark-item-at-point-as-read').
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 ;; * Added possibility to mark single item as immortal (bound to key
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 ;; `i' (`newsticker-mark-item-at-point-as-immortal').
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 ;; * Added possibility to display feed logos.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 ;; * Added `newsticker-heading-format', `newsticker-item-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 ;; * Added `newsticker-date-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 ;; * Added `newsticker-justification'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 ;; * Added `newsticker-automatically-mark-visited-items-as-old'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 ;; * Added `newsticker-w3m-toggle-inline-image' which calls
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 ;; `w3m-toggle-inline-image' if `newsticker-html-renderer' is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 ;; `w3m-region'. Exists for convenience only (bound to key
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 ;; `RET').
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 ;; 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
258 ;; for feed desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 ;; * Mark as not-up-to-date only after new items have arrived.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 ;; * Added XEmacs compatibility code, tested with XEmacs 21.4.13.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 ;; * Tested with Emacs 21.3.50 and Emacs 21.2.something.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 ;; * Bugfix: Apply coding-systems to feed title and description,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 ;; thanks to OHASHI Akira
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 ;; * Bugfix: xml-parser-workaround did not work for japanese texts,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 ;; thanks to OHASHI Akira
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 ;; * Kill wget-buffers unless newsticker-debug is not nil.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 ;; * Bugfix: xml-parser-workaround for "DOCTYPE rdf:RDF"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 ;; 1.2 Peter S Galbraith <psg@debian.org>
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 ;; * Added `newsticker-url-list-defaults', splitting the URLs into
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 ;; a customizable selection list, and a user add-on list.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 ;; * Minor checkdoc fixes.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 ;; 1.1 * Introduced optional feed-specific wget-arguments.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 ;; * Keep order of feeds as given in `newsticker-url-list' in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 ;; *newsticker* buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 ;; * Ignore unsupported coding systems.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 ;; 1.0 * Introduced feed-specific retrieval-timers.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 ;; * Removed dependency on 'cl (cddddr).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
281 ;; * Thanks to Kevin Rodgers and T.V. Raman for their help.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 ;; * Use utf-8 for reading and writing cache data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283 ;; * Reported to work with Emacs 21.3.50.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 ;; 0.99 * Minor tweaks.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 ;; * Tested with Emacs 21.3.2
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 ;; 0.98 * Check exit status of wget processes. Keep cache data if
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 ;; something went wrong. Throw error when old wget-processes
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 ;; are hanging around.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 ;; * Introduced newsticker-specific faces.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 ;; * Added `newsticker-show-descriptions-of-new-items'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293 ;; * Added `newsticker-hide-old-items-in-newsticker-buffer'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 ;; * Added `newsticker-(hide|show)-old-items'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 ;; 0.97 * Minor tweaks.
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 ;; 0.96 * Added caching.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 ;; * newsticker-mode inherits outline-mode.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 ;; * newsticker-mode supports imenu.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 ;; * Easy buffer-navigation with newsticker-mode's keymap.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 ;; * Some bugs fixed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 ;; * Thanks to Moritz Epple for documentation tips.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 ;; 0.95 * Added newsticker-mode -- Thanks to T.V. Raman.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 ;; * Catch xml-parser errors -- Thanks to T.V. Raman.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 ;; * Remove stupid newlines in titles (headlines) -- Thanks to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 ;; Jeff Rancier.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
310 ;; 0.94 * Added clickerability and description for channel headings.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 ;; * Made it work for (at least some) rss 0.9<something> feeds.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 ;; 0.93 * Added some more sites.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 ;; * Do not flood the *Messages* buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 ;; * First attempt at handling coding systems.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 ;; 0.92 * Added `newsticker-wget-name'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 ;; * Try to display message only if minibuffer and echo area are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 ;; not in use already.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 ;; * Dirty workaround for newer versions of xml.el: Remove
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 ;; whitespace in rdf.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 ;; * 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
323
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 ;; 0.91 * First bugfix: *newsticker* is read-only.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 ;; 0.9 * First release.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 ;; * Tested with Emacs 21.3.2 and wget 1.8.2.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 ;;; To Do:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 ;; * Image handling for XEmacs (create-image does not exist)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 ;;; Code:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 (require 'derived)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 (require 'xml)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
340 ;; Silence warnings
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
341 (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
342 (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
343 (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
344
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 ;;; Customizables
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 (defgroup newsticker nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 "RSS aggregator."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 :group 'applications)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 (defconst newsticker--raw-url-list-defaults
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 '(("CNET News.com"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 "http://export.cnet.com/export/feeds/news/rss/1,11176,,00.xml")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 ("Debian Security Advisories"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 "http://www.debian.org/security/dsa.en.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 ("Debian Security Advisories - Long format"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 "http://www.debian.org/security/dsa-long.en.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 ("Emacs Wiki"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360 "http://www.emacswiki.org/cgi-bin/wiki.pl?action=rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 3600)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 ("Freshmeat.net"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
364 "http://freshmeat.net/backend/fm.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
365 ("Kuro5hin.org"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
366 "http://www.kuro5hin.org/backend.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
367 ("LWN (Linux Weekly News)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
368 "http://lwn.net/headlines/rss")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
369 ("NewsForge"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
370 "http://newsforge.com/index.rss")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
371 ("NY Times: Technology"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
372 "http://partners.userland.com/nytRss/technology.xml")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
373 ("NY Times"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
374 "http://partners.userland.com/nytRss/nytHomepage.xml")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
375 ("Quote of the day"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
376 "http://www.quotationspage.com/data/qotd.rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
377 "07:00"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
378 86400)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
379 ("The Register"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
380 "http://www.theregister.co.uk/tonys/slashdot.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
381 ("slashdot"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
382 "http://slashdot.org/index.rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
383 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
384 3600) ;/. will ban you if under 3600 seconds!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
385 ("Wired News"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
386 "http://www.wired.com/news_drop/netcenter/netcenter.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
387 ("Heise News (german)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
388 "http://www.heise.de/newsticker/heise.rdf")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
389 ("Tagesschau (german)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
390 "http://www.tagesschau.de/newsticker.rdf"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
391 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
392 1800)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
393 ("Telepolis (german)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
394 "http://www.heise.de/tp/news.rdf"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
395 "Default URL list in raw form.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
396 This list is fed into defcustom via `newsticker--splicer'.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
397
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
398 (defun newsticker--splicer (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
399 "Convert ITEM for splicing into `newsticker-url-list-defaults'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
400 (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
401 (element (cdr item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
402 (while element
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
403 (setq result (append result (list (list 'const (car element)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
404 (setq element (cdr element)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
405 result))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
406
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
407 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
408 ;;; Customization
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
409 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
410 (defun newsticker--set-customvar (symbol value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
411 "Set newsticker-variable SYMBOL value to VALUE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
412
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
413 Calls all necessary actions which are necessary in order to make
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
414 the new value effective. Changing `newsticker-url-list', for example,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
415 will re-start the retrieval-timers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
416 (unless (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
417 (eq (symbol-value symbol) value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
418 (error nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
419 (set symbol value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
420 (cond ((eq symbol 'newsticker-sort-method)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
421 (when (fboundp 'newsticker--cache-sort)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
422 (message "Applying new sort method...")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
423 (newsticker--cache-sort)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
424 (newsticker--buffer-set-uptodate nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
425 (message "Applying new sort method...done")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 ((memq symbol '(newsticker-url-list-defaults
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 newsticker-url-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428 newsticker-retrieval-interval))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429 (when (and (fboundp 'newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 (newsticker-running-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 (message "Restarting newsticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
432 (newsticker-stop)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
433 (newsticker-start)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
434 ((eq symbol 'newsticker-display-interval)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
435 (when (and (fboundp 'newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
436 (newsticker-running-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
437 (message "Restarting ticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
438 (newsticker-stop-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
439 (newsticker-start-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
440 (message "")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
441 ((memq symbol '(newsticker-hide-old-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
442 newsticker-hide-obsolete-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
443 newsticker-hide-immortal-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
444 (when (and (fboundp 'newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
445 (newsticker-running-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
446 (message "Restarting newsticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
447 (newsticker-stop-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
448 (newsticker--ticker-text-setup)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
449 (newsticker-start-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
450 (message "")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
451 ((memq symbol '(newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
452 newsticker-show-descriptions-of-new-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
453 (when (fboundp 'newsticker--buffer-set-uptodate)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
454 (newsticker--buffer-set-uptodate nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
455 ((memq symbol '(newsticker-heading-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
456 newsticker-item-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
457 newsticker-desc-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
458 newsticker-date-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
459 newsticker-statistics-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
460 newsticker-justification
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
461 newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
462 newsticker-html-renderer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
463 newsticker-feed-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
464 newsticker-new-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
465 newsticker-old-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
466 newsticker-immortal-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
467 newsticker-obsolete-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
468 newsticker-date-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
469 newsticker-statistics-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
470 ;;newsticker-default-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
471 ))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
472 (when (fboundp 'newsticker--forget-preformatted)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
473 (newsticker--forget-preformatted)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
474 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
475 (error "Ooops %s" symbol)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
476
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
477 ;; customization group feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
478 (defgroup newsticker-feed nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
479 "Settings for the RSS feeds."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
480 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
481
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
482 (defcustom newsticker-url-list-defaults
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
483 '(("Emacs Wiki"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
484 "http://www.emacswiki.org/cgi-bin/wiki.pl?action=rss"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
485 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
486 3600))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
487 "A customizable list of news feeds to select from.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
488 These were mostly extracted from the Radio Community Server at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 http://subhonker6.userland.com/rcsPublic/rssHotlist.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491 You may add other entries in `newsticker-url-list'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 :type `(set ,@(mapcar `newsticker--splicer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493 newsticker--raw-url-list-defaults))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
495 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497 (defcustom newsticker-url-list nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498 "The news feeds which you like to watch.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
500 This alist will be used in addition to selection made customizing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 `newsticker-url-list-defaults'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
502
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
503 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
504 optionally followed by a START-TIME, INTERVAL specifier and WGET-ARGUMENTS.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
505
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
506 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
507
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
508 The URL gives the location of the news feed. It must point to a valid
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
509 RSS file. The RSS file is retrieved by calling wget, or whatever you
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
510 specify as `newsticker-wget-name'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
511
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
512 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
513 specifies a fixed time at which this feed shall be retrieved for the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 first time. (Examples: \"11:00pm\", \"23:00\"). If it is nil (or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 unspecified), this feed will be retrieved immediately after calling
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516 `newsticker-start'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
518 The INTERVAL specifies the time between retrievals for this feed. If it
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
519 is nil (or unspecified) the default interval value as set in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
520 `newsticker-retrieval-interval' is used.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
521
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
522 \(newsticker.el calls `run-at-time'. The newsticker-parameters START-TIME
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
523 and INTERVAL correspond to the `run-at-time'-parameters TIME and REPEAT.)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525 WGET-ARGUMENTS specifies arguments for wget (see `newsticker-wget-name')
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526 which apply for this feed only, overriding the value of
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
527 `newsticker-wget-arguments'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
528 :type '(repeat (list :tag "News feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
529 (string :tag "Label")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
530 (string :tag "URI")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
531 (choice :tag "Start"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
532 (const :tag "Default" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
533 (string :tag "Fixed Time"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
534 (choice :tag "Interval"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
535 (const :tag "Default" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
536 (const :tag "Hourly" 3600)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
537 (const :tag "Daily" 86400)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
538 (integer :tag "Interval"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
539 (choice :tag "Wget Arguments"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
540 (const :tag "Default arguments" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
541 (repeat :tag "Special arguments" string))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
542 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
543 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
544
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
545 (defcustom newsticker-wget-name
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
546 "wget"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
547 "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
548 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
549 able to return the contents of a news feed file on stdout."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
550 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
551 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
552
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
553 (defcustom newsticker-wget-arguments
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
554 '("-q" "-O" "-")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
555 "Arguments which are passed to wget.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
556 There is probably no reason to change the default settings, unless you
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
557 are living behind a firewall."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
558 :type '(repeat (string :tag "Argument"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
559 :group 'newsticker-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
560
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
561 (defcustom newsticker-retrieval-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
562 3600
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
563 "Time interval for retrieving new news items (seconds).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
564 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
565 items are retrieved only once!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
566 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
567 make it less than 1800 seconds (30 minutes)!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
568 :type '(choice :tag "Interval"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
569 (const :tag "No automatic retrieval" 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
570 (const :tag "Hourly" 3600)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
571 (const :tag "Daily" 86400)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
572 (integer :tag "Interval"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
573 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
574 :group 'newsticker-feed)
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 (defcustom newsticker-desc-comp-max
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
577 100
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
578 "Relevant length of headline descriptions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
579 This value gives the maximum number of characters which will be
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
580 taken into account when newsticker compares two headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
581 descriptions."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
582 :type 'integer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583 :group 'newsticker-feed)
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 ;; customization group behaviour
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586 (defgroup newsticker-headline-processing nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 "Settings for the automatic processing of RSS headlines."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 (defcustom newsticker-automatically-mark-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592 "Decides whether to automatically mark items as old.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
593 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
594 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
595 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
596 *newsticker* buffer."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
597 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
598 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
599
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
600 (defcustom newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
601 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
602 "Decides whether to automatically mark visited items as old.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
603 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
604 visited, i.e. after pressing RET or mouse2 on the item's
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 headline."
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 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 :group 'newsticker-headline-processing)
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 (defcustom newsticker-keep-obsolete-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
611 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612 "Decides whether to keep unread items which have been removed from feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 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
614 the cache until it is marked as read."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 (defcustom newsticker-obsolete-item-max-age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619 (* 60 60 24)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620 "Maximal age of obsolete items, in seconds.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621 Obsolete items which are older than this value will be silently
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
622 deleted at the next retrieval."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
623 :type 'integer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
624 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
625
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626 (defcustom newsticker-auto-mark-filter
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
627 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
628 "A filter for automatically marking headlines.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
629
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630 This is an alist of the form (FEED-NAME OLD-LIST IMMORTAL-LIST). I.e. each
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
631 element consists of a FEED-NAME and two lists. Each list consists a set of
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
632 regular expressions. The first list contains patterns of headlines which
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
633 will be marked as old. The second list contains patterns of headlines which
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
634 will be marked as immortal.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
635
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
636 This filter is checked after a new headline has been retrieved. If
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
637 FEED-NAME matches the name of the corresponding news feed, both sublists
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
638 are checked: If the title of the headline matches any of the regular
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
639 expressions in OLD-LIST, this headline is marked as old, if it matches any
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
640 of the expressions in IMMORTAL-LIST it is marked as immortal.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
641
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
642 If, for example, `newsticker-auto-mark-filter' looks like
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
643 \((slashdot (\"^Forget me!$\") (\"^Read me$\" \"important\")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
644 then all articles from slashdot are marked as old if they have the title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
645 \"Forget me!\". All articles which have the title \"Read me\" and all
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
646 articles which contain the string \"important\" in their title are marked
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
647 as immortal."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
648 :type '(repeat (list :tag "Feed filter rule"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
649 (string :tag "Feed name")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
650 ;;(choice ,@(mapcar (lambda (i)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
651 ;; (list :tag (car i) (car i)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
652 ;; newsticker-url-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
653 (repeat :tag "Mark as old" string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
654 (repeat :tag "Mark as immortal" string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
655 :group 'newsticker-headline-processing)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
656
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
657 ;; customization group layout
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
658 (defgroup newsticker-layout nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
659 "Settings for layout of the RSS reader."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
660 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
661
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
662 (defcustom newsticker-sort-method
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
663 'sort-by-original-order
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
664 "Sort method for news items.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
665 The following sort methods are available:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
666 * `sort-by-original-order' keeps the order in which the items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
667 appear in the RSS file (please note that for immortal items,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668 which have been removed from the news feed, there is no original
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
669 order),
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
670 * `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
671 the first time. The most recent item is put at top,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
672 * `sort-by-title' will put the items in an alphabetical order."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
673 :type '(choice
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
674 (const :tag "Keep original order" sort-by-original-order)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
675 (const :tag "Sort by time" sort-by-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
676 (const :tag "Sort by title" sort-by-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
677 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
678 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
679
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
680 (defcustom newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
681 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
682 "Decides whether to automatically hide old items in the *newsticker* buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
683 If set to t old items will be completely folded and only new items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
684 will show up in the *newsticker* buffer. Otherwise old as well as new
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
685 items will be visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
686 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
688 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
689
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
690 (defcustom newsticker-show-descriptions-of-new-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 "Whether to automatically show descriptions of new items in *newsticker*.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
693 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
694 unfolded. Otherwise old as well as new items will be folded."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
696 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
698
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
699 (defcustom newsticker-heading-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
700 "%l
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
701 %t %d %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
702 "Format string for feed headings.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
703 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
704 %d The date the feed was retrieved. See `newsticker-date-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
705 %l The logo (image) of the feed. Most RSS feeds provide a small
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
706 image as logo. Newsticker can display them, if Emacs can --
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
707 see `image-types' for a list of supported image types.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
708 %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
709 the title of the feed is used.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
710 %s The statistical data of the feed. See `newsticker-statistics-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
711 %t The title of the feed, i.e. its name."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
713 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716 (defcustom newsticker-item-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
717 "%t %d"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
718 "Format string for news item headlines.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
719 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
720 %d The date the item was (first) retrieved. See `newsticker-date-format'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721 %l The logo (image) of the feed. Most RSS feeds provide a small
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722 image as logo. Newsticker can display them, if Emacs can --
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
723 see `image-types' for a list of supported image types.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
724 %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
725 the title of the feed is used.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726 %t The title of the item."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
727 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
728 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
729 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
730
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
731 (defcustom newsticker-desc-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
732 "%d %c"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
733 "Format string for news descriptions (contents).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
735 %c The contents (description) of the item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
736 %d The date the item was (first) retrieved. See `newsticker-date-format'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
737 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
738 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
739 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
740
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
741 (defcustom newsticker-date-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
742 "(%A, %H:%M)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743 "Format for the date part in item and feed lines.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744 See `format-time-string' for a list of valid specifiers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
745 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
746 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
747 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
748
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
749 (defcustom newsticker-statistics-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
750 "[%n + %i + %o + %O = %a]"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
751 "Format for the statistics part in feed lines.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752 The following printf-like specifiers can be used:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
753 %a The number of all items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
754 %i The number of immortal items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
755 %n The number of new items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
756 %o The number of old items in the feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
757 %O The number of obsolete items in the feed."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
758 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
759 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
760 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
761
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
762 (defcustom newsticker-show-all-rss-elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
763 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
764 "Show all RSS elements."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
765 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
766 ;;:set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
767 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
768
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
769 ;; image related things
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
770 (defcustom newsticker-enable-logo-manipulations
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
771 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
772 "If non-nil newsticker manipulates logo images.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
773 This enables the following image properties: heuristic mask for all
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
774 logos, and laplace-conversion for images without new items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
775 :type 'boolean
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
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
779 ;; rendering
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
780 (defcustom newsticker-justification
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
781 'left
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
782 "How to fill item descriptions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
783 If non-nil newsticker calls `fill-region' to wrap long lines in
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
784 item descriptions. However, if an item description contains HTML
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
785 text and `newsticker-html-renderer' is non-nil, filling is not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
786 done."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
787 :type '(choice :tag "Justification"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
788 (const :tag "No filling" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
789 (const :tag "Left" left)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
790 (const :tag "Right" right)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
791 (const :tag "Center" center)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
792 (const :tag "Full" full))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
793 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
794 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
795
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
796 (defcustom newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
797 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
798 "Decides whether to use the full window width when filling.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
799 If non-nil newsticker sets `fill-column' so that the whole
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
800 window is used when filling. See also `newsticker-justification'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
801 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
802 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
803 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
804
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
805 (defcustom newsticker-html-renderer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
806 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
807 "Function for rendering HTML contents.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
808 If non-nil, newsticker.el will call this function whenever it finds
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
809 HTML-like tags in item descriptions. Possible functions are, for
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
810 example, `w3m-region', `w3-region', and (if you have htmlr.el installed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
811 `newsticker-htmlr-render'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
812
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
813 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
814 run newsticker, you should add one of the following statements to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
815 your .emacs. If you use w3m,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
816
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
817 (autoload 'w3m-region \"w3m\"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
818 \"Render region in current buffer and replace with result.\" t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
819
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
820 or, if you use w3,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
821
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
822 (require 'w3-auto)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
823
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
824 or, if you use htmlr
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
825
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
826 (require 'htmlr)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
827 :type '(choice :tag "Function"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
828 (const :tag "None" nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
829 (const :tag "w3" w3-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
830 (const :tag "w3m" w3m-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
831 (const :tag "htmlr" newsticker-htmlr-render))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
832 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
833 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
834
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
835
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
836 ;; faces
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
837 (defgroup newsticker-faces nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
838 "Settings for the faces of the RSS reader."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
839 :group 'newsticker-layout)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
840
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
841 (defface newsticker-feed-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
842 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
843 (:family "helvetica" :bold t :height 1.2 :foreground "misty rose"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
844 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
845 (:family "helvetica" :bold t :height 1.2 :foreground "black")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
846 "Face for news feeds."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
847 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
848
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
849 (defface newsticker-new-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
850 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
851 (:family "helvetica" :bold t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
852 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
853 (:family "helvetica" :bold t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
854 "Face for old news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
855 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
856
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857 (defface newsticker-old-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
859 (:family "helvetica" :bold t :foreground "orange3"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
860 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
861 (:family "helvetica" :bold t :foreground "red4")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
862 "Face for old news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
863 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
864
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
865 (defface newsticker-immortal-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
866 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
867 (:family "helvetica" :bold t :italic t :foreground "orange"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
868 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
869 (:family "helvetica" :bold t :italic t :foreground "blue")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
870 "Face for immortal news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
871 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
872
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
873 (defface newsticker-obsolete-item-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
874 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
875 (:family "helvetica" :bold t :strike-through t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
876 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
877 (:family "helvetica" :bold t :strike-through t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
878 "Face for old news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
879 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
880
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
881 (defface newsticker-date-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
882 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
883 (:family "helvetica" :italic t :height 0.8))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
884 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
885 (:family "helvetica" :italic t :height 0.8)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
886 "Face for newsticker dates."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
887 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
888
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
889 (defface newsticker-statistics-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
890 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
891 (:family "helvetica" :italic t :height 0.8))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
892 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
893 (:family "helvetica" :italic t :height 0.8)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
894 "Face for newsticker dates."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
895 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
896
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
897 (defface newsticker-enclosure-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
898 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
899 (:bold t :background "orange"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
900 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
901 (:bold t :background "orange")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902 "Face for enclosed elements."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
904
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
905 (defface newsticker-extra-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
906 '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
907 (:italic t :foreground "gray50" :height 0.8))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
908 (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
909 (:italic t :foreground "gray50" :height 0.8)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
910 "Face for newsticker dates."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
911 :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
912
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
913 ;; (defface newsticker-default-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
914 ;; '((((class color) (background dark))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
915 ;; (:inherit default))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
916 ;; (((class color) (background light))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
917 ;; (:inherit default)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
918 ;; "Face for the description of news items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
919 ;; ;;:set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
920 ;; :group 'newsticker-faces)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
921
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 ;; customization group ticker
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
924 (defgroup newsticker-ticker nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
925 "Settings for the RSS ticker."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
926 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
927
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
928 (defcustom newsticker-display-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
929 0.3
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
930 "Time interval for displaying news items in the echo area (seconds).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
931 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
932 smooth display (see `newsticker-scroll-smoothly') a value of 0.3 seems
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
933 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
934 point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
935 :type 'number
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
936 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
937 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
938
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
939 (defcustom newsticker-scroll-smoothly
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
940 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
941 "Decides whether to flash or scroll news items.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
942 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
943 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
944 The variable `newsticker-display-interval' determines how fast this
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
945 display moves/changes and whether headlines are shown in the echo area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
946 at all. If you change `newsticker-scroll-smoothly' you should also change
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
947 `newsticker-display-interval'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
948 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
949 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
950
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
951 (defcustom newsticker-hide-immortal-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
952 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
953 "Decides whether to show immortal/non-expiring news items in the ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
954 If t the echo area will not show immortal items. See also
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
955 `newsticker-hide-old-items-in-echo-area."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
956 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
957 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
958 :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
959
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
960 (defcustom newsticker-hide-old-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
961 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
962 "Decides whether to show only the newest news items in the ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
963 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
964 been added between the last two retrievals."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
965 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
966 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
967 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
968
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
969 (defcustom newsticker-hide-obsolete-items-in-echo-area
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
970 t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
971 "Decides whether to show obsolete items items in the ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
972 If t the echo area will not show obsolete items. See also
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
973 `newsticker-hide-old-items-in-echo-area."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
974 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
975 :set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
976 :group 'newsticker-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
977
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
978 (defgroup newsticker-hooks nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
979 "Settings for newsticker hooks."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
980 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
981
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
982 (defcustom newsticker-start-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
983 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
984 "Hook run when starting newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
985 This hook is run at the very end of `newsticker-start'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
986 :options '(newsticker-start-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
987 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
988 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
989
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
990 (defcustom newsticker-stop-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
991 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
992 "Hook run when stopping newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
993 This hook is run at the very end of `newsticker-stop'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
994 :options nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
995 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
996 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
997
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
998 (defcustom newsticker-new-item-functions
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
999 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1000 "List of functions run after a new headline has been retrieved.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1001 Each function is called with the following three arguments:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1002 FEED the name of the corresponding news feed,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1003 TITLE the title of the headline,
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1004 DESC the decoded description of the headline.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1005
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1006 See `newsticker-download-images', and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1007 `newsticker-download-enclosures' for sample functions.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1008
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1009 Please note that these functions are called only once for a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1010 headline after it has been retrieved for the first time."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1011 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1012 :options '(newsticker-download-images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1013 newsticker-download-enclosures)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1014 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1015
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1016 (defcustom newsticker-select-item-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1017 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1018 "List of functions run after a headline has been selected.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1019 Each function is called after one of `newsticker-next-item',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1020 `newsticker-next-new-item', `newsticker-previous-item',
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1021 `newsticker-previous-new-item' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1022
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023 The default value 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1024 assures that the current item is always completely visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1025 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1026 :options '(newsticker--buffer-make-item-completely-visible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1027 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1028
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1029 (defcustom newsticker-select-feed-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1030 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1031 "List of functions run after a feed has been selected.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1032 Each function is called after one of `newsticker-next-feed', and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1033 `newsticker-previous-feed' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1034
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1035 The default value 'newsticker--buffer-make-item-completely-visible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1036 assures that the current feed is completely visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1037 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1038 :options '(newsticker--buffer-make-item-completely-visible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1039 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1040
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1041 (defcustom newsticker-buffer-change-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1042 'newsticker-w3m-show-inline-images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1043 "List of functions run after the newsticker buffer has been updated.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1044 Each function is called after `newsticker-buffer-update' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1045
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1046 The default value '`newsticker-w3m-show-inline-images' loads inline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1047 images."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1048 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1049 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1050
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1051 (defcustom newsticker-narrow-hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1052 'newsticker-w3m-show-inline-images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1053 "List of functions run after narrowing in newsticker buffer has changed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1054 Each function is called after
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1055 `newsticker-toggle-auto-narrow-to-feed' or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1056 `newsticker-toggle-auto-narrow-to-item' has been called.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1057
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1058 The default value '`newsticker-w3m-show-inline-images' loads inline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1059 images."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1060 :type 'hook
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1061 :group 'newsticker-hooks)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1062
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1063 (defgroup newsticker-miscellaneous nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1064 "Miscellaneous newsticker settings."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1065 :group 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1066
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1067 (defcustom newsticker-cache-filename
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1068 "~/.newsticker-cache"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1069 "Name of the newsticker cache file."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1070 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1071 :group 'newsticker-miscellaneous)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1072
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1073 (defcustom newsticker-imagecache-dirname
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1074 "~/.newsticker-images"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1075 "Name of the directory where newsticker stores cached images."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1076 :type 'string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1077 :group 'newsticker-miscellaneous)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1078
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1079 ;; debugging
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1080 (defcustom newsticker-debug
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1081 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1082 "Enables some features needed for debugging newsticker.el.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1083
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1084 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
1085 buffers *newsticker-wget-<feed>* will not be closed."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1086 :type 'boolean
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1087 ;;:set 'newsticker--set-customvar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1088 :group 'newsticker-miscellaneous)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1089
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1090 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1091 ;;; Compatibility section, XEmacs, Emacs
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1092 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1093 (unless (fboundp 'time-add)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1094 (require 'time-date);;FIXME
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1095 (defun time-add (t1 t2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1096 (seconds-to-time (+ (time-to-seconds t1) (time-to-seconds t2)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1097
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1098 (unless (fboundp 'match-string-no-properties)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1099 (defalias 'match-string-no-properties 'match-string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1100
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1101 (unless (fboundp 'replace-regexp-in-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1102 (defun replace-regexp-in-string (re rp st)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1103 (save-match-data ;; apparently XEmacs needs save-match-data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1104 (replace-in-string st re rp))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1105
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1106 ;; copied from subr.el
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1107 (unless (fboundp 'add-to-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1108 (defun add-to-invisibility-spec (arg)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1109 "Add elements to `buffer-invisibility-spec'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1110 See documentation for `buffer-invisibility-spec' for the kind of elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1111 that can be added."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1112 (if (eq buffer-invisibility-spec t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1113 (setq buffer-invisibility-spec (list t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1114 (setq buffer-invisibility-spec
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1115 (cons arg buffer-invisibility-spec))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1116
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1117 ;; copied from subr.el
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1118 (unless (fboundp 'remove-from-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1119 (defun remove-from-invisibility-spec (arg)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1120 "Remove elements from `buffer-invisibility-spec'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1121 (if (consp buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1122 (setq buffer-invisibility-spec (delete arg buffer-invisibility-spec)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1123
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1124 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1125 ;;; Internal variables
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1126 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1127 (defvar newsticker--display-timer nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1128 "Timer for newsticker display.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1129 (defvar newsticker--retrieval-timer-list nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1130 "List of timers for news retrieval.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1131 This is an alist, each element consisting of (feed-name . timer)")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1132 (defvar newsticker--item-list nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1133 "List of newsticker items.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1134 (defvar newsticker--item-position 0
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1135 "Actual position in list of newsticker items.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1136 (defvar newsticker--prev-message "There was no previous message yet!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1137 "Last message that the newsticker displayed.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1138 (defvar newsticker--scrollable-text ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1139 "The text which is scrolled smoothly in the echo area.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1140 (defvar newsticker--buffer-uptodate-p nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1141 "Tells whether the newsticker buffer is up to date.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1142 (defvar newsticker--latest-update-time (current-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1143 "The time at which the latest news arrived.")
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 (defvar newsticker--cache nil "Cached newsticker data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1146 This is a list of the form
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1147
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1148 ((label1
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1149 (title description link time age index preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1150 preformatted-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1151 ...)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1152 (label2
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1153 (title description link time age index preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1154 preformatted-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1155 ...)
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
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1158 where LABEL is a symbol. TITLE, DESCRIPTION, and LINK are
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1159 strings. TIME is a time value as returned by `current-time'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1160 AGE is a symbol: 'new, 'old, 'immortal, and 'obsolete denote
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1161 ordinary news items, whereas 'feed denotes an item which is not a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1162 headline but describes the feed itself. INDEX denotes the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1163 original position of the item -- used for restoring the original
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1164 order. PREFORMATTED-CONTENTS and PREFORMATTED-TITLE hold the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1165 formatted contents of the item's description and title. This
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1166 speeds things up if HTML rendering is used, which is rather
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1167 slow.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1168
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1169 (defvar newsticker--auto-narrow-to-feed nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1170 "Automatically narrow to current news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1171 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
1172
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1173 (defvar newsticker--auto-narrow-to-item nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1174 "Automatically narrow to current news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1175 If non-nil only the current headline is visible.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1176
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1177 (defconst newsticker--error-headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1178 "[COULD NOT DOWNLOAD HEADLINES!]"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1179 "Title of error headline which will be inserted if news retrieval fails.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1180
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1181 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1182 ;;; Toolbar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1183 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1184 (defconst newsticker--next-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1185 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1186 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1187 static char * next_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1188 \"24 24 42 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1189 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1190 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1191 \"+ c #7EB6DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1192 \"@ c #82BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1193 \"# c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1194 \"$ c #88C1E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1195 \"% c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1196 \"& c #87C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1197 \"* c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1198 \"= c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1199 \"- c #8CC6EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1200 \"; c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1201 \"> c #8BC5E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1202 \", c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1203 \"' c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1204 \") c #8AC4E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1205 \"! c #8BC5EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1206 \"~ c #8BC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1207 \"{ c #88C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1208 \"] c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1209 \"^ c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1210 \"/ c #83BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1211 \"( c #82BBE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1212 \"_ c #86C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1213 \": c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1214 \"< c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1215 \"[ c #81B9E0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1216 \"} c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1217 \"| c #78B0D9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1218 \"1 c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1219 \"2 c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1220 \"3 c #7DB6DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1221 \"4 c #72A9D4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1222 \"5 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1223 \"6 c #76AED7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1224 \"7 c #77AFD8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1225 \"8 c #6BA1CD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1226 \"9 c #6EA4CF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1227 \"0 c #6FA6D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1228 \"a c #6298C6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1229 \"b c #659BC8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1230 \"c c #5C91C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1231 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1232 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1233 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1234 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1235 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1236 \" .@#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1237 \" .#$%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1238 \" .&*=-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1239 \" .;>,,,. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1240 \" .;>,,,=. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1241 \" .')!==~;. \",
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 \" .(#_':#<. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1244 \" .+[@</}. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1245 \" .|1232. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1246 \" .4567. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1247 \" .890. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1248 \" .ab. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1249 \" .c. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1250 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1251 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1252 \" \",
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 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1257 "Image for the next item button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1258
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1259 (defconst newsticker--previous-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1260 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1261 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1262 static char * previous_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1263 \"24 24 39 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1264 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1265 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1266 \"+ c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1267 \"@ c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1268 \"# c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1269 \"$ c #89C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1270 \"% c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1271 \"& c #83BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1272 \"* c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1273 \"= c #8BC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1274 \"- c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1275 \"; c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1276 \"> c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1277 \", c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1278 \"' c #8AC4E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1279 \") c #8BC5EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1280 \"! c #88C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1281 \"~ c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1282 \"{ c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1283 \"] c #86C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1284 \"^ c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1285 \"/ c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1286 \"( c #82BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1287 \"_ c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1288 \": c #7FB7DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1289 \"< c #7DB6DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1290 \"[ c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1291 \"} c #7CB4DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1292 \"| c #79B1DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1293 \"1 c #76ADD7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1294 \"2 c #77AFD8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1295 \"3 c #73AAD4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1296 \"4 c #70A7D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1297 \"5 c #6EA5D0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1298 \"6 c #6CA2CE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1299 \"7 c #689ECB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1300 \"8 c #6399C7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1301 \"9 c #6095C4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1302 \"0 c #5C90C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1303 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1304 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1305 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1306 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1307 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1308 \" .@#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1309 \" .$%&. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1310 \" .*=-;. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1311 \" .>>*,%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1312 \" .>>>*,%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1313 \" .')**=-;. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1314 \" .;!,~{-%&. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1315 \" .;]^/;@#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1316 \" .(@&_:+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1317 \" .<[}|1. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1318 \" .2134. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1319 \" .567. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1320 \" .89. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1321 \" .0. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1322 \" .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1323 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1324 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1325 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1326 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1327 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1328 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1329 "Image for the previous item button."))
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 (defconst newsticker--previous-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1332 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1333 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1334 static char * prev_feed_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1335 \"24 24 52 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1336 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1337 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1338 \"+ c #70A7D2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1339 \"@ c #75ADD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1340 \"# c #71A8D3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1341 \"$ c #79B1DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1342 \"% c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1343 \"& c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1344 \"* c #83BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1345 \"= c #7EB6DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1346 \"- c #78B0D9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1347 \"; c #7FB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1348 \"> c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1349 \", c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1350 \"' c #80B9E0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1351 \") c #80B8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1352 \"! c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1353 \"~ c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1354 \"{ c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1355 \"] c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1356 \"^ c #7CB4DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1357 \"/ c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1358 \"( c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1359 \"_ c #7BB3DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1360 \": c #7EB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1361 \"< c #8BC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1362 \"[ c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1363 \"} c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1364 \"| c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1365 \"1 c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1366 \"2 c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1367 \"3 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1368 \"4 c #7FB7DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1369 \"5 c #77AED8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1370 \"6 c #71A8D2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1371 \"7 c #70A7D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1372 \"8 c #76ADD7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1373 \"9 c #6CA2CE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1374 \"0 c #699FCC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1375 \"a c #73AAD4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1376 \"b c #6BA1CD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1377 \"c c #669CC9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1378 \"d c #6298C5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1379 \"e c #689ECB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1380 \"f c #6499C7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1381 \"g c #6095C3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1382 \"h c #5C91C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1383 \"i c #5E93C2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1384 \"j c #5B90C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1385 \"k c #588CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1386 \"l c #578CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1387 \"m c #5589BA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1388 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1389 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1390 \" ... . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1391 \" .+. .. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1392 \" .@. .#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1393 \" .$. .%@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1394 \" .&. .*=-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1395 \" .;. .>,'%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1396 \" .). .!~{]^. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1397 \" ./. .(!~{]_. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1398 \" .:. .!!<>,'%. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1399 \" .&. .~[}>{*=-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1400 \" .$. .|1,2/%@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1401 \" .3. .*]4%56. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1402 \" .7. .^$8#9. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1403 \" .0. .a7bc. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1404 \" .d. .efg. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1405 \" .h. .ij. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1406 \" .k. .l. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1407 \" .m. .. \",
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 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1414 "Image for the previous feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1415
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1416 (defconst newsticker--next-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1417 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1418 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1419 static char * next_feed_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1420 \"24 24 57 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1421 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1422 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1423 \"+ c #6CA2CE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1424 \"@ c #75ADD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1425 \"# c #71A8D3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1426 \"$ c #79B1DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1427 \"% c #7EB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1428 \"& c #7DB5DD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1429 \"* c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1430 \"= c #85BEE4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1431 \"- c #78B0D9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1432 \"; c #7FB7DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1433 \"> c #83BCE3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1434 \", c #87C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1435 \"' c #8AC4E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1436 \") c #7BB3DB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1437 \"! c #80B8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1438 \"~ c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1439 \"{ c #8BC5E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1440 \"] c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1441 \"^ c #7CB4DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1442 \"/ c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1443 \"( c #84BDE3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1444 \"_ c #7BB3DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1445 \": c #83BCE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1446 \"< c #87C0E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1447 \"[ c #8AC4E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1448 \"} c #8BC5EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1449 \"| c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1450 \"1 c #88C1E6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1451 \"2 c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1452 \"3 c #8AC3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1453 \"4 c #7EB6DE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1454 \"5 c #82BBE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1455 \"6 c #86C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1456 \"7 c #87C0E5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1457 \"8 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1458 \"9 c #7AB2DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1459 \"0 c #81B9E0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1460 \"a c #82BBE2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1461 \"b c #71A8D2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1462 \"c c #70A7D1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1463 \"d c #74ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1464 \"e c #699FCC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1465 \"f c #6EA5D0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1466 \"g c #72A9D4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1467 \"h c #669CC9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1468 \"i c #6298C5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1469 \"j c #679DCA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1470 \"k c #6BA1CD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1471 \"l c #6095C3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1472 \"m c #5C91C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1473 \"n c #5F94C2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1474 \"o c #5B90C0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1475 \"p c #588CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1476 \"q c #578CBC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1477 \"r c #5589BA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1478 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1479 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1480 \" . ... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1481 \" .. .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1482 \" .@. .#. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1483 \" .$%. .@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1484 \" .&*=. .-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1485 \" .;>,'. .). \",
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 \" .&*=12'3~. .-. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1490 \" .$45=6<7. .@. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1491 \" .8940a:. .b. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1492 \" .cd-)&. .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1493 \" .efg8. .h. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1494 \" .ijk. .l. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1495 \" .mn. .o. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1496 \" .p. .q. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1497 \" .. .r. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1498 \" . ... \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1499 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1500 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1501 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1502 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1503 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1504 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1505
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1506 (defconst newsticker--mark-read-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1507 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1508 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1509 static char * mark_read_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1510 \"24 24 44 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1511 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1512 \". c #C20000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1513 \"+ c #BE0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1514 \"@ c #C70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1515 \"# c #CE0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1516 \"$ c #C90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1517 \"% c #BD0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1518 \"& c #CB0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1519 \"* c #D10000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1520 \"= c #D70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1521 \"- c #D30000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1522 \"; c #CD0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1523 \"> c #C60000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1524 \", c #D40000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1525 \"' c #DA0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1526 \") c #DE0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1527 \"! c #DB0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1528 \"~ c #D60000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1529 \"{ c #D00000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1530 \"] c #DC0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1531 \"^ c #E00000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1532 \"/ c #E40000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1533 \"( c #E10000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1534 \"_ c #DD0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1535 \": c #D80000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1536 \"< c #E50000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1537 \"[ c #E70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1538 \"} c #E60000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1539 \"| c #E20000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1540 \"1 c #E90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1541 \"2 c #E80000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1542 \"3 c #E30000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1543 \"4 c #DF0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1544 \"5 c #D90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1545 \"6 c #CC0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1546 \"7 c #C10000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1547 \"8 c #C30000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1548 \"9 c #BF0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1549 \"0 c #B90000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1550 \"a c #BC0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1551 \"b c #BB0000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1552 \"c c #B80000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1553 \"d c #B50000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1554 \"e c #B70000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1555 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1556 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1557 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1558 \" . + \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1559 \" +@# $.% \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1560 \" &*= -;> \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1561 \" ,') !~{ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1562 \" ]^/ (_: \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1563 \" (<[ }|) \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1564 \" <[1 2<| \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1565 \" }222[< \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1566 \" }}}< \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1567 \" 333| \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1568 \" _4^4)] \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1569 \" ~:' 5=- \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1570 \" 6{- *#$ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1571 \" 7>$ @89 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1572 \" 0a+ %bc \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1573 \" ddc edd \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1574 \" ddd ddd \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1575 \" d d \",
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 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1581 "Image for the next feed button."))
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 (defconst newsticker--mark-immortal-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1584 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1585 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1586 static char * mark_immortal_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1587 \"24 24 93 2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1588 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1589 \". c #171717\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1590 \"+ c #030303\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1591 \"@ c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1592 \"# c #181818\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1593 \"$ c #090909\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1594 \"% c #FFC960\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1595 \"& c #FFCB61\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1596 \"* c #FFCB62\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1597 \"= c #FFC961\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1598 \"- c #FFC75F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1599 \"; c #FFC65E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1600 \"> c #FFCA61\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1601 \", c #FFCD63\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1602 \"' c #FFCF65\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1603 \") c #FFD065\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1604 \"! c #FFCE64\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1605 \"~ c #FFC35C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1606 \"{ c #FFC45D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1607 \"] c #FFD166\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1608 \"^ c #FFD267\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1609 \"/ c #FFD368\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1610 \"( c #FFD167\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1611 \"_ c #FFC05A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1612 \": c #010101\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1613 \"< c #040404\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1614 \"[ c #FFCC62\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1615 \"} c #FFD569\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1616 \"| c #FFD56A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1617 \"1 c #FFC860\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1618 \"2 c #FFC25B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1619 \"3 c #FFBB56\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1620 \"4 c #020202\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1621 \"5 c #060606\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1622 \"6 c #FFC15B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1623 \"7 c #FFC85F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1624 \"8 c #FFD469\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1625 \"9 c #FFD66A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1626 \"0 c #FFBC57\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1627 \"a c #1B1B1B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1628 \"b c #070707\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1629 \"c c #FFBA55\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1630 \"d c #FFB451\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1631 \"e c #FFB954\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1632 \"f c #FFB350\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1633 \"g c #FFB652\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1634 \"h c #FFBE58\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1635 \"i c #FFCD64\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1636 \"j c #FFD066\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1637 \"k c #FFC059\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1638 \"l c #FFB14E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1639 \"m c #0B0B0B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1640 \"n c #FFBB55\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1641 \"o c #FFC15A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1642 \"p c #FFB552\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1643 \"q c #FFAD4B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1644 \"r c #080808\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1645 \"s c #FFAF4C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1646 \"t c #FFB853\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1647 \"u c #FFA948\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1648 \"v c #050505\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1649 \"w c #FFB04E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1650 \"x c #FFB753\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1651 \"y c #FFBC56\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1652 \"z c #FFC55D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1653 \"A c #FFC55E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1654 \"B c #FFC45C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1655 \"C c #FFBD57\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1656 \"D c #FFB854\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1657 \"E c #FFB34F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1658 \"F c #FFAB4A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1659 \"G c #FFA545\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1660 \"H c #FFAA49\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1661 \"I c #FFB04D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1662 \"J c #FFB551\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1663 \"K c #FFBF58\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1664 \"L c #FFB24F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1665 \"M c #FFAC4A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1666 \"N c #FFA646\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1667 \"O c #FFA344\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1668 \"P c #FFA848\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1669 \"Q c #FFB14F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1670 \"R c #FFAF4D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1671 \"S c #FFA546\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1672 \"T c #FFA243\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1673 \"U c #FFA445\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1674 \"V c #FFAE4C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1675 \"W c #FFA444\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1676 \"X c #FFA142\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1677 \"Y c #FF9F41\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1678 \"Z c #0A0A0A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1679 \"` c #FF9E40\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1680 \" . c #FF9F40\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1681 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1682 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1683 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1684 \" . + @ @ + # \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1685 \" $ @ % & * * = - + + \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1686 \" @ ; > , ' ) ' ! * - ~ @ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1687 \" @ { > ! ] ^ / / ( ' * ; _ : \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1688 \" < _ ; [ ) / } | } / ] , 1 2 3 4 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1689 \" 5 6 7 , ] 8 9 9 9 } ^ ! = ~ 0 a \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1690 \" b c 6 - , ] 8 9 9 9 } ^ ! % ~ 0 d 5 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1691 \" : e _ ; * ) / 8 } } / ] , 1 2 3 f 5 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1692 \" : g h { = i j ^ / ^ ] ! * ; k e l m \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1693 \" : f n o ; > , ' ) ' ! * - 2 0 p q r \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1694 \" : s g 0 6 ; % > * * = - ~ h t l u r \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1695 \" 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
1696 \" 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
1697 \" 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
1698 \" @ T U P F q V q M H N W X + \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1699 \" @ Y T O W G G W O X Y @ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1700 \" 4 Z ` Y Y Y .` 4 4 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1701 \" 5 : : @ @ Z \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1702 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1703 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1704 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1705 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1706 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1707 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1708
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1709
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1710 (defconst newsticker--narrow-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1711 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1712 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1713 static char * narrow_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1714 \"24 24 48 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1715 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1716 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1717 \"+ c #969696\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1718 \"@ c #9E9E9E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1719 \"# c #A4A4A4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1720 \"$ c #AAAAAA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1721 \"% c #AEAEAE\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1722 \"& c #B1B1B1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1723 \"* c #B3B3B3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1724 \"= c #B4B4B4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1725 \"- c #B2B2B2\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1726 \"; c #AFAFAF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1727 \"> c #ABABAB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1728 \", c #A6A6A6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1729 \"' c #A0A0A0\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1730 \") c #989898\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1731 \"! c #909090\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1732 \"~ c #73AAD4\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1733 \"{ c #7AB2DA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1734 \"] c #7FB8DF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1735 \"^ c #84BDE3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1736 \"/ c #88C2E7\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1737 \"( c #8BC5E9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1738 \"_ c #8DC7EB\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1739 \": c #8CC6EA\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1740 \"< c #89C3E8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1741 \"[ c #86BFE5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1742 \"} c #81BAE1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1743 \"| c #7BB3DC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1744 \"1 c #75ACD6\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1745 \"2 c #6DA4CF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1746 \"3 c #979797\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1747 \"4 c #A3A3A3\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1748 \"5 c #A8A8A8\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1749 \"6 c #ADADAD\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1750 \"7 c #ACACAC\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1751 \"8 c #A9A9A9\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1752 \"9 c #A5A5A5\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1753 \"0 c #9A9A9A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1754 \"a c #929292\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1755 \"b c #8C8C8C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1756 \"c c #808080\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1757 \"d c #818181\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1758 \"e c #838383\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1759 \"f c #848484\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1760 \"g c #858585\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1761 \"h c #868686\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1762 \"i c #828282\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1763 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1764 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1765 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1766 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1767 \" .+@#$%&*=*-;>,')!. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1768 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1769 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1770 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1771 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1772 \" .~{]^/(___:<[}|12. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1773 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1774 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1775 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1776 \" .................. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1777 \" .!3@45>666789'0ab. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1778 \" .................. \",
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 \" .cccdefghhgficccc. \",
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 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1787 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1788 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1789 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1790
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1791 (defconst newsticker--get-all-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1792 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1793 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1794 static char * get_all_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1795 \"24 24 70 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1796 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1797 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1798 \"+ c #F3DA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1799 \"@ c #F5DF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1800 \"# c #F7E300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1801 \"$ c #F9E700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1802 \"% c #FAEA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1803 \"& c #FBEC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1804 \"* c #FBED00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1805 \"= c #FCEE00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1806 \"- c #FAEB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1807 \"; c #F9E800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1808 \"> c #F8E500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1809 \", c #F6E000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1810 \"' c #F4DB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1811 \") c #F1D500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1812 \"! c #EFD000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1813 \"~ c #B7CA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1814 \"{ c #BFD100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1815 \"] c #C5D700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1816 \"^ c #CBDB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1817 \"/ c #CFDF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1818 \"( c #D2E200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1819 \"_ c #D4E400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1820 \": c #D3E300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1821 \"< c #D0E000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1822 \"[ c #CCDD00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1823 \"} c #C7D800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1824 \"| c #C1D300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1825 \"1 c #BACC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1826 \"2 c #B1C500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1827 \"3 c #A8BC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1828 \"4 c #20A900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1829 \"5 c #22AF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1830 \"6 c #24B500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1831 \"7 c #26B900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1832 \"8 c #27BC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1833 \"9 c #27BE00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1834 \"0 c #28BF00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1835 \"a c #27BD00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1836 \"b c #26BA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1837 \"c c #25B600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1838 \"d c #23B100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1839 \"e c #21AB00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1840 \"f c #1FA400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1841 \"g c #1C9B00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1842 \"h c #21AA00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1843 \"i c #24B300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1844 \"j c #25B800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1845 \"k c #25B700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1846 \"l c #24B400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1847 \"m c #23B000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1848 \"n c #1FA500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1849 \"o c #1D9E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1850 \"p c #20A800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1851 \"q c #21AC00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1852 \"r c #23B200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1853 \"s c #22AD00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1854 \"t c #1D9F00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1855 \"u c #20A700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1856 \"v c #1EA100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1857 \"w c #1C9C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1858 \"x c #1DA000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1859 \"y c #1B9800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1860 \"z c #1A9600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1861 \"A c #1A9700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1862 \"B c #1A9500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1863 \"C c #199200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1864 \"D c #189100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1865 \"E c #178C00\",
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 \" ................... \",
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 \" .~{]^/(___:<[}|123. \",
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 \" .45678909abcdefg. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1880 \" .h5icj7jklmeno. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1881 \" .pq5drrmshft. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1882 \" .fu4h4pnvw. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1883 \" .oxvxtwy. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1884 \" .zAAzB. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1885 \" .CCD. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1886 \" .E. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1887 \" . \",
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 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1890 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1891 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1892 "Image for the next feed button."))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1893
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1894
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1895 (defconst newsticker--update-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1896 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1897 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1898 static char * update_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1899 \"24 24 37 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1900 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1901 \". c #076D00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1902 \"+ c #0A8600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1903 \"@ c #0A8800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1904 \"# c #098400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1905 \"$ c #087200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1906 \"% c #087900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1907 \"& c #098500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1908 \"* c #098100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1909 \"= c #087600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1910 \"- c #097E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1911 \"; c #097F00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1912 \"> c #0A8700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1913 \", c #0A8C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1914 \"' c #097C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1915 \") c #098300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1916 \"! c #0A8900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1917 \"~ c #0A8E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1918 \"{ c #0B9200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1919 \"] c #087700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1920 \"^ c #076E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1921 \"/ c #076C00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1922 \"( c #076B00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1923 \"_ c #076A00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1924 \": c #076900\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1925 \"< c #076800\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1926 \"[ c #066700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1927 \"} c #066500\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1928 \"| c #066400\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1929 \"1 c #066300\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1930 \"2 c #066600\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1931 \"3 c #066200\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1932 \"4 c #076700\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1933 \"5 c #065E00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1934 \"6 c #066100\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1935 \"7 c #065F00\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1936 \"8 c #066000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1937 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1938 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1939 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1940 \" . +@@@+# \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1941 \" $% &@ +* \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1942 \" =-# ; \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1943 \" %*>, ' \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1944 \" ')!~{ = \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1945 \" ]$ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1946 \" ^ ^ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1947 \" . . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1948 \" / ( \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1949 \" _ : \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1950 \" < [ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1951 \" } | \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1952 \" [[ \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1953 \" 1 $.:23 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1954 \" 3 4}35 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1955 \" 6 655 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1956 \" 76 85 55 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1957 \" 5555555 5 \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1958 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1959 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1960 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1961 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1962 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1963 "Image for the update button."))
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 (defconst newsticker--browse-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1966 (if (fboundp 'create-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1967 (create-image "/* XPM */
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1968 static char * visit_xpm[] = {
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1969 \"24 24 39 1\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1970 \" c None\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1971 \". c #000000\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1972 \"+ c #FFFFFF\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1973 \"@ c #00E63D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1974 \"# c #00E83E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1975 \"$ c #00E73D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1976 \"% c #00E93E\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1977 \"& c #00E63C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1978 \"* c #00E53C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1979 \"= c #00E23B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1980 \"- c #00E33B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1981 \"; c #00E83D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1982 \"> c #00E13A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1983 \", c #00DD38\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1984 \"' c #00DE38\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1985 \") c #00E23A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1986 \"! c #00E43C\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1987 \"~ c #00DF39\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1988 \"{ c #00DB37\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1989 \"] c #00D634\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1990 \"^ c #00D734\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1991 \"/ c #00E039\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1992 \"( c #00DC37\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1993 \"_ c #00D835\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1994 \": c #00D332\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1995 \"< c #00CD2F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1996 \"[ c #00DB36\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1997 \"} c #00D433\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1998 \"| c #00CF30\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1999 \"1 c #00DA36\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2000 \"2 c #00D936\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2001 \"3 c #00D533\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2002 \"4 c #00D131\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2003 \"5 c #00CE2F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2004 \"6 c #00CC2F\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2005 \"7 c #00CA2D\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2006 \"8 c #00C62B\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2007 \"9 c #00C52A\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2008 \"0 c #00BE27\",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2009 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2010 \" \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2011 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2012 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2013 \" .+++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2014 \" .++.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2015 \" .++.@.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2016 \" .++.##$.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2017 \" .++.%%%#&.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2018 \" .++.$%%%#*=.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2019 \" .++.-@;##$*>,.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2020 \" .++.')!&@@*=~{].++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2021 \" .++.^{~>---)/(_:<.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2022 \" .++.^[,~/~'(_}|.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2023 \" .++.]_1[12^:|.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2024 \" .++.:}33:45.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2025 \" .++.<5567.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2026 \" .++.889.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2027 \" .++.0.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2028 \" .++.++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2029 \" .+++. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2030 \" .+. \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2031 \" . \",
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2032 \" \"};
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2033 "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2034 'xpm t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2035 "Image for the browse button."))
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 (defvar newsticker-tool-bar-map
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2039 (if (featurep 'xemacs)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2040 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2041 (let ((tool-bar-map (make-sparse-keymap)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2042 (define-key tool-bar-map [newsticker-sep-1]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2043 (list 'menu-item "--double-line"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2044 (define-key tool-bar-map [newsticker-browse-url]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2045 (list 'menu-item "newsticker-browse-url" 'newsticker-browse-url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2046 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2047 :help "Browse URL for item at point"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2048 :image newsticker--browse-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2049 (define-key tool-bar-map [newsticker-buffer-force-update]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2050 (list 'menu-item "newsticker-buffer-force-update"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2051 'newsticker-buffer-force-update
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2052 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2053 :help "Update newsticker buffer"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2054 :image newsticker--update-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2055 :enable '(not newsticker--buffer-uptodate-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2056 (define-key tool-bar-map [newsticker-get-all-news]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2057 (list 'menu-item "newsticker-get-all-news" 'newsticker-get-all-news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2058 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2059 :help "Get news for all feeds"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2060 :image newsticker--get-all-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2061 (define-key tool-bar-map [newsticker-mark-item-at-point-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2062 (list 'menu-item "newsticker-mark-item-at-point-as-read"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2063 'newsticker-mark-item-at-point-as-read
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2064 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2065 :image newsticker--mark-read-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2066 :help "Mark current item as read"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2067 :enable '(newsticker-item-not-old-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2068 (define-key tool-bar-map [newsticker-mark-item-at-point-as-immortal]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2069 (list 'menu-item "newsticker-mark-item-at-point-as-immortal"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2070 'newsticker-mark-item-at-point-as-immortal
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2071 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2072 :image newsticker--mark-immortal-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2073 :help "Mark current item as immortal"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2074 :enable '(newsticker-item-not-immortal-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2075 (define-key tool-bar-map [newsticker-toggle-auto-narrow-to-feed]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2076 (list 'menu-item "newsticker-toggle-auto-narrow-to-feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2077 'newsticker-toggle-auto-narrow-to-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2078 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2079 :help "Toggle visibility of other feeds"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2080 :image newsticker--narrow-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2081 (define-key tool-bar-map [newsticker-next-feed]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2082 (list 'menu-item "newsticker-next-feed" 'newsticker-next-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2083 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2084 :help "Go to next feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2085 :image newsticker--next-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2086 :enable '(newsticker-next-feed-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2087 (define-key tool-bar-map [newsticker-next-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2088 (list 'menu-item "newsticker-next-item" 'newsticker-next-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2089 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2090 :help "Go to next item"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2091 :image newsticker--next-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2092 :enable '(newsticker-next-item-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2093 (define-key tool-bar-map [newsticker-previous-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2094 (list 'menu-item "newsticker-previous-item" 'newsticker-previous-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2095 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2096 :help "Go to previous item"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2097 :image newsticker--previous-item-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2098 :enable '(newsticker-previous-item-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2099 (define-key tool-bar-map [newsticker-previous-feed]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2100 (list 'menu-item "newsticker-previous-feed" 'newsticker-previous-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2101 :visible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2102 :help "Go to previous feed"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2103 :image newsticker--previous-feed-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2104 :enable '(newsticker-previous-feed-available-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2105 ;; standard icons / actions
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2106 (tool-bar-add-item "close"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2107 'newsticker-close-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2108 'newsticker-close-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2109 :help "Close newsticker buffer")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2110 (tool-bar-add-item "preferences"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2111 'newsticker-customize
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2112 'newsticker-customize
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2113 :help "Customize newsticker")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2114 tool-bar-map)))
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 ;;; Newsticker mode
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 (define-derived-mode newsticker-mode fundamental-mode
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2121 "NewsTicker"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2122 "Viewing RSS news feeds in Emacs."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2123 (set (make-local-variable 'tool-bar-map) newsticker-tool-bar-map)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2124 (set (make-local-variable 'imenu-sort-function) nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2125 (set (make-local-variable 'scroll-conservatively) 999)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2126 (setq imenu-create-index-function 'newsticker--imenu-create-index)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2127 (setq imenu-default-goto-function 'newsticker--imenu-goto)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2128 (setq buffer-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2129 (auto-fill-mode -1) ;; turn auto-fill off!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2130 (font-lock-mode -1) ;; turn off font-lock!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2131 (set (make-local-variable 'font-lock-defaults) nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2132 (set (make-local-variable 'line-move-ignore-invisible) t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2133 (setq mode-line-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2134 (list "-"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2135 'mode-line-mule-info
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2136 'mode-line-modified
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2137 'mode-line-frame-identification
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2138 " Newsticker ("
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2139 '(newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2140 "up to date"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2141 "NEED UPDATE")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2142 ") -- "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2143 '(:eval (newsticker--buffer-get-feed-title-at-point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2144 ": "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2145 '(:eval (newsticker--buffer-get-item-title-at-point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2146 " %-"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2147 (unless newsticker-show-all-rss-elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2148 (add-to-invisibility-spec 'extra))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2149 (newsticker--buffer-set-uptodate nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2150
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2151 ;; refine its mode-map
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2152 (define-key newsticker-mode-map "sO" 'newsticker-show-old-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2153 (define-key newsticker-mode-map "hO" 'newsticker-hide-old-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2154 (define-key newsticker-mode-map "sa" 'newsticker-show-all-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2155 (define-key newsticker-mode-map "ha" 'newsticker-hide-all-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2156 (define-key newsticker-mode-map "sf" 'newsticker-show-feed-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2157 (define-key newsticker-mode-map "hf" 'newsticker-hide-feed-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2158 (define-key newsticker-mode-map "so" 'newsticker-show-old-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2159 (define-key newsticker-mode-map "ho" 'newsticker-hide-old-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2160 (define-key newsticker-mode-map "sn" 'newsticker-show-new-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2161 (define-key newsticker-mode-map "hn" 'newsticker-hide-new-item-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2162 (define-key newsticker-mode-map "se" 'newsticker-show-entry)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2163 (define-key newsticker-mode-map "he" 'newsticker-hide-entry)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2164 (define-key newsticker-mode-map "sx" 'newsticker-show-extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2165 (define-key newsticker-mode-map "hx" 'newsticker-hide-extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2166
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2167 (define-key newsticker-mode-map " " 'scroll-up)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2168 (define-key newsticker-mode-map "q" 'newsticker-close-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2169 (define-key newsticker-mode-map "p" 'newsticker-previous-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2170 (define-key newsticker-mode-map "P" 'newsticker-previous-new-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2171 (define-key newsticker-mode-map "F" 'newsticker-previous-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2172 (define-key newsticker-mode-map "\t" 'newsticker-next-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2173 (define-key newsticker-mode-map "n" 'newsticker-next-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2174 (define-key newsticker-mode-map "N" 'newsticker-next-new-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2175 (define-key newsticker-mode-map "f" 'newsticker-next-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2176 (define-key newsticker-mode-map "M" 'newsticker-mark-all-items-as-read)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2177 (define-key newsticker-mode-map "m"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2178 'newsticker-mark-all-items-at-point-as-read)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2179 (define-key newsticker-mode-map "o" 'newsticker-mark-item-at-point-as-read)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2180 (define-key newsticker-mode-map "G" 'newsticker-get-all-news)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2181 (define-key newsticker-mode-map "g" 'newsticker-get-news-at-point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2182 (define-key newsticker-mode-map "u" 'newsticker-buffer-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2183 (define-key newsticker-mode-map "U" 'newsticker-buffer-force-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2184 (define-key newsticker-mode-map "a" 'newsticker-add-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2185
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2186 (define-key newsticker-mode-map "i"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2187 'newsticker-mark-item-at-point-as-immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2188
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2189 (define-key newsticker-mode-map "xf" 'newsticker-toggle-auto-narrow-to-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2190 (define-key newsticker-mode-map "xi" 'newsticker-toggle-auto-narrow-to-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2191
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2192 ;; maps for the clickable portions
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2193 (defvar newsticker--url-keymap (make-sparse-keymap)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2194 "Key map for click-able headings in the newsticker buffer.")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2195 (define-key newsticker--url-keymap [mouse-2]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2196 'newsticker-mouse-browse-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2197 (define-key newsticker--url-keymap "\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2198 'newsticker-browse-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2199 (define-key newsticker--url-keymap "\C-m"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2200 'newsticker-browse-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2201 (define-key newsticker--url-keymap [(control return)]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2202 'newsticker-handle-url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2203
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2204 ;; newsticker menu
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2205 (defvar newsticker-menu (make-sparse-keymap "Newsticker"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2206
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2207 (define-key newsticker-menu [newsticker-browse-url]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2208 '("Browse URL for item at point" . newsticker-browse-url))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2209 (define-key newsticker-menu [newsticker-separator-1]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2210 '("--"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2211 (define-key newsticker-menu [newsticker-buffer-update]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2212 '("Update buffer" . newsticker-buffer-update))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2213 (define-key newsticker-menu [newsticker-separator-2]
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 (define-key newsticker-menu [newsticker-get-all-news]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2216 '("Get news from all feeds" . newsticker-get-all-news))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2217 (define-key newsticker-menu [newsticker-get-news-at-point]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2218 '("Get news from feed at point" . newsticker-get-news-at-point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2219 (define-key newsticker-menu [newsticker-separator-3]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2220 '("--"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2221 (define-key newsticker-menu [newsticker-mark-all-items-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2222 '("Mark all items as read" . newsticker-mark-all-items-as-read))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2223 (define-key newsticker-menu [newsticker-mark-all-items-at-point-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2224 '("Mark all items in feed at point as read" .
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2225 newsticker-mark-all-items-at-point-as-read))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2226 (define-key newsticker-menu [newsticker-mark-item-at-point-as-read]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2227 '("Mark item at point as read" .
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2228 newsticker-mark-item-at-point-as-read))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2229 (define-key newsticker-menu [newsticker-mark-item-at-point-as-immortal]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2230 '("Toggle immortality for item at point" .
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2231 newsticker-mark-item-at-point-as-immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2232 (define-key newsticker-menu [newsticker-separator-4]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2233 '("--"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2234 (define-key newsticker-menu [newsticker-hide-old-items]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2235 '("Hide old items" . newsticker-hide-old-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2236 (define-key newsticker-menu [newsticker-show-old-items]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2237 '("Show old items" . newsticker-show-old-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2238 (define-key newsticker-menu [newsticker-next-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2239 '("Go to next item" . newsticker-next-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2240 (define-key newsticker-menu [newsticker-previous-item]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2241 '("Go to previous item" . newsticker-previous-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2242
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2243 ;; bind menu to mouse
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2244 (define-key newsticker-mode-map [down-mouse-3] newsticker-menu)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2245 ;; Put menu in menu-bar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2246 (define-key newsticker-mode-map [menu-bar Newsticker]
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2247 (cons "Newsticker" newsticker-menu))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2248
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2249
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2250 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2251 ;;; shortcuts
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2252 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2253 (defsubst newsticker--title (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2254 "Return title of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2255 (nth 0 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2256 (defsubst newsticker--desc (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2257 "Return description of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2258 (nth 1 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2259 (defsubst newsticker--link (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2260 "Return link of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2261 (nth 2 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2262 (defsubst newsticker--time (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2263 "Return time of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2264 (nth 3 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2265 (defsubst newsticker--age (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2266 "Return age of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2267 (nth 4 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2268 (defsubst newsticker--pos (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2269 "Return position/index of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2270 (nth 5 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2271 (defsubst newsticker--preformatted-contents (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2272 "Return pre-formatted text of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2273 (nth 6 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2274 (defsubst newsticker--preformatted-title (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2275 "Return pre-formatted title of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2276 (nth 7 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2277 (defsubst newsticker--extra (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2278 "Return extra attributes of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2279 (nth 8 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2280 (defsubst newsticker--guid (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2281 "Return guid of ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2282 (let ((guid (assoc 'guid (newsticker--extra item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2283 (if (stringp guid)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2284 guid
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2285 (car (xml-node-children guid)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2286 (defsubst newsticker--enclosure (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2287 "Return enclosure element of ITEM in the form \(...FIXME...\)or nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2288 (let ((enclosure (assoc 'enclosure (newsticker--extra item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2289 (if enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2290 (xml-node-attributes enclosure))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2291
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2292 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2293 ;;; User fun
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2294 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2295
65998
e6b90c8b34d8 (newsticker-start, newsticker-show-news): Add autoload cookies.
Richard M. Stallman <rms@gnu.org>
parents: 65638
diff changeset
2296 ;;;###autoload
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2297 (defun newsticker-start (&optional do-not-complain-if-running)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2298 "Start the newsticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2299 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
2300 timers, are running already a warning message is printed unless
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2301 DO-NOT-COMPLAIN-IF-RUNNING is not nil.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2302 Run `newsticker-start-hook' if newsticker was not running already."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2303 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2304 (let ((running (newsticker-running-p)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2305 ;; read old cache if it exists and newsticker is not running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2306 (unless running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2307 (let* ((coding-system-for-read 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2308 (buf (find-file-noselect newsticker-cache-filename)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2309 (when buf
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2310 (set-buffer buf)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2311 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2312 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2313 (setq newsticker--cache (read buf))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2314 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2315 (message "Error while reading newsticker cache file!")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2316 (setq newsticker--cache nil))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2317 ;; start retrieval timers -- for sake of simplicity we will start
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2318 ;; one timer for each feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2319 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2320 (let* ((feed-name (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2321 (start-time (nth 2 item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2322 (interval (or (nth 3 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2323 newsticker-retrieval-interval))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2324 (timer (assoc (car item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2325 newsticker--retrieval-timer-list)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2326 (if timer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2327 (or do-not-complain-if-running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2328 (message "Timer for %s is running already!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2329 feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2330 (newsticker--debug-msg "Starting timer for %s: %s, %d"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2331 feed-name start-time interval)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2332 ;; do not repeat retrieval if interval not positive
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2333 (if (<= interval 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2334 (setq interval nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2335 ;; Suddenly XEmacs doesn't like start-time 0
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2336 (if (or (not start-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2337 (and (numberp start-time) (= start-time 0)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2338 (setq start-time 1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2339 (message "start-time %s" start-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2340 (setq timer (run-at-time start-time interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2341 'newsticker-get-news feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2342 (if interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2343 (add-to-list 'newsticker--retrieval-timer-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2344 (cons feed-name timer))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2345 (append newsticker-url-list-defaults newsticker-url-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2346 (unless running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2347 (run-hooks 'newsticker-start-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2348 (message "Newsticker started!"))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2349
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2350 (defun newsticker-start-ticker ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2351 "Start newsticker's ticker (but not the news retrieval.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2352 Start display timer for the actual ticker if wanted and not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2353 running already."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2354 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2355 (if (and (> newsticker-display-interval 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2356 (not newsticker--display-timer))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2357 (setq newsticker--display-timer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2358 (run-at-time newsticker-display-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2359 newsticker-display-interval
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2360 '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
2361
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2362 (defun newsticker-stop ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2363 "Stop the newsticker and the newsticker-ticker.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2364 Cancel the timers for display and retrieval. Run `newsticker-stop-hook'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2365 if newsticker has been running."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2366 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2367 (newsticker--cache-update t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2368 (newsticker-stop-ticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2369 (when (newsticker-running-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2370 (mapc (lambda (name-and-timer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2371 (cancel-timer (cdr name-and-timer)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2372 newsticker--retrieval-timer-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2373 (setq newsticker--retrieval-timer-list nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2374 (run-hooks 'newsticker-stop-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2375 (message "Newsticker stopped!")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2376
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2377 (defun newsticker-stop-ticker ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2378 "Stop newsticker's ticker (but not the news retrieval)."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2379 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2380 (when newsticker--display-timer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2381 (cancel-timer newsticker--display-timer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2382 (setq newsticker--display-timer nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2383
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2384 ;; 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
2385 ;;;###autoload
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2386 (defun newsticker-show-news ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2387 "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
2388 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2389 (newsticker-start t) ;; will start only if not running
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2390 (newsticker-buffer-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2391 (switch-to-buffer "*newsticker*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2392
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2393 (defun newsticker-buffer-force-update ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2394 "Update the newsticker buffer, even if not necessary."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2395 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2396 (newsticker-buffer-update t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2397
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2398 (defun newsticker-buffer-update (&optional force)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2399 "Update the *newsticker* buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2400 Unless FORCE is t this is donly only if necessary, i.e. when the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2401 *newsticker* buffer is not up-to-date."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2402 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2403 ;; bring cache data into proper order....
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2404 (newsticker--cache-sort)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2405 ;; fill buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2406 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2407 (let ((buf (get-buffer "*newsticker*")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2408 (if buf
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2409 (switch-to-buffer buf)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2410 (switch-to-buffer (get-buffer-create "*newsticker*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2411 (newsticker--buffer-set-uptodate nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2412 (when (or force
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2413 (not newsticker--buffer-uptodate-p))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2414 (message "Preparing newsticker buffer...")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2415 (setq buffer-undo-list t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2416 (let ((inhibit-read-only t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2417 (set-buffer-modified-p nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2418 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2419 (newsticker-mode)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2420 ;; 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
2421 ;; definition of newsticker-mode, so we do it here (again)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2422 (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
2423
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2424 (set-buffer-file-coding-system 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2425
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2426 (if newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2427 (set (make-local-variable 'fill-column) (1- (window-width))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2428 (newsticker--buffer-insert-all-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2429
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2430 ;; FIXME: needed for methods buffer in ecb
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2431 ;; (set-visited-file-name "*newsticker*")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2432
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2433 (set-buffer-modified-p nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2434 (newsticker-hide-all-desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2435 (if newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2436 (newsticker-hide-old-items))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2437 (if newsticker-show-descriptions-of-new-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2438 (newsticker-show-new-item-desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2439 )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2440 (message ""))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2441 (newsticker--buffer-set-uptodate t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2442 (run-hooks 'newsticker-buffer-change-hook)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2443
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2444 (defun newsticker-get-all-news ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2445 "Launch retrieval of news from all configured newsticker sites.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2446 This does NOT start the retrieval timers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2447 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2448 ;; launch retrieval of news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2449 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2450 (newsticker-get-news (car item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2451 (append newsticker-url-list-defaults newsticker-url-list)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2452
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2453 (defun newsticker-get-news-at-point ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2454 "Launch retrieval of news for the feed point is in.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2455 This does NOT start the retrieval timers."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2456 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2457 ;; launch retrieval of news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2458 (let ((feed (get-text-property (point) 'feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2459 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2460 (newsticker--debug-msg "Getting news for %s" (symbol-name feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2461 (newsticker-get-news (symbol-name feed)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2462
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2463 (defun newsticker-add-url (url name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2464 "Add given URL under given NAME to `newsticker-url-list'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2465 If URL is nil it is searched at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2466 (interactive
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2467 (list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2468 (read-string "URL: "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2469 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2470 (end-of-line)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2471 (and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2472 (re-search-backward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2473 "http://"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2474 (if (> (point) (+ (point-min) 100))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2475 (- (point) 100)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2476 (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2477 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2478 (re-search-forward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2479 "http://[-a-zA-Z0-9&/_.]*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2480 (if (< (point) (- (point-max) 200))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2481 (+ (point) 200)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2482 (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2483 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2484 (buffer-substring-no-properties (match-beginning 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2485 (match-end 0)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2486 (read-string "Name: ")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2487 (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
2488 (customize-variable 'newsticker-url-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2489
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2490 (defun newsticker-w3m-show-inline-images ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2491 "Show inline images in visible text ranges.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2492 In-line images in invisible text ranges are hidden. This function
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2493 calls `w3m-toggle-inline-image'. It works only if
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2494 `newsticker-html-renderer' is set to `w3m-region'"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2495 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2496 (if (eq newsticker-html-renderer 'w3m-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2497 (let ((inhibit-read-only t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2498 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2499 (save-restriction
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2500 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2501 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2502 (let ((pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2503 (while pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2504 (setq pos (next-single-property-change pos 'w3m-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2505 (when pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2506 (goto-char pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2507 (when (get-text-property pos 'w3m-image)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2508 (let ((invis (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2509 (get-text-property (1- (point)) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2510 buffer-invisibility-spec)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2511 (if invis
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2512 (w3m-remove-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2513 pos (next-single-property-change pos 'w3m-image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2514 (w3m-toggle-inline-image t))))))))))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
2515
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2516 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2517 ;;; keymap stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2518 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2519 (defun newsticker-close-buffer ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2520 "Close the newsticker buffer."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2521 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2522 (newsticker--cache-update t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2523 (bury-buffer))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2524
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2525 (defun newsticker-next-new-item (&optional do-not-wrap-at-eob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2526 "Go to next new news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2527 If no new item is found behind point, search is continued at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2528 beginning of buffer unless optional argument DO-NOT-WRAP-AT-EOB
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2529 is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2530 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2531 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2532 (let ((go-ahead t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2533 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2534 (unless (newsticker--buffer-goto '(item) 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2535 ;; found nothing -- wrap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2536 (unless do-not-wrap-at-eob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2537 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2538 (newsticker-next-new-item t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2539 (setq go-ahead nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2540 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2541 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2542 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2543 ;; this item is invisible -- continue search
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2544 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2545 (run-hooks 'newsticker-select-item-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2546 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2547
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2548 (defun newsticker-previous-new-item (&optional do-not-wrap-at-bob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2549 "Go to previous new news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2550 If no new item is found before point, search is continued at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2551 beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2552 is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2553 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2554 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2555 (let ((go-ahead t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2556 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2557 (unless (newsticker--buffer-goto '(item) 'new t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2558 (unless do-not-wrap-at-bob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2559 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2560 (newsticker--buffer-goto '(item) 'new t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2561 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2562 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2563 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2564 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2565 (run-hooks 'newsticker-select-item-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2566 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2567
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2568 (defun newsticker-next-item (&optional do-not-wrap-at-eob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2569 "Go to next news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2570 Return new buffer position.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2571 If no item is found below point, search is continued at beginning
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2572 of buffer unless optional argument DO-NOT-WRAP-AT-EOB is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2573 non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2574 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2575 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2576 (let ((go-ahead t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2577 (search-list '(item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2578 (if newsticker--auto-narrow-to-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2579 (setq search-list '(item feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2580 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2581 (unless (newsticker--buffer-goto search-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2582 ;; found nothing -- wrap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2583 (unless do-not-wrap-at-eob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2584 (goto-char (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2585 (setq go-ahead nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2586 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2587 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2588 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2589 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2590 (run-hooks 'newsticker-select-item-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2591 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2592
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2593 (defun newsticker-previous-item (&optional do-not-wrap-at-bob)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2594 "Go to previous news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2595 Return new buffer position.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2596 If no item is found before point, search is continued at
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2597 beginning of buffer unless optional argument DO-NOT-WRAP-AT-BOB
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2598 is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2599 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2600 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2601 (let ((go-ahead t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2602 (search-list '(item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2603 (if newsticker--auto-narrow-to-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2604 (setq search-list '(item feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2605 (when (bobp)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2606 (unless do-not-wrap-at-bob
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2607 (goto-char (point-max))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2608 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2609 (if (newsticker--buffer-goto search-list nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2610 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2611 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2612 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2613 (setq go-ahead nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2614 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2615 (setq go-ahead nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2616 (run-hooks 'newsticker-select-item-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2617 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2618
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2619 (defun newsticker-next-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2620 "Go to next news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2621 Return new buffer position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2622 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2623 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2624 (newsticker--buffer-goto '(feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2625 (run-hooks 'newsticker-select-feed-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2626 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2627
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2628 (defun newsticker-previous-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2629 "Go to previous news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2630 Return new buffer position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2631 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2632 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2633 (newsticker--buffer-goto '(feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2634 (run-hooks 'newsticker-select-feed-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2635 (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2636
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2637 (defun newsticker-mark-all-items-at-point-as-read ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2638 "Mark all items as read and clear ticker contents."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2639 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2640 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2641 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2642 "Buffer is not up to date -- really mark items as read? "))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2643 (let ((feed (get-text-property (point) 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2644 (pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2645 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2646 (message "Marking all items as read for %s" (symbol-name feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2647 (newsticker--cache-replace-age newsticker--cache feed 'new 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2648 (newsticker--cache-replace-age newsticker--cache feed 'obsolete 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2649 (newsticker--cache-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2650 (newsticker--buffer-set-uptodate nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2651 (newsticker--ticker-text-setup)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2652 (newsticker-buffer-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2653 ;; go back to where we came frome
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2654 (goto-char pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2655 (end-of-line)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2656 (newsticker--buffer-goto '(feed) nil t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2657
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2658 (defun newsticker-mark-item-at-point-as-read (&optional respect-immortality)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2659 "Mark item at point as read.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2660 If optional argument RESPECT-IMMORTALITY is not nil immortal items do
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2661 not get changed."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2662 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2663 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2664 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2665 "Buffer is not up to date -- really mark this item as read? "))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2666 (let ((feed (get-text-property (point) 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2667 (item nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2668 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2669 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2670 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2671 (let ((inhibit-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2672 (age (get-text-property (point) 'nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2673 (title (get-text-property (point) 'nt-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2674 (guid (get-text-property (point) 'nt-guid))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2675 (nt-desc (get-text-property (point) 'nt-desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2676 (pos (save-excursion (newsticker--buffer-end-of-item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2677 (when (or (eq age 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2678 (eq age 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2679 (and (eq age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2680 (not respect-immortality)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2681 ;; find item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2682 (setq item (newsticker--cache-contains newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2683 feed title nt-desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2684 nil nil guid))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2685 ;; mark as old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2686 (when item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2687 (setcar (nthcdr 4 item) 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2688 (newsticker--do-forget-preformatted item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2689 ;; clean up ticker
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2690 (if (or (and (eq age 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2691 newsticker-hide-immortal-items-in-echo-area)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2692 (and (memq age '(old immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2693 (not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2694 (eq newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2695 newsticker-hide-immortal-items-in-echo-area))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2696 (newsticker--ticker-text-remove feed title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2697 ;; set faces etc.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2698 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2699 (save-restriction
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 (put-text-property (point) pos 'nt-age 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2702 (newsticker--buffer-set-faces (point) pos)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2703 (set-buffer-modified-p nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2704 ;; move forward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2705 (newsticker-next-item t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2706
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2707 (defun newsticker-mark-item-at-point-as-immortal ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2708 "Mark item at point as read."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2709 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2710 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2711 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2712 "Buffer is not up to date -- really mark this item as read? "))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2713 (let ((feed (get-text-property (point) 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2714 (item nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2715 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2716 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2717 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2718 (let ((inhibit-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2719 (oldage (get-text-property (point) 'nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2720 (title (get-text-property (point) 'nt-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2721 (guid (get-text-property (point) 'nt-guid))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2722 (pos (save-excursion (newsticker--buffer-end-of-item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2723 (let ((newage 'immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2724 (if (eq oldage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2725 (setq newage 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2726 (setq item (newsticker--cache-contains newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2727 feed title nil nil nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2728 guid))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2729 ;; change age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2730 (when item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2731 (setcar (nthcdr 4 item) newage)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2732 (newsticker--do-forget-preformatted item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2733 (if (or (and (eq newage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2734 newsticker-hide-immortal-items-in-echo-area)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2735 (and (eq newage 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2736 newsticker-hide-obsolete-items-in-echo-area)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2737 (and (eq oldage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2738 (not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2739 (eq newsticker-hide-old-items-in-newsticker-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2740 newsticker-hide-immortal-items-in-echo-area))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2741 (newsticker--ticker-text-remove feed title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2742 (newsticker--ticker-text-setup))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2743 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2744 (save-restriction
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2745 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2746 (put-text-property (point) pos 'nt-age newage)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2747 (if (eq newage 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2748 (put-text-property (point) pos 'nt-age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2749 (put-text-property (point) pos 'nt-age 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2750 (newsticker--buffer-set-faces (point) pos))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2751 (if item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2752 (newsticker-next-item t))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2753
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2754 (defun newsticker-mark-all-items-as-read ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2755 "Mark all items as read and clear ticker contents."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2756 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2757 (when (or newsticker--buffer-uptodate-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2758 (y-or-n-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2759 "Buffer is not up to date -- really mark items as read? "))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2760 (newsticker--cache-replace-age newsticker--cache 'any 'new 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2761 (newsticker--buffer-set-uptodate nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2762 (newsticker--ticker-text-setup)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2763 (newsticker--cache-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2764 (newsticker-buffer-update)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2765
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2766 (defun newsticker-hide-extra ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2767 "Hide the extra elements of items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2768 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2769 (newsticker--buffer-hideshow 'extra nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2770 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2771
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2772 (defun newsticker-show-extra ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2773 "Show the extra elements of items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2774 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2775 (newsticker--buffer-hideshow 'extra t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2776 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2777
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2778 (defun newsticker-hide-old-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2779 "Hide the description of old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2780 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2781 (newsticker--buffer-hideshow 'desc-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2782 (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
2783
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2784 (defun newsticker-show-old-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2785 "Show the description of old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2786 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2787 (newsticker--buffer-hideshow 'item-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2788 (newsticker--buffer-hideshow 'desc-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2789 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2790
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2791 (defun newsticker-hide-new-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2792 "Hide the description of new items."
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 (newsticker--buffer-hideshow 'desc-new nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2795 (newsticker--buffer-hideshow 'desc-immortal nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2796 (newsticker--buffer-hideshow 'desc-obsolete nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2797 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2798
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2799 (defun newsticker-show-new-item-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2800 "Show the description of new items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2801 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2802 (newsticker--buffer-hideshow 'desc-new t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2803 (newsticker--buffer-hideshow 'desc-immortal t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2804 (newsticker--buffer-hideshow 'desc-obsolete t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2805 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2806
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2807 (defun newsticker-hide-feed-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2808 "Hide the description of feeds."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2809 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2810 (newsticker--buffer-hideshow 'desc-feed nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2811 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2812
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2813 (defun newsticker-show-feed-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2814 "Show the description of old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2815 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2816 (newsticker--buffer-hideshow 'desc-feed t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2817 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2818
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2819 (defun newsticker-hide-all-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2820 "Hide the descriptions of feeds and all items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2821 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2822 (newsticker--buffer-hideshow 'desc-feed nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2823 (newsticker--buffer-hideshow 'desc-immortal nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2824 (newsticker--buffer-hideshow 'desc-obsolete nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2825 (newsticker--buffer-hideshow 'desc-new nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2826 (newsticker--buffer-hideshow 'desc-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2827 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2828
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2829 (defun newsticker-show-all-desc ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2830 "Show the descriptions of feeds and all items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2831 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2832 (newsticker--buffer-hideshow 'desc-feed t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2833 (newsticker--buffer-hideshow 'desc-immortal t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2834 (newsticker--buffer-hideshow 'desc-obsolete t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2835 (newsticker--buffer-hideshow 'desc-new t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2836 (newsticker--buffer-hideshow 'desc-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2837 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2838
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2839 (defun newsticker-hide-old-items ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2840 "Hide old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2841 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2842 (newsticker--buffer-hideshow 'desc-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2843 (newsticker--buffer-hideshow 'item-old nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2844 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2845
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2846 (defun newsticker-show-old-items ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2847 "Show old items."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2848 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2849 (newsticker--buffer-hideshow 'desc-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2850 (newsticker--buffer-hideshow 'item-old t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2851 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2852
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2853 (defun newsticker-hide-entry ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2854 "Hide description of entry at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2855 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2856 (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
2857 (let* (pos1 pos2
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2858 (inhibit-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2859 inv-prop org-inv-prop
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2860 is-invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2861 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2862 (newsticker--buffer-goto '(desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2863 (setq pos1 (max (point-min) (1- (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2864 (newsticker--buffer-goto '(extra feed item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2865 (setq pos2 (max (point-min) (1- (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2866 (setq inv-prop (get-text-property pos1 'invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2867 (setq org-inv-prop (get-text-property pos1 'org-invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2868 (cond ((eq inv-prop t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2869 ;; do nothing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2870 )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2871 ((eq org-inv-prop nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2872 (add-text-properties pos1 pos2 (list 'invisible t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2873 'org-invisible inv-prop)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2874 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2875 ;; toggle
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2876 (add-text-properties pos1 pos2 (list 'invisible org-inv-prop))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2877 (remove-text-properties pos1 pos2 '(org-invisible))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2878 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2879
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2880 (defun newsticker-show-entry ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2881 "Show description of entry at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2882 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2883 (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
2884 (let* (pos1 pos2
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2885 (inhibit-read-only t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2886 inv-prop org-inv-prop
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2887 is-invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2888 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2889 (newsticker--buffer-goto '(desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2890 (setq pos1 (max (point-min) (1- (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2891 (newsticker--buffer-goto '(extra feed item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2892 (setq pos2 (max (point-min) (1- (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2893 (setq inv-prop (get-text-property pos1 'invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2894 (setq org-inv-prop (get-text-property pos1 'org-invisible))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2895 (cond ((eq org-inv-prop nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2896 (add-text-properties pos1 pos2 (list 'invisible nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2897 'org-invisible inv-prop)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2898 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2899 ;; toggle
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2900 (add-text-properties pos1 pos2 (list 'invisible org-inv-prop))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2901 (remove-text-properties pos1 pos2 '(org-invisible))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2902 (newsticker--buffer-redraw))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2903
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2904 (defun newsticker-toggle-auto-narrow-to-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2905 "Toggle narrowing to current news feed.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2906 If auto-narrowing is active, only news item of the current feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2907 are visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2908 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2909 (newsticker-set-auto-narrow-to-feed (not newsticker--auto-narrow-to-feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2910
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2911 (defun newsticker-set-auto-narrow-to-feed (value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2912 "Turn narrowing to current news feed on or off.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2913 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
2914 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2915 (setq newsticker--auto-narrow-to-item nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2916 (setq newsticker--auto-narrow-to-feed value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2917 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2918 (run-hooks 'newsticker-narrow-hook))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2919
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2920 (defun newsticker-toggle-auto-narrow-to-item ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2921 "Toggle narrowing to current news item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2922 If auto-narrowing is active, only one item of the current feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2923 is visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2924 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2925 (newsticker-set-auto-narrow-to-item (not newsticker--auto-narrow-to-item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2926
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2927 (defun newsticker-set-auto-narrow-to-item (value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2928 "Turn narrowing to current news item on or off.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2929 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
2930 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2931 (setq newsticker--auto-narrow-to-feed nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2932 (setq newsticker--auto-narrow-to-item value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2933 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2934 (run-hooks 'newsticker-narrow-hook))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2935
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2936 (defun newsticker-customize ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2937 "Open the newsticker customization group."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2938 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2939 (customize-group "newsticker"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2940
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2941 (defun newsticker-next-feed-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2942 "Return t if position is before last feed, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2943 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2944 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2945 (newsticker--buffer-goto '(feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2946 (not (= p (point))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2947
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2948 (defun newsticker-previous-feed-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2949 "Return t if position is behind first feed, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2950 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2951 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2952 (newsticker--buffer-goto '(feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2953 (not (= p (point))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2954
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2955 (defun newsticker-next-item-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2956 "Return t if position is before last feed, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2957 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2958 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2959 (while (< (point) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2960 (unless (newsticker--buffer-goto '(item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2961 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2962 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2963 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2964 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2965 (throw 'result t))))))
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-previous-item-available-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2968 "Return t if position is behind first item, nil otherwise."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2969 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2970 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2971 (while (> (point) (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2972 (unless (newsticker--buffer-goto '(item) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2973 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2974 (unless (newsticker--lists-intersect-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2975 (get-text-property (point) 'invisible)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2976 buffer-invisibility-spec)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2977 (throw 'result t))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2978
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2979 (defun newsticker-item-not-old-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2980 "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
2981 (when (get-text-property (point) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2982 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2983 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2984 (let ((age (get-text-property (point) 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2985 (and (memq age '(new immortal obsolete)) t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2986
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2987 (defun newsticker-item-not-immortal-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2988 "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
2989 (when (get-text-property (point) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2990 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2991 (newsticker--buffer-beginning-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2992 (let ((age (get-text-property (point) 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2993 (and (memq age '(new old obsolete)) t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2994
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2995 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2996 ;;; local stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2997 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2998 (defun newsticker-running-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2999 "Check whether newsticker is running.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3000 Return t if newsticker is running, nil otherwise. Newsticker is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3001 considered to be running if the newsticker timer list is not empty."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3002 (> (length newsticker--retrieval-timer-list) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3003
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3004 (defun newsticker-ticker-running-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3005 "Check whether newsticker's actual ticker is running.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3006 Return t if ticker is running, nil otherwise. Newsticker is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3007 considered to be running if the newsticker timer list is not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3008 empty."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3009 (timerp newsticker--display-timer))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3010
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3011 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3012 ;;; local stuff
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-get-news (feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3015 "Get news from the site FEED-NAME and load feed logo.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3016 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
3017 in an element of `newsticker-url-list' or `newsticker-url-list-defaults'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3018 (newsticker--debug-msg "%s: Getting news for %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3019 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3020 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3021 (let* ((buffername (concat " *newsticker-wget-" feed-name "*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3022 (item (or (assoc feed-name newsticker-url-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3023 (assoc feed-name newsticker-url-list-defaults)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3024 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3025 "Cannot get news for %s: Check newsticker-url-list"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3026 feed-name)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3027 (url (cadr item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3028 (wget-arguments (or (car (cdr (cdr (cdr (cdr item)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3029 newsticker-wget-arguments)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3030 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3031 (set-buffer (get-buffer-create buffername))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3032 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3033 ;; throw an error if there is an old wget-process around
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3034 (if (get-process feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3035 (error "Another wget-process is running for %s" feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3036 ;; start wget
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3037 (let* ((args (append wget-arguments (list url)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3038 (proc (apply 'start-process feed-name buffername
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3039 newsticker-wget-name args)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3040 (set-process-coding-system proc 'no-conversion 'no-conversion)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3041 (set-process-sentinel proc 'newsticker--sentinel)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3042
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
3043
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3044 (defun newsticker-mouse-browse-url (event)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3045 "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
3046 (interactive "e")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3047 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3048 (switch-to-buffer (window-buffer (posn-window (event-end event))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3049 (let ((url (get-text-property (posn-point (event-end event))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3050 'nt-link)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3051 (when url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3052 (browse-url url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3053 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3054 (goto-char (posn-point (event-end event)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3055 (if newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3056 (newsticker-mark-item-at-point-as-read t)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3057
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3058 (defun newsticker-browse-url ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3059 "Call `browse-url' for the link of the item at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3060 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3061 (let ((url (get-text-property (point) 'nt-link)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3062 (when url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3063 (browse-url url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3064 (if newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3065 (newsticker-mark-item-at-point-as-read t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3066
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3067 (defvar newsticker-open-url-history
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3068 '("wget" "xmms" "realplay")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3069 "...")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3070
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3071 (defun newsticker-handle-url ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3072 "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
3073 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3074 (let ((url (get-text-property (point) 'nt-link)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3075 (when url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3076 (let ((prog (read-string "Open url with: " nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3077 'newsticker-open-url-history)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3078 (when prog
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3079 (message "%s %s" prog url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3080 (start-process prog prog prog url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3081 (if newsticker-automatically-mark-visited-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3082 (newsticker-mark-item-at-point-as-read t)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3083
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3084 (defun newsticker--sentinel (process event)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3085 "Sentinel for extracting news titles from an RDF buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3086 Argument PROCESS is the process which has just changed its state.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3087 Argument EVENT tells what has happened to the process."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3088 (let* ((p-status (process-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3089 (exit-status (process-exit-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3090 (time (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3091 (name (process-name process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3092 (name-symbol (intern name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3093 (something-was-added nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3094 ;; catch known errors (zombie processes, rubbish-xml etc.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3095 ;; if an error occurs the news feed is not updated!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3096 (catch 'oops
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3097 (unless (and (eq p-status 'exit)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3098 (= exit-status 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3099 (setq newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3100 (newsticker--cache-add
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3101 newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3102 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3103 newsticker--error-headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3104 (format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3105 (concat "%s: Newsticker could not retrieve news from %s.\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3106 "Return status: `%s'\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3107 "Command was `%s'")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3108 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3109 name event (process-command process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3110 ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3111 (current-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3112 'new
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3113 0 nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3114 (message "%s: Error while retrieving news from %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3115 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3116 (process-name process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3117 (throw 'oops nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3118 (let* ((coding-system nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3119 (node-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3120 (save-current-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3121 (set-buffer (process-buffer process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3122 ;; a very very dirty workaround to overcome the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3123 ;; problems with the newest (20030621) xml.el:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3124 ;; remove all unnecessary whitespace
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3125 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3126 (while (re-search-forward ">[ \t\r\n]+<" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3127 (replace-match "><" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3128 ;; and another brutal workaround (20031105)! For some
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3129 ;; reason the xml parser does not like the colon in the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3130 ;; doctype name "rdf:RDF"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3131 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3132 (if (re-search-forward "<!DOCTYPE[ \t\n]+rdf:RDF" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3133 (replace-match "<!DOCTYPE rdfColonRDF" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3134 ;; finally.... ~##^°!!!!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3135 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3136 (while (search-forward "\r\n" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3137 (replace-match "\n" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3138 ;; still more brutal workarounds (20040309)! The xml
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3139 ;; parser does not like doctype rss
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3140 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3141 (if (re-search-forward "<!DOCTYPE[ \t\n]+rss[ \t\n]*>" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3142 (replace-match "" nil t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3143 ;; And another one (20050618)! (Fixed in GNU Emacs 22.0.50.18)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3144 ;; Remove comments to avoid this xml-parsing bug:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3145 ;; "XML files can have only one toplevel tag"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3146 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3147 (while (search-forward "<!--" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3148 (let ((start (match-beginning 0)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3149 (unless (search-forward "-->" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3150 (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
3151 (delete-region start (point))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3152 ;; And another one (20050702)! If description is HTML
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3153 ;; encoded and starts with a `<', wrap the whole
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3154 ;; description in a CDATA expression. This happened for
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3155 ;; http://www.thefreedictionary.com/_/WoD/rss.aspx?type=quote
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3156 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3157 (while (re-search-forward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3158 "<description>\\(<img.*?\\)</description>" nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3159 (replace-match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3160 "<description><![CDATA[ \\1 ]]></description>"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3161 ;;
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3162 (set-buffer-modified-p nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3163 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3164 (if (re-search-forward "encoding=\"\\([^\"]+\\)\""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3165 nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3166 (setq coding-system (intern
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3167 (downcase(match-string 1)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3168 (condition-case errordata
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3169 ;; The xml parser might fail
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3170 ;; or the xml might be bugged
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3171 (xml-parse-region (point-min) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3172 (error (message "Could not parse %s: %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3173 (buffer-name) (cadr errordata))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3174 (throw 'oops nil)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3175 (topnode (car node-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3176 (channelnode (car (xml-get-children topnode 'channel)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3177 (imageurl nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3178 (position 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3179 ;; mark all items as obsolete
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3180 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3181 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3182 'new 'obsolete-new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3183 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3184 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3185 'old 'obsolete-old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3186 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3187 name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3188 'feed 'obsolete-old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3189 ;; gather the news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3190 (if (eq (xml-node-name topnode) 'rss)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3191 ;; this is RSS 0.91 or something similar
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3192 ;; all items are inside the channel node
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3193 (setq topnode channelnode))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3194 (setq imageurl
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3195 (car (xml-node-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3196 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3197 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3198 topnode
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3199 'image))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3200 'url)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3201 (let ((title (or (car (xml-node-children (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3202 channelnode 'title))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3203 "[untitled]"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3204 (link (or (car (xml-node-children (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3205 channelnode 'link))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3206 ""))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3207 (desc (or (car (xml-node-children (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3208 channelnode
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3209 'content:encoded))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3210 (car (xml-node-children (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3211 channelnode
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3212 'description))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3213 "[No description available]"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3214 (old-item nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3215 ;; check coding system
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3216 (setq coding-system
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3217 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3218 (check-coding-system coding-system)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3219 (coding-system-error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3220 (message "newsticker.el: %s %s %s %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3221 "ignoring coding system "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3222 coding-system
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3223 " for "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3224 name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3225 nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3226 ;; apply coding system
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3227 (when coding-system
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3228 (setq title (newsticker--decode-coding-string title coding-system))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3229 (if desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3230 (setq desc (newsticker--decode-coding-string desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3231 coding-system)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3232 (setq link (newsticker--decode-coding-string link coding-system)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3233 ;; decode numeric entities
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3234 (setq title (newsticker--decode-numeric-entities title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3235 (setq desc (newsticker--decode-numeric-entities desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3236 (setq link (newsticker--decode-numeric-entities link))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3237 ;; remove whitespace from title, desc, and link
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3238 (setq title (newsticker--remove-whitespace title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3239 (setq desc (newsticker--remove-whitespace desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3240 (setq link (newsticker--remove-whitespace link))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3241
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3242 ;; handle the feed itself
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3243 (unless (newsticker--cache-contains newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3244 name-symbol title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3245 desc link 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3246 (setq something-was-added t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3247 (setq newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3248 (newsticker--cache-add
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3249 newsticker--cache name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3250 title desc link time 'feed position
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3251 (xml-node-children channelnode)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3252 'feed time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3253 ;; gather all items for this feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3254 (mapc (lambda (node)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3255 (when (eq (xml-node-name node) 'item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3256 (setq position (1+ position))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3257 (setq title (or (car (xml-node-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3258 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3259 node 'title))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3260 "[untitled]"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3261 (setq link (or (car (xml-node-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3262 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3263 node 'link))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3264 ""))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3265 (setq desc (or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3266 (car (xml-node-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3267 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3268 node 'content:encoded))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3269 (car (xml-node-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3270 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3271 node 'description))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3272 ;; use pubDate value if present
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3273 (setq time (or (newsticker--decode-rfc822-date
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3274 (car (xml-node-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3275 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3276 node 'pubDate)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3277 time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3278 ;; use dc:date value if present
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3279 (setq time (or (newsticker--decode-iso8601-date
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3280 (car (xml-node-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3281 (car (xml-get-children
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3282 node 'dc:date)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3283 time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3284 ;; It happened that the title or description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3285 ;; contained evil HTML code that confused the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3286 ;; xml parser. Therefore:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3287 (unless (stringp title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3288 (setq title (prin1-to-string title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3289 (unless (or (stringp desc) (not desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3290 (setq desc (prin1-to-string desc)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3291 ;; ignore items with empty title AND empty desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3292 (when (or (> (length title) 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3293 (> (length desc) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3294 ;; apply coding system
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3295 (when coding-system
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3296 (setq title (newsticker--decode-coding-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3297 title coding-system))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3298 (if desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3299 (setq desc (newsticker--decode-coding-string desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3300 coding-system)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3301 (setq link (newsticker--decode-coding-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3302 link coding-system)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3303 ;; decode numeric entities
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3304 (setq title (newsticker--decode-numeric-entities title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3305 (when desc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3306 (setq desc (newsticker--decode-numeric-entities desc)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3307 (setq link (newsticker--decode-numeric-entities link))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3308 ;; remove whitespace from title, desc, and link
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3309 (setq title (newsticker--remove-whitespace title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3310 (setq desc (newsticker--remove-whitespace desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3311 (setq link (newsticker--remove-whitespace link))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3312 ;; add data to cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3313 ;; do we have this item already?
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3314 (let* ((tguid (assoc 'guid (xml-node-children node)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3315 (guid (if (stringp tguid)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3316 tguid
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3317 (car (xml-node-children tguid)))))
65490
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
3318 ;;(message "guid=%s" guid)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3319 (setq old-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3320 (newsticker--cache-contains newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3321 name-symbol title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3322 desc link nil guid)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3323 ;; add this item, or mark it as old, or do nothing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3324 (let ((age1 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3325 (age2 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3326 (item-new-p nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3327 (if old-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3328 (let ((prev-age (newsticker--age old-item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3329 (unless
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3330 newsticker-automatically-mark-items-as-old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3331 (if (eq prev-age 'obsolete-old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3332 (setq age2 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3333 (setq age2 'new)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3334 (if (eq prev-age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3335 (setq age2 'immortal)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3336 ;; item was not there
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3337 (setq item-new-p t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3338 (setq something-was-added t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3339 (setq newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3340 (newsticker--cache-add
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3341 newsticker--cache name-symbol title desc link
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3342 time age1 position (xml-node-children node)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3343 age2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3344 (when item-new-p
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3345 (let ((item (newsticker--cache-contains
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3346 newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3347 name-symbol title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3348 desc link nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3349 (if newsticker-auto-mark-filter
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3350 (newsticker--run-auto-mark-filter name item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3351 (run-hook-with-args
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3352 'newsticker-new-item-functions name item)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3353 (xml-get-children topnode 'item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3354 ;; Remove those old items from cache which have been removed from
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3355 ;; the feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3356 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3357 name-symbol 'obsolete-old 'deleteme)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3358 (newsticker--cache-remove newsticker--cache name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3359 'deleteme)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3360 ;; Remove those new items from cache which have been removed from
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3361 ;; the feed. Or keep them as `obsolete'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3362 (if (not newsticker-keep-obsolete-items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3363 (newsticker--cache-remove newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3364 name-symbol 'obsolete-new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3365 (setq newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3366 (newsticker--cache-mark-expired
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3367 newsticker--cache name-symbol 'obsolete 'obsolete-expired
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3368 newsticker-obsolete-item-max-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3369 (newsticker--cache-remove newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3370 name-symbol 'obsolete-expired)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3371 (newsticker--cache-replace-age newsticker--cache
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3372 name-symbol 'obsolete-new
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3373 'obsolete))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3374 ;; bring cache data into proper order....
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3375 ;; (newsticker--cache-sort)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3376 ;; setup scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3377 (newsticker--ticker-text-setup)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3378 (setq newsticker--latest-update-time (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3379 (when something-was-added
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3380 ;; FIXME: should we care about removed items as well?
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3381 (newsticker--cache-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3382 (newsticker--buffer-set-uptodate nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3383 ;; kill the process buffer if wanted
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3384 (unless newsticker-debug
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3385 (kill-buffer (process-buffer process)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3386 ;; launch retrieval of image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3387 (when (and imageurl
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3388 (string-match "%l" newsticker-heading-format))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3389 (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
3390
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3391 (defun newsticker--display-tick ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3392 "Called from the display timer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3393 This function calls a display function, according to the variable
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3394 `newsticker-scroll-smoothly'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3395 (if newsticker-scroll-smoothly
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3396 (newsticker--display-scroll)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3397 (newsticker--display-jump)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3398
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3399 (defsubst newsticker--echo-area-clean-p ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3400 "Check whether somebody is using the echo area / minibuffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3401 Return t if echo area and minibuffer are unused."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3402 (not (or (active-minibuffer-window)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3403 (and (current-message)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3404 (not (string= (current-message)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3405 newsticker--prev-message))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3406
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3407 (defun newsticker--display-jump ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3408 "Called from the display timer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3409 This function displays the next ticker item in the echo area, unless
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3410 there is another message displayed or the minibuffer is active."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3411 (let ((message-log-max nil));; prevents message text from being logged
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3412 (when (newsticker--echo-area-clean-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3413 (setq newsticker--item-position (1+ newsticker--item-position))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3414 (when (>= newsticker--item-position (length newsticker--item-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3415 (setq newsticker--item-position 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3416 (setq newsticker--prev-message
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3417 (nth newsticker--item-position newsticker--item-list))
65586
86bece058ee5 Message format fixes (commit no. 5)
Deepak Goel <deego@gnufans.org>
parents: 65490
diff changeset
3418 (message "%s" newsticker--prev-message))))
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3419
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3420 (defun newsticker--display-scroll ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3421 "Called from the display timer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3422 This function scrolls the ticker items in the echo area, unless
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3423 there is another message displayed or the minibuffer is active."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3424 (when (newsticker--echo-area-clean-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3425 (let* ((width (- (frame-width) 1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3426 (message-log-max nil);; prevents message text from being logged
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3427 (i newsticker--item-position)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3428 subtext
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3429 (s-text newsticker--scrollable-text)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3430 (l (length s-text)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3431 ;; don't show anything if there is nothing to show
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3432 (unless (< (length s-text) 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3433 ;; repeat the ticker string if it is shorter than frame width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3434 (while (< (length s-text) width)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3435 (setq s-text (concat s-text s-text)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3436 ;; get the width of the printed string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3437 (setq l (length s-text))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3438 (cond ((< i (- l width))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3439 (setq subtext (substring s-text i (+ i width))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3440 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3441 (setq subtext (concat
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3442 (substring s-text i l)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3443 (substring s-text 0 (- width (- l i)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3444 ;; Take care of multibyte strings, for which (string-width) is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3445 ;; larger than (length).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3446 ;; Actually, such strings may be smaller than (frame-width)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3447 ;; because return values of (string-width) are too large:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3448 ;; (string-width "<japanese character>") => 2
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3449 (let ((t-width (1- (length subtext))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3450 (while (> (string-width subtext) width)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3451 (setq subtext (substring subtext 0 t-width))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3452 (setq t-width (1- t-width))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3453 ;; 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
3454 (message "%s" subtext)
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3455 (setq newsticker--prev-message subtext)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3456 (setq newsticker--item-position (1+ i))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3457 (when (>= newsticker--item-position l)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3458 (setq newsticker--item-position 0))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3459
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3460 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3461 ;;; misc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3462 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3463 (defun newsticker--decode-coding-string (string coding-system)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3464 "Wrapper around `decode-coding-string'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3465 This functions passes the arguments STRING and CODING-SYSTEM to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3466 `decode-coding-string'. If the decoding is successful the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3467 decoded string is returned, otherwise the unmodified input string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3468 is returned."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3469 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3470 (decode-coding-string string coding-system)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3471 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3472 (message "Cannot decode encoded string `%s'" string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3473 string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3474
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3475 (defun newsticker--decode-numeric-entities (string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3476 "Decode SGML numeric entities by their respective utf characters.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3477 This function replaces numeric entities in the input STRING and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3478 returns the modified string. For example \"&#42;\" gets replaced
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3479 by \"*\"."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3480 (let ((start 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3481 (while (string-match "&#\\([0-9]+\\);" string start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3482 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3483 (setq string (replace-match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3484 (string (read (substring string (match-beginning 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3485 (match-end 1))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3486 nil nil string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3487 (error nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3488 (setq start (1+ (match-beginning 0))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3489 string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3490
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3491 (defun newsticker--remove-whitespace (string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3492 "Remove leading and trailing whitespace from STRING."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3493 ;; we must have ...+ but not ...* in the regexps otherwise xemacs loops
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3494 ;; endlessly...
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3495 (when string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3496 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3497 "[ \t\r\n]+$" ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3498 (replace-regexp-in-string "^[ \t\r\n]+" "" string))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3499
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3500 (defun newsticker--do-forget-preformatted (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3501 "Forget all cached pre-formatted data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3502 Remove the pre-formatted from `newsticker--cache'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3503 (if (nthcdr 7 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3504 (setcar (nthcdr 7 item) nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3505 (if (nthcdr 6 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3506 (setcar (nthcdr 6 item) nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3507
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3508 (defun newsticker--forget-preformatted ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3509 "Forget all cached pre-formatted data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3510 Remove the pre-formatted from `newsticker--cache'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3511 (mapc (lambda (feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3512 (mapc 'newsticker--do-forget-preformatted
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3513 (cdr feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3514 newsticker--cache)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3515 (newsticker--buffer-set-uptodate nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3516
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3517 (defun newsticker--debug-msg (string &rest args)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3518 "Print newsticker debug messages.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3519 This function calls `message' with arguments STRING and ARGS, if
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3520 `newsticker-debug' is non-nil."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3521 (and newsticker-debug
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3522 ;;(not (active-minibuffer-window))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3523 ;;(not (current-message))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3524 (apply 'message string args)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3525
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3526 (defun newsticker--decode-iso8601-date (iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3527 "Return ISO8601-STRING in format like `decode-time'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3528 Converts from ISO-8601 to Emacs representation. If ISO8601-STRING
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3529 Examples:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3530 2004-09-17T05:09:49+00:00
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3531 2004-09-17T05:09+00:00
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3532 2004-09-17T05:09:49
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3533 2004-09-17T05:09
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3534 2004-09-17
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3535 2004-09
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3536 2004"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3537 (if iso8601-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3538 (when (string-match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3539 (concat
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3540 "\\([0-9]\\{4\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3541 "\\(-\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3542 "\\(-\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3543 "\\(T"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3544 "\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3545 "\\(:\\([0-9]\\{2\\}\\)\\)?"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3546 "\\(\\([-+Z]\\)\\(\\([0-9]\\{2\\}\\):\\([0-9]\\{2\\}\\)\\)?\\)?"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3547 "\\)?\\)?\\)?")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3548 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3549 (let ((year (read (match-string 1 iso8601-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3550 (month (read (match-string 3 iso8601-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3551 (day (read (match-string 5 iso8601-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3552 (hour (read (or (match-string 7 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3553 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3554 (minute (read (or (match-string 8 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3555 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3556 ;;(second (read (or (match-string 10 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3557 ;; "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3558 (sign (match-string 12 iso8601-string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3559 (offset-hour (read (or (match-string 14 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3560 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3561 (offset-minute (read (or (match-string 15 iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3562 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3563 (second 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3564 (cond ((string= sign "+")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3565 (setq hour (- hour offset-hour))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3566 (setq minute (- minute offset-minute)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3567 ((string= sign "-")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3568 (setq hour (+ hour offset-hour))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3569 (setq minute (+ minute offset-minute))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3570 ;; if UTC subtract current-time-zone offset
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3571 ;;(setq second (+ (car (current-time-zone)) second)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3572
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3573 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3574 (encode-time second minute hour day month year t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3575 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3576 (message "Cannot decode \"%s\"" iso8601-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3577 nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3578 nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3579
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3580 (defun newsticker--decode-rfc822-date (rfc822-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3581 "Return RFC822-STRING in format like `decode-time'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3582 Converts from RFC822 to Emacs representation.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3583 Examples:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3584 Sat, 07 Sep 2002 00:00:01 GMT
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3585 07 Sep 2002 00:00:01 GMT"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3586 (if rfc822-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3587 (when (string-match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3588 (concat
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3589 "\\s-*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3590 ;; week day
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3591 "\\(\\(Mon\\|Tue\\|Wed\\|Thu\\|Fri\\|Sat\\|Sun\\)\\s-*,?\\)\\s-+"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3592 ;; day
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3593 "\\([0-9]\\{1,2\\}\\)\\s-+"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3594 ;; month
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3595 "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3596 "Sep\\|Oct\\|Nov\\|Dec\\)\\s-+"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3597 ;; year
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3598 "\\([0-9]\\{2,4\\}\\)\\s-+"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3599 ;; hour
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3600 "\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3601 ;; minute
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3602 ":\\([0-9]\\{2\\}\\)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3603 ;; second
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3604 "\\(:\\([0-9]\\{2\\}\\)\\)?"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3605 ;; zone -- fixme
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3606 "\\(\\s-+.*\\)?")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3607 rfc822-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3608 (let ((day (read (match-string 3 rfc822-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3609 (month-name (match-string 4 rfc822-string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3610 (month 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3611 (year (read (match-string 5 rfc822-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3612 (hour (read (match-string 6 rfc822-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3613 (minute (read (match-string 7 rfc822-string)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3614 (second (read (or (match-string 9 rfc822-string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3615 "0")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3616 ;;(zone (match-string 10 rfc822-string))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3617 )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3618 (condition-case error-data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3619 (let ((i 1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3620 (mapc (lambda (m)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3621 (if (string= month-name m)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3622 (setq month i))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3623 (setq i (1+ i)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3624 '("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3625 "Sep" "Oct" "Nov" "Dec"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3626 (encode-time second minute hour day month year t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3627 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3628 (message "Cannot decode \"%s\": %s %s" rfc822-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3629 (car error-data) (cdr error-data))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3630 nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3631 nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3632
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3633 (defun newsticker--lists-intersect-p (list1 list2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3634 "Return t if LIST1 and LIST2 share elements."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3635 (let ((result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3636 (mapc (lambda (elt)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3637 (if (memq elt list2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3638 (setq result t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3639 list1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3640 result))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3641
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3642 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3643 ;;; images
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3644 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3645 (defun newsticker--image-get (feed-name url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3646 "Get image of the news site FEED-NAME from URL.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3647 If the image has been downloaded in the last 24h do nothing."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3648 (let ((image-name (concat newsticker-imagecache-dirname "/"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3649 feed-name)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3650 (if (and (file-exists-p image-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3651 (time-less-p (current-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3652 (time-add (nth 5 (file-attributes image-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3653 (seconds-to-time 86400))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3654 (newsticker--debug-msg "%s: Getting image for %s skipped"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3655 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3656 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3657 ;; download
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3658 (newsticker--debug-msg "%s: Getting image for %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3659 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3660 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3661 (let* ((buffername (concat " *newsticker-wget-image-" feed-name "*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3662 (item (or (assoc feed-name newsticker-url-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3663 (assoc feed-name newsticker-url-list-defaults)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3664 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3665 "Cannot get news for %s: Check newsticker-url-list"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3666 feed-name)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3667 (wget-arguments (or (car (cdr (cdr (cdr (cdr item)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3668 newsticker-wget-arguments)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3669 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3670 (set-buffer (get-buffer-create buffername))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3671 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3672 ;; throw an error if there is an old wget-process around
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3673 (if (get-process feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3674 (error "Another wget-process is running for image %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3675 feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3676 ;; start wget
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3677 (let* ((args (append wget-arguments (list url)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3678 (proc (apply 'start-process feed-name buffername
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3679 newsticker-wget-name args)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3680 (set-process-coding-system proc 'no-conversion 'no-conversion)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3681 (set-process-sentinel proc 'newsticker--image-sentinel)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3682
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3683 (defun newsticker--image-sentinel (process event)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3684 "Sentinel for image-retrieving PROCESS caused by EVENT."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3685 (let* ((p-status (process-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3686 (exit-status (process-exit-status process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3687 (feed-name (process-name process)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3688 ;; catch known errors (zombie processes, rubbish-xml etc.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3689 ;; if an error occurs the news feed is not updated!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3690 (catch 'oops
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3691 (unless (and (eq p-status 'exit)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3692 (= exit-status 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3693 (message "%s: Error while retrieving image from %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3694 (format-time-string "%A, %H:%M" (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3695 feed-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3696 (throw 'oops nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3697 (let (image-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3698 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3699 (set-buffer (process-buffer process))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3700 (setq image-name (concat newsticker-imagecache-dirname "/"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3701 feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3702 (set-buffer-file-coding-system 'no-conversion)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3703 ;; make sure the cache dir exists
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3704 (unless (file-directory-p newsticker-imagecache-dirname)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3705 (make-directory newsticker-imagecache-dirname))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3706 ;; write and close buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3707 (let ((require-final-newline nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3708 (backup-inhibited t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3709 (coding-system-for-write 'no-conversion))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3710 (write-region nil nil image-name nil 'quiet))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3711 (set-buffer-modified-p nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3712 (kill-buffer (current-buffer)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3713
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3714 (defun newsticker--image-read (feed-name-symbol disabled)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3715 "Read the cached image for FEED-NAME-SYMBOL from disk.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3716 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
3717 \(unless `newsticker-enable-logo-manipulations' is not t\).
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3718 Return the image."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3719 (let ((image-name (concat newsticker-imagecache-dirname "/"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3720 (symbol-name feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3721 (img nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3722 (when (file-exists-p image-name)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3723 (condition-case error-data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3724 (setq img (create-image
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3725 image-name nil nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3726 :conversion (and newsticker-enable-logo-manipulations
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3727 disabled
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3728 'disabled)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3729 :mask (and newsticker-enable-logo-manipulations
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3730 'heuristic)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3731 :ascent 70))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3732 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3733 (message "Error: cannot create image: %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3734 (cadr error-data)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3735 img))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3736
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3737 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3738 ;;; imenu stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3739 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3740 (defun newsticker--imenu-create-index ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3741 "Scan newsticker buffer and return an index for imenu."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3742 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3743 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3744 (let ((index-alist nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3745 (feed-list nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3746 (go-ahead t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3747 (while go-ahead
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3748 (let ((type (get-text-property (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3749 (title (get-text-property (point) 'nt-title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3750 (cond ((eq type 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3751 ;; we're on a feed heading
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3752 (when feed-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3753 (if index-alist
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3754 (nconc index-alist (list feed-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3755 (setq index-alist (list feed-list))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3756 (setq feed-list (list title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3757 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3758 (nconc feed-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3759 (list (cons title (point)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3760 (setq go-ahead (newsticker--buffer-goto '(item feed))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3761 (if index-alist
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3762 (nconc index-alist (list feed-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3763 (setq index-alist (list feed-list)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3764 index-alist)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3765
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3766 (defun newsticker--imenu-goto (name pos &rest args)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3767 "Go item NAME at position POS and show item.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3768 ARGS are ignored."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3769 (goto-char pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3770 (newsticker-show-entry))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3771
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3772 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3773 ;;; buffer stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3774 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3775 (defun newsticker--buffer-set-uptodate (value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3776 "Set the uptodate-status of the newsticker buffer to VALUE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3777 The mode-line is changed accordingly."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3778 (setq newsticker--buffer-uptodate-p value)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3779 (let ((b (get-buffer "*newsticker*")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3780 (when b
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3781 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3782 (set-buffer b)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3783 (if value
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3784 (setq mode-name "Newsticker -- up to date -- ")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3785 (setq mode-name "Newsticker -- NEED UPDATE -- ")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3786 (sit-for 0))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3787
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3788 (defun newsticker--buffer-redraw ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3789 "Sometimes (CVS) Emacs forgets to update the window..."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3790 (if (fboundp 'force-window-update)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3791 (force-window-update (current-buffer))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3792 (redraw-frame (selected-frame)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3793 (run-hooks 'newsticker-buffer-change-hook)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3794 (sit-for 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3795
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3796 (defun newsticker--buffer-insert-all-items ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3797 "Insert all cached newsticker items into the current buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3798 Keeps order of feeds as given in `newsticker-url-list' and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3799 `newsticker-url-list-defaults'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3800 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3801 (mapc (lambda (url-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3802 (let* ((feed-name (car url-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3803 (feed-name-symbol (intern feed-name))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3804 (feed (assoc feed-name-symbol newsticker--cache))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3805 (items (cdr feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3806 (pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3807 (when feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3808 ;; insert the feed description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3809 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3810 (when (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3811 (newsticker--buffer-insert-item item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3812 feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3813 items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3814 ;;insert the items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3815 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3816 (if (memq (newsticker--age item) '(new immortal old
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3817 obsolete))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3818 (newsticker--buffer-insert-item item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3819 feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3820 items)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3821 (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
3822
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3823 ;; insert empty line between feeds
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3824 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3825 (insert "\n")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3826 (put-text-property p (point) 'hard t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3827 (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
3828
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3829 (newsticker--buffer-set-faces (point-min) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3830 (newsticker--buffer-set-invisibility (point-min) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3831 (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
3832
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3833 (defun newsticker--buffer-insert-item (item &optional feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3834 "Insert a news item in the current buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3835 Insert the string PREFIX and a formatted representation of the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3836 ITEM. The optional parameter FEED-NAME-SYMBOL determines how the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3837 item is formatted and whether the item-retrieval time is added as
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3838 well."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3839 ;; insert headline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3840 (if (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3841 (newsticker--buffer-do-insert-text item 'feed feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3842 (newsticker--buffer-do-insert-text item 'item feed-name-symbol))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3843 ;; insert the description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3844 (newsticker--buffer-do-insert-text item 'desc feed-name-symbol))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3845
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3846 (defun newsticker--buffer-do-insert-text (item type feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3847 "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
3848 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
3849 FEED-NAME-SYMBOL tells to which feed this item belongs."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3850 (let* ((pos (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3851 (format newsticker-desc-format)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3852 (pos-date-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3853 (pos-date-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3854 (pos-stat-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3855 (pos-stat-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3856 (pos-text-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3857 (pos-text-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3858 (pos-extra-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3859 (pos-extra-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3860 (pos-enclosure-start nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3861 (pos-enclosure-end nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3862 (age (newsticker--age item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3863 (preformatted-contents (newsticker--preformatted-contents item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3864 (preformatted-title (newsticker--preformatted-title item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3865 (cond ((and preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3866 (not (eq (aref preformatted-contents 0) ?\n));; we must
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3867 ;; NOT have a line
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3868 ;; break!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3869 (eq type 'desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3870 (insert preformatted-contents))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3871 ((and preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3872 (not (eq (aref preformatted-title 0) ?\n));; we must NOT have a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3873 ;; line break!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3874 (eq type 'item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3875 (insert preformatted-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3876 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3877 ;; item was not formatted before.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3878 ;; Let's go.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3879 (if (eq type 'item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3880 (setq format newsticker-item-format)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3881 (if (eq type 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3882 (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
3883
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3884 (while (> (length format) 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3885 (let ((prefix (if (> (length format) 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3886 (substring format 0 2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3887 "")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3888 (cond ((string= "%c" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3889 ;; contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3890 (when (newsticker--desc item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3891 (setq pos-text-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3892 (insert (newsticker--desc item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3893 (setq pos-text-end (point-marker)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3894 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3895 ((string= "%d" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3896 ;; date
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3897 (setq pos-date-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3898 (if (newsticker--time item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3899 (insert (format-time-string newsticker-date-format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3900 (newsticker--time item))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3901 (setq pos-date-end (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3902 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3903 ((string= "%l" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3904 ;; logo
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3905 (let ((disabled (cond ((eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3906 (= (newsticker--stat-num-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3907 feed-name-symbol 'new) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3908 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3909 (not (eq (newsticker--age item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3910 'new))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3911 (let ((img (newsticker--image-read feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3912 disabled)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3913 (when img
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3914 (newsticker--insert-image img (car item)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3915 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3916 ((string= "%L" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3917 ;; logo or title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3918 (let ((disabled (cond ((eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3919 (= (newsticker--stat-num-items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3920 feed-name-symbol 'new) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3921 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3922 (not (eq (newsticker--age item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3923 'new))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3924 (let ((img (newsticker--image-read feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3925 disabled)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3926 (if img
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3927 (newsticker--insert-image img (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3928 (when (car item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3929 (setq pos-text-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3930 (if (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3931 (insert (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3932 ;; FIXME: This is not the "real" title!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3933 (insert (format "%s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3934 (car (newsticker--cache-get-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3935 feed-name-symbol)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3936 (setq pos-text-end (point-marker))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3937 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3938 ((string= "%s" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3939 ;; statistics
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3940 (setq pos-stat-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3941 (if (eq (newsticker--age item) 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3942 (insert (newsticker--buffer-statistics
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3943 feed-name-symbol)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3944 (setq pos-stat-end (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3945 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3946 ((string= "%t" prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3947 ;; title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3948 (when (car item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3949 (setq pos-text-start (point-marker))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3950 (insert (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3951 (setq pos-text-end (point-marker)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3952 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3953 ((string-match "%." prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3954 ;; unknown specifier!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3955 (insert prefix)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3956 (setq format (substring format 2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3957 ((string-match "^\\([^%]*\\)\\(.*\\)" format) ;; FIXME!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3958 ;; everything else
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3959 (let ((p (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3960 (insert (substring format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3961 (match-beginning 1) (match-end 1)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3962 ;; in case that the format string contained newlines
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3963 (put-text-property p (point) 'hard t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3964 (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
3965
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3966 ;; decode HTML if possible...
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3967 (let ((is-rendered-HTML nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3968 (when (and newsticker-html-renderer pos-text-start pos-text-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3969 (condition-case error-data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3970 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3971 ;; check whether it is necessary to call html renderer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3972 ;; (regexp inspired by htmlr.el)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3973 (goto-char pos-text-start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3974 (when (re-search-forward
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3975 "</?[A-Za-z1-6]*\\|&#?[A-Za-z0-9]+;" pos-text-end t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3976 ;; (message "%s" (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3977 (let ((w3m-fill-column (if newsticker-use-full-width
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3978 -1 fill-column))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3979 (w3-maximum-line-length
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3980 (if newsticker-use-full-width nil fill-column)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3981 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3982 (funcall newsticker-html-renderer pos-text-start
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3983 pos-text-end)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3984 (cond ((eq newsticker-html-renderer 'w3m-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3985 (add-text-properties pos (point-max)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3986 (list 'keymap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3987 w3m-minor-mode-map)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3988 ((eq newsticker-html-renderer 'w3-region)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3989 (add-text-properties pos (point-max)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3990 (list 'keymap w3-mode-map))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3991 (setq is-rendered-HTML t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3992 (error
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3993 (message "Error: HTML rendering failed: %s, %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3994 (car error-data) (cdr error-data)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3995 (when (and newsticker-justification
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3996 (eq type 'desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3997 (not is-rendered-HTML))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3998 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3999 (let ((use-hard-newlines t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4000 (fill-region pos (point-max) newsticker-justification))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4001 (error nil))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4002
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4003 ;; remove leading and trailing newlines
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4004 (goto-char pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4005 (unless (= 0 (skip-chars-forward " \t\r\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4006 (delete-region pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4007 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4008 (let ((end (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4009 (unless (= 0 (skip-chars-backward " \t\r\n" (1+ pos)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4010 (delete-region (point) end)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4011 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4012
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4013 ;; closing newline
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4014 (unless nil ;;(eq pos (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4015 (insert "\n")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4016 (put-text-property (1- (point)) (point) 'hard t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4017
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4018 ;; insert enclosure element
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4019 (when (eq type 'desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4020 (setq pos-enclosure-start (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4021 (newsticker--buffer-insert-enclosure item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4022 (setq pos-enclosure-end (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4023
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4024 ;; show extra elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4025 (when (eq type 'desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4026 (goto-char (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4027 (setq pos-extra-start (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4028 (mapc (lambda (extra-element)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4029 (unless (memq (car extra-element)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4030 '(items link title description
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4031 content:encoded
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4032 dc:subject dc:date item guid
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4033 pubDate
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4034 enclosure))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4035 (newsticker--buffer-print-extra-element
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4036 extra-element)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4037 (newsticker--extra item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4038 (setq pos-extra-end (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4039
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4040 ;; text properties
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4041 (when (memq type '(feed item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4042 (add-text-properties pos (1- (point))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4043 (list 'mouse-face 'highlight
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4044 'nt-link (newsticker--link item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4045 'help-echo
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4046 (format "mouse-2: visit item (%s)"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4047 (newsticker--link item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4048 'keymap newsticker--url-keymap))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4049 (add-text-properties pos (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4050 (list 'nt-title (newsticker--title item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4051 '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
4052
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4053 (add-text-properties pos (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4054 (list 'nt-type type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4055 'nt-face type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4056 'nt-age age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4057 'nt-guid (newsticker--guid item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4058 (when (and pos-date-start pos-date-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4059 (put-text-property pos-date-start pos-date-end 'nt-face 'date))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4060 (when (and pos-stat-start pos-stat-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4061 (put-text-property pos-stat-start pos-stat-end 'nt-face 'stat))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4062 (when (and pos-extra-start pos-extra-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4063 (put-text-property pos-extra-start pos-extra-end
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4064 'nt-face 'extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4065 (put-text-property pos-extra-start pos-extra-end
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4066 'nt-type 'extra))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4067 (when (and pos-enclosure-start pos-enclosure-end
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4068 (> pos-enclosure-end pos-enclosure-start))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4069 (put-text-property pos-enclosure-start (1- pos-enclosure-end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4070 'nt-face 'enclosure))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4071
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4072 ;; left margin
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4073 ;;(unless (memq type '(feed item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4074 ;;(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
4075
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4076 ;; save rendered stuff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4077 (cond ((eq type 'desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4078 ;; preformatted contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4079 (newsticker--cache-set-preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4080 item (buffer-substring pos (point))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4081 ((eq type 'item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4082 ;; preformatted title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4083 (newsticker--cache-set-preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4084 item (buffer-substring pos (point)))))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4085
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4086 (defun newsticker--buffer-print-extra-element (extra-element)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4087 "Insert EXTRA-ELEMENT in a pretty form into the current buffer."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4088 (insert (format "%s:\t" (car extra-element)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4089 (let (;;(attributes (cadr extra-element)) ;FIXME!!!!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4090 (contents (cddr extra-element)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4091 (cond ((listp contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4092 (mapc (lambda (i)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4093 (if (and (stringp i)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4094 (string-match "^http://.*" i))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4095 (let ((pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4096 (insert i " ") ; avoid self-reference from the
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4097 ; nt-link thing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4098 (add-text-properties
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4099 pos (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4100 (list 'mouse-face 'highlight
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4101 'nt-link i
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4102 'help-echo
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4103 (format "mouse-2: visit (%s)" i)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4104 'keymap newsticker--url-keymap)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4105 (insert (format "%s" i))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4106 contents))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4107 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4108 (insert (format "%s" contents))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4109 (insert "\n")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4110
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4111 (defun newsticker--buffer-insert-enclosure (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4112 "Insert enclosure element of an RSS ITEM into the current buffer."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4113 (let ((enclosure (newsticker--enclosure item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4114 (beg (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4115 (when enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4116 (let ((url (cdr (assoc 'url enclosure)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4117 (length (cdr (assoc 'length enclosure)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4118 (type (cdr (assoc 'type enclosure))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4119 (insert (format "Enclosed file (%s, %1.2f kBytes)" type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4120 (/ (string-to-number length) 1024)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4121 (add-text-properties beg (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4122 (list 'mouse-face 'highlight
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4123 'nt-link url
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4124 'help-echo (format
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4125 "mouse-2: visit (%s)" url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4126 'keymap newsticker--url-keymap
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4127 'nt-face 'enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4128 'nt-type 'desc))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4129 (insert "\n")))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4130
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4131 (defun newsticker--buffer-statistics (feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4132 "Return a statistic string for the feed given by FEED-NAME-SYMBOL.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4133 See `newsticker-statistics-format'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4134 (let ((case-fold-search nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4135 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4136 "%a"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4137 (format "%d" (newsticker--stat-num-items feed-name-symbol))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4138 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4139 "%i"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4140 (format "%d" (newsticker--stat-num-items feed-name-symbol 'immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4141 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4142 "%n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4143 (format "%d" (newsticker--stat-num-items feed-name-symbol 'new))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4144 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4145 "%o"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4146 (format "%d" (newsticker--stat-num-items feed-name-symbol 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4147 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4148 "%O"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4149 (format "%d" (newsticker--stat-num-items feed-name-symbol 'obsolete))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4150 newsticker-statistics-format)))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4151
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4152 (defun newsticker--buffer-set-faces (start end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4153 "Add face properties according to mark property.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4154 Scans the buffer between START and END."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4155 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4156 ;;(put-text-property start end 'face 'newsticker-default-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4157 (goto-char start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4158 (let ((pos1 start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4159 (pos2 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4160 (nt-face (get-text-property start 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4161 (nt-age (get-text-property start 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4162 (when nt-face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4163 (setq pos2 (next-single-property-change (point) 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4164 (newsticker--set-face-properties pos1 pos2 nt-face nt-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4165 (setq nt-face (get-text-property pos2 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4166 (setq pos1 pos2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4167 (while (and (setq pos2 (next-single-property-change pos1 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4168 (<= pos2 end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4169 (> pos2 pos1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4170 (newsticker--set-face-properties pos1 pos2 nt-face nt-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4171 (setq nt-face (get-text-property pos2 'nt-face))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4172 (setq nt-age (get-text-property pos2 'nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4173 (setq pos1 pos2)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4174
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4175 (defun newsticker--buffer-set-invisibility (start end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4176 "Add invisibility properties according to nt-type property.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4177 Scans the buffer between START and END. Sets the 'invisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4178 property to '(<nt-type>-<nt-age> <nt-type> <nt-age>)."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4179 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4180 ;; reset invisibility settings
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4181 (put-text-property start end 'invisible nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4182 ;; let's go
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4183 (goto-char start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4184 (let ((pos1 start)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4185 (pos2 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4186 (nt-type (get-text-property start 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4187 (nt-age (get-text-property start 'nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4188 (when nt-type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4189 (setq pos2 (next-single-property-change (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4190 (put-text-property (max (point-min) pos1) (1- pos2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4191 'invisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4192 (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
4193 (concat
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4194 (symbol-name
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4195 (if (eq nt-type 'extra) 'desc nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4196 "-"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4197 (symbol-name nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4198 nt-type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4199 nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4200 (setq nt-type (get-text-property pos2 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4201 (setq pos1 pos2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4202 (while (and (setq pos2 (next-single-property-change pos1 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4203 (<= pos2 end)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4204 (> pos2 pos1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4205 ;; must shift one char to the left in order to handle inivisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4206 ;; newlines, motion in invisible text areas and all that correctly
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4207 (put-text-property (1- pos1) (1- pos2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4208 'invisible
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4209 (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
4210 (concat
e3c81c2db803 (tool-bar-map, w3-mode-map, w3m-minor-mode-map): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents: 65481
diff changeset
4211 (symbol-name
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4212 (if (eq nt-type 'extra) 'desc nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4213 "-"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4214 (symbol-name nt-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4215 nt-type
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4216 nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4217 (setq nt-type (get-text-property pos2 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4218 (setq nt-age (get-text-property pos2 'nt-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4219 (setq pos1 pos2)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4220
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4221 (defun newsticker--set-face-properties (pos1 pos2 nt-face age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4222 "Set the face for the text between the positions POS1 and POS2.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4223 The face is chosen according the values of NT-FACE and AGE."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4224 (let ((face (cond ((eq nt-face 'feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4225 'newsticker-feed-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4226 ((eq nt-face 'item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4227 (cond ((eq age 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4228 'newsticker-new-item-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4229 ((eq age 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4230 'newsticker-old-item-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4231 ((eq age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4232 'newsticker-immortal-item-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4233 ((eq age 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4234 'newsticker-obsolete-item-face)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4235 ((eq nt-face 'date)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4236 'newsticker-date-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4237 ((eq nt-face 'stat)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4238 'newsticker-statistics-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4239 ((eq nt-face 'extra)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4240 'newsticker-extra-face)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4241 ((eq nt-face 'enclosure)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4242 'newsticker-enclosure-face))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4243 (when face
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4244 (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
4245
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4246 (defun newsticker--insert-image (img string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4247 "Insert IMG with STRING at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4248 This is a work-around for a strange behavior of Emacs versions before
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4249 21.3.50. Images inserted with `insert-image' vanished after doing
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4250 `fill-region'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4251 ;; This should work:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4252 ;;(insert-image img string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4253 ;; but it does not. Therefore we do this, which should be equivalent!
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4254 (let ((pos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4255 ;;(insert string)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4256 (insert ":-)")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4257 (add-text-properties pos (point) (list 'display img))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4258
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4259 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4260 ;;; HTML rendering
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4261 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4262 (defun newsticker-htmlr-render (pos1 pos2) ;
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4263 "Replacement for `htmlr-render'.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4264 Renders the HTML code in the region POS1 to POS2 using htmlr."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4265 (let ((str (buffer-substring-no-properties pos1 pos2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4266 (delete-region pos1 pos2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4267 (insert
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4268 (with-temp-buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4269 (insert str)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4270 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4271 ;; begin original htmlr-render
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4272 (htmlr-reset)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4273 ;; something omitted here...
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4274 (while (< (point) (point-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4275 (htmlr-step))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4276 ;; end original htmlr-render
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4277 (newsticker--remove-whitespace (buffer-string))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4278
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4279 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4280 ;;; Functions working on the *newsticker* buffer
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4281 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4282 (defun newsticker--buffer-make-item-completely-visible ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4283 "Scroll buffer until current item is completely visible."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4284 (switch-to-buffer (get-buffer-create "*newsticker*"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4285 (when newsticker--auto-narrow-to-feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4286 (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4287 (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4288 (max (or (save-excursion (newsticker--buffer-end-of-feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4289 (point-max))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4290 (narrow-to-region min max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4291 (when newsticker--auto-narrow-to-item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4292 (let* ((min (or (save-excursion (newsticker--buffer-beginning-of-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4293 (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4294 (max (or (save-excursion (newsticker--buffer-end-of-item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4295 (point-max))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4296 (narrow-to-region min max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4297 (sit-for 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4298 ;; 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
4299 ;; are displayed. Do it the simple way:
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4300 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4301 (newsticker--buffer-end-of-item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4302 (unless (pos-visible-in-window-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4303 (recenter -1)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4304 (unless (pos-visible-in-window-p)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4305 (recenter 0)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4306
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4307 (defun newsticker--buffer-get-feed-title-at-point ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4308 "Return feed symbol of headline at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4309 (format "%s" (or (get-text-property (point) 'feed) " ")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4310
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4311 (defun newsticker--buffer-get-item-title-at-point ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4312 "Return feed symbol of headline at point."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4313 (format "%s" (or (get-text-property (point) 'nt-title) " ")))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4314
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4315 (defun newsticker--buffer-goto (types &optional age backwards)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4316 "Search next occurrence of TYPES in current buffer.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4317 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
4318 not point is left unchanged. If optional parameter AGE is not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4319 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
4320 backwards."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4321 (let ((pos (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4322 (save-restriction
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4323 (widen)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4324 (catch 'found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4325 (let ((tpos (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4326 (while (setq tpos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4327 (if backwards
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4328 (if (eq tpos (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4329 nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4330 (or (previous-single-property-change
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4331 tpos 'nt-type)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4332 (point-min)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4333 (next-single-property-change
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4334 tpos 'nt-type)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4335 (and (memq (get-text-property tpos 'nt-type) types)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4336 (or (not age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4337 (eq (get-text-property tpos 'nt-age) age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4338 (throw 'found tpos)))))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4339 (when pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4340 (goto-char pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4341 pos))
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 (defun newsticker--buffer-hideshow (mark-age onoff )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4344 "Hide or show items of type MARK-AGE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4345 If ONOFF is nil the item is hidden, otherwise it is shown."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4346 (if onoff
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4347 (remove-from-invisibility-spec mark-age )
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4348 (add-to-invisibility-spec mark-age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4349
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4350 (defun newsticker--buffer-beginning-of-item ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4351 "Move point to the beginning of the item at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4352 Return new position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4353 (if (bobp)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4354 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4355 (let ((type (get-text-property (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4356 (typebefore (get-text-property (1- (point)) 'nt-type)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4357 (if (and (memq type '(item feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4358 (not (eq type typebefore)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4359 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4360 (newsticker--buffer-goto '(item feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4361 (point)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4362
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4363 (defun newsticker--buffer-beginning-of-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4364 "Move point to the beginning of the feed at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4365 Return new position."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4366 (if (bobp)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4367 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4368 (let ((type (get-text-property (point) 'nt-type))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4369 (typebefore (get-text-property (1- (point)) 'nt-type)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4370 (if (and (memq type '(feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4371 (not (eq type typebefore)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4372 (point)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4373 (newsticker--buffer-goto '(feed) nil t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4374 (point)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4375
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4376 (defun newsticker--buffer-end-of-item ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4377 "Move point to the end of the item at point.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4378 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
4379 (when (newsticker--buffer-goto '(item feed nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4380 (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4381
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4382 (defun newsticker--buffer-end-of-feed ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4383 "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
4384 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
4385 (when (newsticker--buffer-goto '(feed nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4386 (backward-char 1)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4387 (point)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4388
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4389 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4390 ;;; manipulation of ticker text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4391 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4392 (defun newsticker--ticker-text-setup ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4393 "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
4394 ;; reset scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4395 (setq newsticker--scrollable-text "")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4396 (setq newsticker--item-list nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4397 (setq newsticker--item-position 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4398 ;; build scrollable text from cache data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4399 (let ((have-something nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4400 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4401 (lambda (feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4402 (let ((feed-name (symbol-name (car feed))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4403 (let ((num-new (newsticker--stat-num-items (car feed) 'new))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4404 (num-old (newsticker--stat-num-items (car feed) 'old))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4405 (num-imm (newsticker--stat-num-items (car feed) 'immortal))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4406 (num-obs (newsticker--stat-num-items (car feed) 'obsolete)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4407 (when (or (> num-new 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4408 (and (> num-old 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4409 (not newsticker-hide-old-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4410 (and (> num-imm 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4411 (not newsticker-hide-immortal-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4412 (and (> num-obs 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4413 (not newsticker-hide-obsolete-items-in-echo-area)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4414 (setq have-something t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4415 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4416 (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4417 (let ((title (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4418 "[\r\n]+" " "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4419 (newsticker--title item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4420 (age (newsticker--age item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4421 (unless (string= title newsticker--error-headline)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4422 (when
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4423 (or (eq age 'new)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4424 (and (eq age 'old)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4425 (not newsticker-hide-old-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4426 (and (eq age 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4427 (not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4428 newsticker-hide-obsolete-items-in-echo-area))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4429 (and (eq age 'immortal)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4430 (not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4431 newsticker-hide-immortal-items-in-echo-area)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4432 (setq title (newsticker--remove-whitespace title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4433 ;; add to flash list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4434 (add-to-list 'newsticker--item-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4435 (concat feed-name ": " title) t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4436 ;; and to the scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4437 (setq newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4438 (concat newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4439 " " feed-name ": " title " +++"))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4440 (cdr feed))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4441 newsticker--cache)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4442 (when have-something
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4443 (setq newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4444 (concat "+++ "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4445 (format-time-string "%A, %H:%M"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4446 newsticker--latest-update-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4447 " ++++++" newsticker--scrollable-text)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4448
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4449 (defun newsticker--ticker-text-remove (feed title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4450 "Remove the item of FEED with TITLE from the ticker text."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4451 ;; reset scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4452 (setq newsticker--item-position 0)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4453 (let ((feed-name (symbol-name feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4454 (t-title (replace-regexp-in-string "[\r\n]+" " " title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4455 ;; remove from flash list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4456 (setq newsticker--item-list (remove (concat feed-name ": " t-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4457 newsticker--item-list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4458 ;; and from the scrollable text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4459 (setq newsticker--scrollable-text
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4460 (replace-regexp-in-string
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4461 (regexp-quote (concat " " feed-name ": " t-title " +++"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4462 ""
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4463 newsticker--scrollable-text))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4464 (if (string-match (concat "^\\+\\+\\+ [A-Z][a-z]+, "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4465 "[012]?[0-9]:[0-9][0-9] \\+\\+\\+\\+\\+\\+$")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4466 newsticker--scrollable-text)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4467 (setq newsticker--scrollable-text ""))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4469 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4470 ;;; manipulation of cached data
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4471 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4472 (defun newsticker--cache-set-preformatted-contents (item contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4473 "Set preformatted contents of ITEM to CONTENTS."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4474 (if (nthcdr 6 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4475 (setcar (nthcdr 6 item) contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4476 (setcdr (nthcdr 5 item) (list contents))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4477
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4478 (defun newsticker--cache-set-preformatted-title (item title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4479 "Set preformatted title of ITEM to TITLE."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4480 (if (nthcdr 7 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4481 (setcar (nthcdr 7 item) title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4482 (setcdr (nthcdr 6 item) title)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4483
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4484 (defun newsticker--cache-replace-age (data feed old-age new-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4485 "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
4486 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
4487 all marks are replaced by NEW-AGE. Removes all pre-formatted contents."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4488 (mapc (lambda (a-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4489 (when (or (eq feed 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4490 (eq (car a-feed) feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4491 (let ((items (cdr a-feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4492 (mapc (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4493 (when (or (eq old-age 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4494 (eq (newsticker--age item) old-age))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4495 (setcar (nthcdr 4 item) new-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4496 (newsticker--do-forget-preformatted item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4497 items))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4498 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4499 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4500
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4501 (defun newsticker--cache-mark-expired (data feed old-age new-age time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4502 "Mark all expired entries.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4503 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
4504 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
4505 older than TIME."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4506 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4507 (lambda (a-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4508 (when (or (eq feed 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4509 (eq (car a-feed) feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4510 (let ((items (cdr a-feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4511 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4512 (lambda (item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4513 (when (eq (newsticker--age item) old-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4514 (let ((exp-time (time-add (newsticker--time item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4515 (seconds-to-time time))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4516 (when (time-less-p exp-time (current-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4517 (newsticker--debug-msg
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4518 "Item `%s' from %s has expired on %s"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4519 (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
4520 (format-time-string "%Y-%02m-%d, %H:%M"
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4521 (newsticker--time item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4522 (format-time-string "%Y-%02m-%d, %H:%M" exp-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4523 (setcar (nthcdr 4 item) new-age)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4524 items))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4525 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4526 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4527
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4528 (defun newsticker--cache-contains (data feed title desc link age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4529 &optional guid)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4530 "Check DATA whether FEED contains an item with the given properties.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4531 This function returns the contained item or nil if it is not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4532 contained.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4533 The properties which are checked are TITLE, DESC, LINK, AGE, and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4534 GUID. In general all properties must match in order to return a
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4535 certain item, except for the following cases.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4536
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4537 If AGE equals 'feed the TITLE, DESCription and LINK do not
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4538 matter. If DESC is nil it is ignored as well. If
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4539 `newsticker-desc-comp-max' is non-nil, only the first
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4540 `newsticker-desc-comp-max' characters of DESC are taken into
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4541 account.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4542
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4543 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
4544 other properties are ignored."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4545 (condition-case nil
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4546 (catch 'found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4547 (when (and desc newsticker-desc-comp-max
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4548 (> (length desc) newsticker-desc-comp-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4549 (setq desc (substring desc 0 newsticker-desc-comp-max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4550 (mapc
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4551 (lambda (this-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4552 (when (eq (car this-feed) feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4553 (mapc (lambda (anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4554 (when (or
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4555 ;; global unique id can match
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4556 (and guid
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4557 (string= guid (newsticker--guid anitem)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4558 ;; or title, desc, etc.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4559 (and
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4560 ;;(or (not (eq age 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4561 ;; (eq (newsticker--age anitem) 'feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4562 (string= (newsticker--title anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4563 title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4564 (or (not link)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4565 (string= (newsticker--link anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4566 link))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4567 (or (not desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4568 (if (and desc newsticker-desc-comp-max
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4569 (> (length (newsticker--desc anitem))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4570 newsticker-desc-comp-max))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4571 (string= (substring
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4572 (newsticker--desc anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4573 0 newsticker-desc-comp-max)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4574 desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4575 (string= (newsticker--desc anitem)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4576 desc)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4577 (throw 'found anitem)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4578 (cdr this-feed))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4579 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4580 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4581 (error nil)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4582
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4583 (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
4584 position extra-elements
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4585 &optional updated-age updated-time
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4586 preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4587 preformatted-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4588 "Add another item to cache data.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4589 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
4590 LINK, TIME, AGE, POSITION, and EXTRA-ELEMENTS. If this item is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4591 contained already, its mark is set to UPDATED-AGE, its time is
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4592 set to UPDATED-TIME, and its pre-formatted contents is set to
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4593 PREFORMATTED-CONTENTS and PREFORMATTED-TITLE. Returns the age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4594 which the item got."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4595 (let ((item (newsticker--cache-contains data feed-name-symbol title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4596 desc link age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4597 (if item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4598 ;; does exist already -- change age, update time and position
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4599 (progn
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4600 (if (nthcdr 5 item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4601 (setcar (nthcdr 5 item) position)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4602 (setcdr (nthcdr 4 item) (list position)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4603 (setcar (nthcdr 4 item) updated-age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4604 (if updated-time
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4605 (setcar (nthcdr 3 item) updated-time))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4606 ;; replace cached pre-formatted contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4607 (newsticker--cache-set-preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4608 item preformatted-contents)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4609 (newsticker--cache-set-preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4610 item preformatted-title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4611 ;; did not exist or age equals 'feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4612 (catch 'found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4613 (mapc (lambda (this-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4614 (when (eq (car this-feed) feed-name-symbol)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4615 (setcdr this-feed (nconc (cdr this-feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4616 (list (list title desc link
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4617 time age position
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4618 preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4619 preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4620 extra-elements))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4621 (throw 'found this-feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4622 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4623 ;; the feed is not contained
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4624 (add-to-list 'data (list feed-name-symbol
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4625 (list title desc link time age position
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4626 preformatted-contents
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4627 preformatted-title
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4628 extra-elements))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4629 t))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4630 data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4631
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4632 (defun newsticker--cache-remove (data feed-symbol age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4633 "Remove all entries from DATA in the feed FEED-SYMBOL with AGE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4634 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
4635 `newsticker-url-list' or `newsticker-url-list-defaults', are removed as
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4636 well."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4637 (let* ((pos data)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4638 (feed (car pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4639 (last-pos nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4640 (while feed
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4641 (if (or (assoc (symbol-name (car feed)) newsticker-url-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4642 (assoc (symbol-name (car feed)) newsticker-url-list-defaults))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4643 ;; feed is still valid=active
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4644 ;; (message "Keeping feed %s" (car feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4645 (if (or (eq feed-symbol 'any)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4646 (eq feed-symbol (car feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4647 (let* ((item-pos (cdr feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4648 (item (car item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4649 (prev-pos nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4650 (while item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4651 ;;(message "%s" (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4652 (if (eq age (newsticker--age item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4653 ;; remove this item
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4654 (progn
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4655 ;;(message "Removing item %s" (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4656 (if prev-pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4657 (setcdr prev-pos (cdr item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4658 (setcdr feed (cdr item-pos))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4659 ;;(message "Keeping item %s" (car item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4660 (setq prev-pos item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4661 (setq item-pos (cdr item-pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4662 (setq item (car item-pos)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4663 ;; feed is not active anymore
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4664 ;; (message "Removing feed %s" (car feed))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4665 (if last-pos
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4666 (setcdr last-pos (cdr pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4667 (setq data (cdr pos))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4668 (setq last-pos pos)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4669 (setq pos (cdr pos))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4670 (setq feed (car pos)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4671
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4672 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4673 ;;; Sorting
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4674 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4675 (defun newsticker--cache-item-compare-by-time (item1 item2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4676 "Compare two news items ITEM1 and ITEM2 by comparing their time values."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4677 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4678 (let ((age1 (newsticker--age item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4679 (age2 (newsticker--age item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4680 (if (not (eq age1 age2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4681 (cond ((eq age1 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4682 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4683 ((eq age2 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4684 (throw 'result t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4685 (let* ((time1 (newsticker--time item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4686 (time2 (newsticker--time item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4687 (cond ((< (nth 0 time1) (nth 0 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4688 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4689 ((> (nth 0 time1) (nth 0 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4690 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4691 ((< (nth 1 time1) (nth 1 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4692 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4693 ((> (nth 1 time1) (nth 1 time2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4694 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4695 ((< (or (nth 2 time1) 0) (or (nth 2 time2) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4696 nil)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4697 ((> (or (nth 2 time1) 0) (or (nth 2 time2) 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4698 t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4699 (t
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4700 nil)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4701
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4702 (defun newsticker--cache-item-compare-by-title (item1 item2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4703 "Compare ITEM1 and ITEM2 by comparing their titles."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4704 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4705 (let ((age1 (newsticker--age item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4706 (age2 (newsticker--age item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4707 (if (not (eq age1 age2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4708 (cond ((eq age1 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4709 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4710 ((eq age2 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4711 (throw 'result t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4712 (string< (newsticker--title item1) (newsticker--title item2))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4713
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4714 (defun newsticker--cache-item-compare-by-position (item1 item2)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4715 "Compare ITEM1 and ITEM2 by comparing their original positions."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4716 (catch 'result
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4717 (let ((age1 (newsticker--age item1))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4718 (age2 (newsticker--age item2)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4719 (if (not (eq age1 age2))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4720 (cond ((eq age1 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4721 (throw 'result nil))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4722 ((eq age2 'obsolete)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4723 (throw 'result t)))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4724 (< (or (newsticker--pos item1) 0) (or (newsticker--pos item2) 0))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4725
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4726 (defun newsticker--cache-sort ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4727 "Sort the newsticker cache data."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4728 (let ((sort-fun (cond ((eq newsticker-sort-method 'sort-by-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4729 'newsticker--cache-item-compare-by-time)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4730 ((eq newsticker-sort-method 'sort-by-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4731 'newsticker--cache-item-compare-by-title)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4732 ((eq newsticker-sort-method 'sort-by-original-order)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4733 'newsticker--cache-item-compare-by-position))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4734 (mapc (lambda (feed-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4735 (setcdr feed-list (sort (cdr feed-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4736 sort-fun)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4737 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
4738
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4739 (defun newsticker--cache-update (&optional save)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4740 "Update newsticker cache file.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4741 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
4742 (save-excursion
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4743 (let ((coding-system-for-write 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4744 (buf (find-file-noselect newsticker-cache-filename)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4745 (when buf
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4746 (set-buffer buf)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4747 (setq buffer-undo-list t)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4748 (erase-buffer)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4749 (insert ";; -*- coding: utf-8 -*-\n")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4750 (insert (prin1-to-string newsticker--cache))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4751 (when save
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4752 (save-buffer))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4753
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4754 (defun newsticker--cache-get-feed (feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4755 "Return the cached data for the feed FEED.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4756 FEED is a symbol!"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4757 (assoc feed newsticker--cache))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4758
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4759 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4760 ;;; Statistics
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4761 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4762 (defun newsticker--stat-num-items (feed &optional age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4763 "Return number of items in the given FEED which have the given AGE.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4764 If AGE is nil, the total number items is returned."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4765 (let ((items (cdr (newsticker--cache-get-feed feed)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4766 (num 0))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4767 (while items
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4768 (if age
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4769 (if (eq (newsticker--age (car items)) age)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4770 (setq num (1+ num)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4771 (if (memq (newsticker--age (car items)) '(new old immortal obsolete))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4772 (setq num (1+ num))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4773 (setq items (cdr items)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4774 num))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4775
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4776 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4777 ;;; OPML
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4778 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4779 (defun newsticker-opml-export ()
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4780 "OPML subscription export.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4781 Export subscriptions to a buffer in OPML Format."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4782 (interactive)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4783 (with-current-buffer (get-buffer-create "*OPML Export*")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4784 (set-buffer-file-coding-system 'utf-8)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4785 (insert (concat
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4786 "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4787 "<!-- OPML generated by Emacs newsticker.el -->\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4788 "<opml version=\"1.0\">\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4789 " <head>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4790 " <title>mySubscriptions</title>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4791 " <dateCreated>" (format-time-string "%a, %d %b %Y %T %z")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4792 "</dateCreated>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4793 " <ownerEmail>" user-mail-address "</ownerEmail>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4794 " <ownerName>" (user-full-name) "</ownerName>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4795 " </head>\n"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4796 " <body>\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4797 (mapc (lambda (sub)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4798 (insert " <outline text=\"")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4799 (insert (newsticker--title sub))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4800 (insert "\" xmlUrl=\"")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4801 (insert (cadr sub))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4802 (insert "\"/>\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4803 (append newsticker-url-list newsticker-url-list-defaults))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4804 (insert " </body>\n</opml>\n"))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4805 (pop-to-buffer "*OPML Export*")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4806 (when (fboundp 'sgml-mode)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4807 (sgml-mode)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4808
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4809 (defun newsticker-opml-import (filename)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4810 "Import OPML data from FILENAME."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4811 (interactive "fOPML file: ")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4812 (set-buffer (find-file-noselect filename))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4813 (goto-char (point-min))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4814 (let* ((node-list (xml-parse-region (point-min) (point-max)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4815 (body (car (xml-get-children (car node-list) 'body)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4816 (outlines (xml-get-children body 'outline)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4817 (mapc (lambda (outline)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4818 (let ((name (xml-get-attribute outline 'text))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4819 (url (xml-get-attribute outline 'xmlUrl)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4820 (add-to-list 'newsticker-url-list
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4821 (list name url nil nil nil) t)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4822 outlines))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4823 (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
4824
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4825 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4826 ;;; Auto marking
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4827 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4828 (defun newsticker--run-auto-mark-filter (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4829 "Automatically mark an item as old or immortal.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4830 This function checks the variable `newsticker-auto-mark-filter'
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4831 for an entry that matches FEED and ITEM."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4832 (let ((case-fold-search t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4833 (mapc (lambda (filter)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4834 (let ((filter-feed (car filter))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4835 (old-list (nth 1 filter))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4836 (imm-list (nth 2 filter)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4837 (when (string-match filter-feed feed)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4838 (newsticker--do-run-auto-mark-filter item 'old old-list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4839 (newsticker--do-run-auto-mark-filter item 'immortal imm-list))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4840 newsticker-auto-mark-filter)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4841
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4842 (defun newsticker--do-run-auto-mark-filter (item age list)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4843 "Actually compare ITEM AGE LIST against `newsticker-auto-mark-filter'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4844 (mapc (lambda (pattern)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4845 (when (string-match pattern (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4846 (setcar (nthcdr 4 item) age)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4847 list))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4848
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4849
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4850 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4851 ;;; hook samples
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4852 ;; ======================================================================
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4853 (defun newsticker-new-item-functions-sample (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4854 "Demonstrate the use of the `newsticker-new-item-functions' hook.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4855 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
4856 (message (concat "newsticker-new-item-functions-sample: feed=`%s', "
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4857 "title=`%s'")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4858 feed (newsticker--title item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4859
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4860 (defun newsticker-download-images (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4861 "Download the first image.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4862 If FEED equals \"imagefeed\" download the first image URL found
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4863 in the description=contents of ITEM to the directory
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4864 \"~/tmp/newsticker/FEED/TITLE\" where TITLE is the title of the item."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4865 (when (string= feed "imagefeed")
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4866 (let ((title (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4867 (desc (newsticker--desc item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4868 (when (string-match "<img src=\"\\(http://[^ \"]+\\)\"" desc)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4869 (let ((url (substring desc (match-beginning 1) (match-end 1)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4870 (temp-dir (concat "~/tmp/newsticker/" feed "/" title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4871 (org-dir default-directory))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4872 (unless (file-directory-p temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4873 (make-directory temp-dir t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4874 (cd temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4875 (message "Getting image %s" url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4876 (apply 'start-process "wget-image"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4877 " *newsticker-wget-download-images*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4878 newsticker-wget-name
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4879 (list url))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4880 (cd org-dir))))))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4881
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4882 (defun newsticker-download-enclosures (feed item)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4883 "In all FEEDs download the enclosed object of the news ITEM.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4884 The object is saved to the directory \"~/tmp/newsticker/FEED/TITLE\", which
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4885 is created if it does not exist. TITLE is the title of the news
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4886 item. Argument FEED is ignored.
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4887 This function is suited for adding it to `newsticker-new-item-functions'."
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4888 (let ((title (newsticker--title item))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4889 (enclosure (newsticker--enclosure item)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4890 (when enclosure
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4891 (let ((url (cdr (assoc 'url enclosure)))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4892 (temp-dir (concat "~/tmp/newsticker/" feed "/" title))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4893 (org-dir default-directory))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4894 (unless (file-directory-p temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4895 (make-directory temp-dir t))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4896 (cd temp-dir)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4897 (message "Getting enclosure %s" url)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4898 (apply 'start-process "wget-enclosure"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4899 " *newsticker-wget-download-enclosures*"
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4900 newsticker-wget-name
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4901 (list url))
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4902 (cd org-dir)))))
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
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4905 (provide 'newsticker)
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4906
65481
59060d7bf36c Add arch tagline
Miles Bader <miles@gnu.org>
parents: 65468
diff changeset
4907 ;; arch-tag: ab761dfa-67bc-4207-bc64-4307271dc381
65468
c0ae0ed7aa1a New file.
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4908 ;;; newsticker.el ends here