annotate lisp/net/newst-plainview.el @ 110802:e544f6cc2447

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