Mercurial > emacs
annotate lisp/=gnus.el @ 7975:49dc4ea976a0
(Fmatching_paren): Fix typo.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 20 Jun 1994 17:07:22 +0000 |
parents | de3b4f95a9db |
children | 4fca34ed47e4 |
rev | line source |
---|---|
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1 ;;; GNUS: an NNTP-based News Reader for GNU Emacs |
7300 | 2 ;; Copyright (C) 1987,88,89,90,93,94 Free Software Foundation, Inc. |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
3 |
4317 | 4 ;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp> |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
5 ;; Keywords: news |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
716
diff
changeset
|
6 |
257 | 7 ;; This file is part of GNU Emacs. |
8 | |
711
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
9 ;; GNU Emacs is free software; you can redistribute it and/or modify |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
10 ;; it under the terms of the GNU General Public License as published by |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
716
diff
changeset
|
11 ;; the Free Software Foundation; either version 2, or (at your option) |
711
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
12 ;; any later version. |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
13 |
257 | 14 ;; GNU Emacs is distributed in the hope that it will be useful, |
711
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
17 ;; GNU General Public License for more details. |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
18 |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
19 ;; You should have received a copy of the GNU General Public License |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
20 ;; along with GNU Emacs; see the file COPYING. If not, write to |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
21 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
257 | 22 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
716
diff
changeset
|
23 ;;; Commentary: |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
716
diff
changeset
|
24 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
25 ;; How to Install GNUS: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
26 ;; (0) First of all, remove GNUS related OLD *.elc files (at least |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
27 ;; nntp.elc). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
28 ;; (1) Unshar gnus.el, gnuspost.el, gnusmail.el, gnusmisc.el, and |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
29 ;; nntp.el. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
30 ;; (2) byte-compile-file nntp.el, gnus.el, gnuspost.el, gnusmail.el, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
31 ;; and gnusmisc.el. If you have a local news spool, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
32 ;; byte-compile-file nnspool.el, too. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
33 ;; (3) Define three environment variables in .login file as follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
34 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
35 ;; setenv NNTPSERVER flab |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
36 ;; setenv DOMAINNAME "stars.flab.Fujitsu.CO.JP" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
37 ;; setenv ORGANIZATION "Fujitsu Laboratories Ltd., Kawasaki, Japan." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
38 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
39 ;; Or instead, define lisp variables in your .emacs, site-init.el, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
40 ;; or default.el as follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
41 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
42 ;; (setq gnus-nntp-server "flab") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
43 ;; (setq gnus-local-domain "stars.flab.Fujitsu.CO.JP") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
44 ;; (setq gnus-local-organization "Fujitsu Laboratories Ltd., ...") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
45 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
46 ;; If the function (system-name) returns the full internet name, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
47 ;; you don't have to define the domain. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
48 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
49 ;; (4) You may have to define NNTP service name as number 119. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
50 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
51 ;; (setq gnus-nntp-service 119) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
52 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
53 ;; Or, if you'd like to use a local news spool directly in stead |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
54 ;; of NNTP, install nnspool.el and set the variable to nil as |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
55 ;; follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
56 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
57 ;; (setq gnus-nntp-service nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
58 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
59 ;; (5) If you'd like to use the GENERICFROM feature like the Bnews, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
60 ;; define the variable as follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
61 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
62 ;; (setq gnus-use-generic-from t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
63 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
64 ;; (6) Define autoload entries in .emacs file as follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
65 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
66 ;; (autoload 'gnus "gnus" "Read network news." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
67 ;; (autoload 'gnus-post-news "gnuspost" "Post a news." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
68 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
69 ;; (7) Read nntp.el if you have problems with NNTP or kanji handling. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
70 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
71 ;; (8) Install mhspool.el, tcp.el, and tcp.c if it is necessary. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
72 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
73 ;; mhspool.el is a package for reading articles or mail in your |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
74 ;; private directory using GNUS. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
75 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
76 ;; tcp.el and tcp.c are necessary if and only if your Emacs does |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
77 ;; not have the function `open-network-stream' which is used for |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
78 ;; communicating with NNTP server inside Emacs. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
79 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
80 ;; (9) Install an Info file generated from the texinfo manual gnus.texinfo. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
81 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
82 ;; If you are not allowed to create the Info file to the standard |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
83 ;; Info-directory, create it in your private directory and set the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
84 ;; variable gnus-info-directory to that directory. |
257 | 85 ;; |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
86 ;; For getting more information about GNUS, consult USENET newsgorup |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
87 ;; gnu.emacs.gnus. |
257 | 88 |
89 ;; TO DO: | |
90 ;; (1) Incremental update of active info. | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
91 ;; (2) Asynchronous transmission of large messages. |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
92 |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
93 ;;; Code: |
257 | 94 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
95 (provide 'gnus) |
257 | 96 (require 'nntp) |
97 (require 'mail-utils) | |
98 | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
99 (defvar gnus-default-nntp-server nil |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
100 "*Specify default NNTP server. |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
101 This variable should be defined in paths.el.") |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
102 |
3331
3ab36486eede
(gnus-nntp-server): Use gnus-default-nntp-server.
Richard M. Stallman <rms@gnu.org>
parents:
2845
diff
changeset
|
103 (defvar gnus-nntp-server (or (getenv "NNTPSERVER") gnus-default-nntp-server) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
104 "*The name of the host running NNTP server. |
257 | 105 If it is a string such as `:DIRECTORY', the user's private DIRECTORY |
106 is used as a news spool. | |
107 Initialized from the NNTPSERVER environment variable.") | |
108 | |
716
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
109 (defvar gnus-nntp-service "nntp" |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
110 "*NNTP service name (\"nntp\" or 119). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
111 Go to a local news spool if its value is nil.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
112 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
113 (defvar gnus-startup-file "~/.newsrc" |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
114 "*Your `.newsrc' file. Use `.newsrc-SERVER' instead if exists.") |
716
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
115 |
257 | 116 (defvar gnus-signature-file "~/.signature" |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
117 "*Your `.signature' file. Use `.signature-DISTRIBUTION' instead if exists.") |
257 | 118 |
119 (defvar gnus-use-cross-reference t | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
120 "*Specifies what to do with cross references (Xref: field). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
121 If nil, ignore cross references. If t, mark articles as read in |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
122 subscribed newsgroups. Otherwise, if not nil nor t, mark articles as |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
123 read in all newsgroups.") |
257 | 124 |
125 (defvar gnus-use-followup-to t | |
126 "*Specifies what to do with Followup-To: field. | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
127 If nil, ignore followup-to: field. If t, use its value except for |
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
128 `poster'. Otherwise, if not nil nor t, always use its value.") |
257 | 129 |
130 (defvar gnus-large-newsgroup 50 | |
131 "*The number of articles which indicates a large newsgroup. | |
132 If the number of articles in a newsgroup is greater than the value, | |
133 confirmation is required for selecting the newsgroup.") | |
134 | |
135 (defvar gnus-author-copy (getenv "AUTHORCOPY") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
136 "*File name saving a copy of an article posted using FCC: field. |
257 | 137 Initialized from the AUTHORCOPY environment variable. |
138 | |
139 Articles are saved using a function specified by the the variable | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
140 `gnus-author-copy-saver' (`rmail-output' is default) if a file name is |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
141 given. Instead, if the first character of the name is `|', the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
142 contents of the article is piped out to the named program. It is |
257 | 143 possible to save an article in an MH folder as follows: |
144 | |
7639 | 145 \(setq gnus-author-copy \"|/usr/local/lib/mh/rcvstore +Article\")") |
257 | 146 |
147 (defvar gnus-author-copy-saver (function rmail-output) | |
148 "*A function called with a file name to save an author copy to. | |
149 The default function is `rmail-output' which saves in Unix mailbox format.") | |
150 | |
151 (defvar gnus-use-long-file-name | |
152 (not (memq system-type '(usg-unix-v xenix))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
153 "*Non-nil means that a newsgroup name is used as a default file name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
154 to save articles to. If it's nil, the directory form of a newsgroup is |
257 | 155 used instead.") |
156 | |
157 (defvar gnus-article-save-directory (getenv "SAVEDIR") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
158 "*A directory name to save articles to (default to ~/News). |
257 | 159 Initialized from the SAVEDIR environment variable.") |
160 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
161 (defvar gnus-default-article-saver (function gnus-summary-save-in-rmail) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
162 "*A function to save articles in your favorite format. |
257 | 163 The function must be interactively callable (in other words, it must |
164 be an Emacs command). | |
165 | |
166 GNUS provides the following functions: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
167 gnus-summary-save-in-rmail (in Rmail format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
168 gnus-summary-save-in-mail (in Unix mail format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
169 gnus-summary-save-in-folder (in an MH folder) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
170 gnus-summary-save-in-file (in article format).") |
257 | 171 |
172 (defvar gnus-rmail-save-name (function gnus-plain-save-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
173 "*A function generating a file name to save articles in Rmail format. |
257 | 174 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.") |
175 | |
176 (defvar gnus-mail-save-name (function gnus-plain-save-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
177 "*A function generating a file name to save articles in Unix mail format. |
257 | 178 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.") |
179 | |
180 (defvar gnus-folder-save-name (function gnus-folder-save-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
181 "*A function generating a file name to save articles in MH folder. |
257 | 182 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER.") |
183 | |
184 (defvar gnus-file-save-name (function gnus-numeric-save-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
185 "*A function generating a file name to save articles in article format. |
257 | 186 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.") |
187 | |
188 (defvar gnus-kill-file-name "KILL" | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
189 "*File name of a KILL file.") |
257 | 190 |
191 (defvar gnus-novice-user t | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
192 "*Non-nil means that you are a novice to USENET. |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
193 If non-nil, verbose messages may be displayed |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
194 or your confirmations may be required.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
195 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
196 (defvar gnus-interactive-catchup t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
197 "*Require your confirmation when catching up a newsgroup if non-nil.") |
257 | 198 |
199 (defvar gnus-interactive-post t | |
200 "*Newsgroup, subject, and distribution will be asked for if non-nil.") | |
201 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
202 (defvar gnus-interactive-exit t |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
203 "*Require your confirmation when exiting GNUS if non-nil.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
204 |
257 | 205 (defvar gnus-user-login-name nil |
206 "*The login name of the user. | |
5911
cfd1fc2b1c7b
(gnus-user-login-name): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents:
5510
diff
changeset
|
207 Got from the function `user-login-name' if undefined.") |
257 | 208 |
209 (defvar gnus-user-full-name nil | |
210 "*The full name of the user. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
211 Got from the NAME environment variable if undefined.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
212 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
213 (defvar gnus-show-mime nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
214 "*Show MIME message if non-nil.") |
257 | 215 |
216 (defvar gnus-show-threads t | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
217 "*Show conversation threads in Summary Mode if non-nil.") |
257 | 218 |
219 (defvar gnus-thread-hide-subject t | |
220 "*Non-nil means hide subjects for thread subtrees.") | |
221 | |
222 (defvar gnus-thread-hide-subtree nil | |
223 "*Non-nil means hide thread subtrees initially. | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
224 If non-nil, you have to run the command `gnus-summary-show-thread' by |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
225 hand or by using `gnus-select-article-hook' to show hidden threads.") |
257 | 226 |
227 (defvar gnus-thread-hide-killed t | |
228 "*Non-nil means hide killed thread subtrees automatically.") | |
229 | |
230 (defvar gnus-thread-ignore-subject nil | |
231 "*Don't take care of subject differences, but only references if non-nil. | |
232 If it is non-nil, some commands work with subjects do not work properly.") | |
233 | |
234 (defvar gnus-thread-indent-level 4 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
235 "*Indentation of thread subtrees.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
236 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
237 (defvar gnus-ignored-newsgroups "^to\\..*$" |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
238 "*A regexp to match uninteresting newsgroups in the active file. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
239 Any lines in the active file matching this regular expression are |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
240 removed from the newsgroup list before anything else is done to it, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
241 thus making them effectively invisible.") |
257 | 242 |
243 (defvar gnus-ignored-headers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
244 "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
245 "*All random fields within the header of a message.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
246 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
247 (defvar gnus-required-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
248 '(From Date Newsgroups Subject Message-ID Path Organization Distribution) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
249 "*All required fields for articles you post. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
250 RFC977 and RFC1036 require From, Date, Newsgroups, Subject, Message-ID |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
251 and Path fields. Organization, Distribution and Lines are optional. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
252 If you want GNUS not to insert some field, remove it from the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
253 variable.") |
257 | 254 |
255 (defvar gnus-show-all-headers nil | |
256 "*Show all headers of an article if non-nil.") | |
257 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
258 (defvar gnus-save-all-headers t |
257 | 259 "*Save all headers of an article if non-nil.") |
260 | |
261 (defvar gnus-optional-headers (function gnus-optional-lines-and-from) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
262 "*A function generating a optional string displayed in GNUS Summary |
257 | 263 mode buffer. The function is called with an article HEADER. The |
264 result must be a string excluding `[' and `]'.") | |
265 | |
266 (defvar gnus-auto-extend-newsgroup t | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
267 "*Extend visible articles to forward and backward if non-nil.") |
257 | 268 |
269 (defvar gnus-auto-select-first t | |
270 "*Select the first unread article automagically if non-nil. | |
271 If you want to prevent automatic selection of the first unread article | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
272 in some newsgroups, set the variable to nil in `gnus-select-group-hook' |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
273 or `gnus-apply-kill-hook'.") |
257 | 274 |
275 (defvar gnus-auto-select-next t | |
276 "*Select the next newsgroup automagically if non-nil. | |
277 If the value is t and the next newsgroup is empty, GNUS will exit | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
278 Summary mode and go back to Group mode. If the value is neither nil |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
279 nor t, GNUS will select the following unread newsgroup. Especially, if |
257 | 280 the value is the symbol `quietly', the next unread newsgroup will be |
281 selected without any confirmations.") | |
282 | |
283 (defvar gnus-auto-select-same nil | |
284 "*Select the next article with the same subject automagically if non-nil.") | |
285 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
286 (defvar gnus-auto-center-summary t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
287 "*Always center the current summary in GNUS Summary window if non-nil.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
288 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
289 (defvar gnus-auto-mail-to-author nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
290 "*Insert `To: author' of the article when following up if non-nil. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
291 Mail is sent using the function specified by the variable |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
292 `gnus-mail-send-method'.") |
257 | 293 |
294 (defvar gnus-break-pages t | |
295 "*Break an article into pages if non-nil. | |
296 Page delimiter is specified by the variable `gnus-page-delimiter'.") | |
297 | |
298 (defvar gnus-page-delimiter "^\^L" | |
299 "*Regexp describing line-beginnings that separate pages of news article.") | |
300 | |
301 (defvar gnus-digest-show-summary t | |
302 "*Show a summary of undigestified messages if non-nil.") | |
303 | |
304 (defvar gnus-digest-separator "^Subject:[ \t]" | |
305 "*Regexp that separates messages in a digest article.") | |
306 | |
307 (defvar gnus-use-full-window t | |
308 "*Non-nil means to take up the entire screen of Emacs.") | |
309 | |
310 (defvar gnus-window-configuration | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
311 '((summary (0 1 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
312 (newsgroups (1 0 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
313 (article (0 3 10))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
314 "*Specify window configurations for each action. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
315 The format of the variable is a list of (ACTION (G S A)), where G, S, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
316 and A are the relative height of Group, Summary, and Article windows, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
317 respectively. ACTION is `summary', `newsgroups', or `article'.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
318 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
319 (defvar gnus-show-mime-method (function metamail-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
320 "*Function to process a MIME message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
321 The function is expected to process current buffer as a MIME message.") |
257 | 322 |
323 (defvar gnus-mail-reply-method | |
324 (function gnus-mail-reply-using-mail) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
325 "*Function to compose reply mail. |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
326 The function `gnus-mail-reply-using-mail' uses usual sendmail mail |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
327 program. The function `gnus-mail-reply-using-mhe' uses the MH-E mail |
257 | 328 program. You can use yet another program by customizing this variable.") |
329 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
330 (defvar gnus-mail-forward-method |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
331 (function gnus-mail-forward-using-mail) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
332 "*Function to forward current message to another user. |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
333 The function `gnus-mail-reply-using-mail' uses usual sendmail mail |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
334 program. You can use yet another program by customizing this variable.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
335 |
257 | 336 (defvar gnus-mail-other-window-method |
337 (function gnus-mail-other-window-using-mail) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
338 "*Function to compose mail in other window. |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
339 The function `gnus-mail-other-window-using-mail' uses the usual sendmail |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
340 mail program. The function `gnus-mail-other-window-using-mhe' uses the MH-E |
257 | 341 mail program. You can use yet another program by customizing this variable.") |
342 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
343 (defvar gnus-mail-send-method send-mail-function |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
344 "*Function to mail a message too which is being posted as an article. |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
345 The message must have To: or Cc: field. The default is copied from |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
346 the variable `send-mail-function'.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
347 |
257 | 348 (defvar gnus-subscribe-newsgroup-method |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
349 (function gnus-subscribe-alphabetically) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
350 "*Function called with a newsgroup name when new newsgroup is found. |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
351 The function `gnus-subscribe-randomly' inserts a new newsgroup a the |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
352 beginning of newsgroups. The function `gnus-subscribe-alphabetically' |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
353 inserts it in strict alphabetic order. The function |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
354 `gnus-subscribe-hierarchically' inserts it in hierarchical newsgroup |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
355 order. The function `gnus-subscribe-interactively' asks for your decision.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
356 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
357 (defvar gnus-group-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
358 "*A hook for GNUS Group Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
359 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
360 (defvar gnus-summary-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
361 "*A hook for GNUS Summary Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
362 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
363 (defvar gnus-article-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
364 "*A hook for GNUS Article Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
365 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
366 (defvar gnus-kill-file-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
367 "*A hook for GNUS KILL File Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
368 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
369 (defvar gnus-open-server-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
370 "*A hook called just before opening connection to news server.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
371 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
372 (defvar gnus-startup-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
373 "*A hook called at start up time. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
374 This hook is called after GNUS is connected to the NNTP server. So, it |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
375 is possible to change the behavior of GNUS according to the selected |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
376 NNTP server.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
377 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
378 (defvar gnus-group-prepare-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
379 "*A hook called after newsgroup list is created in the Newsgroup buffer. |
257 | 380 If you want to modify the Newsgroup buffer, you can use this hook.") |
381 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
382 (defvar gnus-summary-prepare-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
383 "*A hook called after summary list is created in the Summary buffer. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
384 If you want to modify the Summary buffer, you can use this hook.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
385 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
386 (defvar gnus-article-prepare-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
387 "*A hook called after an article is prepared in the Article buffer. |
257 | 388 If you want to run a special decoding program like nkf, use this hook.") |
389 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
390 (defvar gnus-select-group-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
391 "*A hook called when a newsgroup is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
392 If you want to sort Summary buffer by date and then by subject, you |
257 | 393 can use the following hook: |
394 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
395 \(setq gnus-select-group-hook |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
396 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
397 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
398 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
399 ;; First of all, sort by date. |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
400 (gnus-keysort-headers |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
401 (function string-lessp) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
402 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
403 (lambda (a) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
404 (gnus-sortable-date (gnus-header-date a))))) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
405 ;; Then sort by subject string ignoring `Re:'. |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
406 ;; If case-fold-search is non-nil, case of letters is ignored. |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
407 (gnus-keysort-headers |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
408 (function string-lessp) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
409 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
410 (lambda (a) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
411 (if case-fold-search |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
412 (downcase (gnus-simplify-subject (gnus-header-subject a) t)) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
413 (gnus-simplify-subject (gnus-header-subject a) t))))) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
414 )))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
415 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
416 If you'd like to simplify subjects like the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
417 `gnus-summary-next-same-subject' command does, you can use the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
418 following hook: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
419 |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
420 \(setq gnus-select-group-hook |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
421 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
422 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
423 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
424 (mapcar (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
425 (lambda (header) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
426 (nntp-set-header-subject |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
427 header |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
428 (gnus-simplify-subject |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
429 (gnus-header-subject header) 're-only)))) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
430 gnus-newsgroup-headers))))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
431 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
432 In some newsgroups author name is meaningless. It is possible to |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
433 prevent listing author names in GNUS Summary buffer as follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
434 |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
435 \(setq gnus-select-group-hook |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
436 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
437 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
438 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
439 (cond ((string-equal \"comp.sources.unix\" gnus-newsgroup-name) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
440 (setq gnus-optional-headers |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
441 (function gnus-optional-lines))) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
442 (t |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
443 (setq gnus-optional-headers |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
444 (function gnus-optional-lines-and-from))))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
445 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
446 (defvar gnus-select-article-hook |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
447 '(gnus-summary-show-thread) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
448 "*A hook called when an article is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
449 The default hook shows conversation thread subtrees of the selected |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
450 article automatically using `gnus-summary-show-thread'. |
257 | 451 |
452 If you'd like to run RMAIL on a digest article automagically, you can | |
453 use the following hook: | |
454 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
455 \(setq gnus-select-article-hook |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
456 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
457 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
458 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
459 (gnus-summary-show-thread) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
460 (cond ((string-equal \"comp.sys.sun\" gnus-newsgroup-name) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
461 (gnus-summary-rmail-digest)) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
462 ((and (string-equal \"comp.text\" gnus-newsgroup-name) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
463 (string-match \"^TeXhax Digest\" |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
464 (gnus-header-subject gnus-current-headers))) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
465 (gnus-summary-rmail-digest) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
466 ))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
467 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
468 (defvar gnus-select-digest-hook |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
469 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
470 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
471 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
472 ;; Reply-To: is required by `undigestify-rmail-message'. |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
473 (or (mail-position-on-field "Reply-to" t) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
474 (progn |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
475 (mail-position-on-field "Reply-to") |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
476 (insert (gnus-fetch-field "From"))))))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
477 "*A hook called when reading digest messages using Rmail. |
257 | 478 This hook can be used to modify incomplete digest articles as follows |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
479 \(this is the default): |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
480 |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
481 \(setq gnus-select-digest-hook |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
482 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
483 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
484 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
485 ;; Reply-To: is required by `undigestify-rmail-message'. |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
486 (or (mail-position-on-field \"Reply-to\" t) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
487 (progn |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
488 (mail-position-on-field \"Reply-to\") |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
489 (insert (gnus-fetch-field \"From\"))))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
490 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
491 (defvar gnus-rmail-digest-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
492 "*A hook called when reading digest messages using Rmail. |
257 | 493 This hook is intended to customize Rmail mode for reading digest articles.") |
494 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
495 (defvar gnus-apply-kill-hook '(gnus-apply-kill-file) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
496 "*A hook called when a newsgroup is selected and summary list is prepared. |
257 | 497 This hook is intended to apply a KILL file to the selected newsgroup. |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
498 The function `gnus-apply-kill-file' is called by default. |
257 | 499 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
500 Since a general KILL file is too heavy to use only for a few |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
501 newsgroups, I recommend you to use a lighter hook function. For |
257 | 502 example, if you'd like to apply a KILL file to articles which contains |
503 a string `rmgroup' in subject in newsgroup `control', you can use the | |
504 following hook: | |
505 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
506 \(setq gnus-apply-kill-hook |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
507 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
508 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
509 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
510 (cond ((string-match \"control\" gnus-newsgroup-name) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
511 (gnus-kill \"Subject\" \"rmgroup\") |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
512 (gnus-expunge \"X\")))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
513 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
514 (defvar gnus-mark-article-hook |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
515 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
516 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
517 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
518 (or (memq gnus-current-article gnus-newsgroup-marked) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
519 (gnus-summary-mark-as-read gnus-current-article)) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
520 (gnus-summary-set-current-mark "+")))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
521 "*A hook called when an article is selected at the first time. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
522 The hook is intended to mark an article as read (or unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
523 automatically when it is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
524 |
257 | 525 If you'd like to mark as unread (-) instead, use the following hook: |
526 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
527 \(setq gnus-mark-article-hook |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
528 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
529 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
530 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
531 (gnus-summary-mark-as-unread gnus-current-article) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
532 (gnus-summary-set-current-mark \"+\")))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
533 |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
534 (defvar gnus-prepare-article-hook (list (function gnus-inews-insert-signature)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
535 "*A hook called after preparing body, but before preparing header fields. |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
536 The default hook (`gnus-inews-insert-signature') inserts a signature |
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
537 file specified by the variable `gnus-signature-file'.") |
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
538 |
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
539 (defvar gnus-inews-article-hook (list (function gnus-inews-do-fcc)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
540 "*A hook called before finally posting an article. |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
541 The default hook (`gnus-inews-do-fcc') does FCC processing (save article |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
542 to a file).") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
543 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
544 (defvar gnus-exit-group-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
545 "*A hook called when exiting (not quitting) Summary mode. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
546 If your machine is so slow that exiting from Summary mode takes very |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
547 long time, set the variable `gnus-use-cross-reference' to nil. This |
257 | 548 inhibits marking articles as read using cross-reference information.") |
549 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
550 (defvar gnus-suspend-gnus-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
551 "*A hook called when suspending (not exiting) GNUS.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
552 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
553 (defvar gnus-exit-gnus-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
554 "*A hook called when exiting (not suspending) GNUS.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
555 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
556 (defvar gnus-save-newsrc-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
557 "*A hook called when saving the newsrc file. |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
558 This hook is called before saving the `.newsrc' file.") |
257 | 559 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
560 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
561 ;; Site dependent variables. You have to define these variables in |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
562 ;; site-init.el, default.el or your .emacs. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
563 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
564 (defvar gnus-local-timezone nil |
3496
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
565 "*Local time zone. |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
566 This value is used only if `current-time-zone' does not work in your Emacs. |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
567 It specifies the GMT offset, i.e. a decimal integer |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
568 of the form +-HHMM giving the hours and minutes ahead of (i.e. east of) GMT. |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
569 For example, +0900 should be used in Japan, since it is 9 hours ahead of GMT. |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
570 |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
571 For backwards compatibility, it may also be a string like \"JST\", |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
572 but strings are obsolescent: you should use numeric offsets instead.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
573 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
574 (defvar gnus-local-domain nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
575 "*Local domain name without a host name like: \"stars.flab.Fujitsu.CO.JP\" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
576 The `DOMAINNAME' environment variable is used instead if defined. If |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
577 the function (system-name) returns the full internet name, there is no |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
578 need to define the name.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
579 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
580 (defvar gnus-local-organization nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
581 "*Local organization like: \"Fujitsu Laboratories Ltd., Kawasaki, Japan.\" |
257 | 582 The `ORGANIZATION' environment variable is used instead if defined.") |
583 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
584 (defvar gnus-local-distributions '("local" "world") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
585 "*List of distributions. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
586 The first element in the list is used as default. If distributions |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
587 file is available, its content is also used.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
588 |
257 | 589 (defvar gnus-use-generic-from nil |
590 "*If nil, prepend local host name to the defined domain in the From: | |
591 field; if stringp, use this; if non-nil, strip of the local host name.") | |
592 | |
593 (defvar gnus-use-generic-path nil | |
594 "*If nil, use the NNTP server name in the Path: field; if stringp, | |
595 use this; if non-nil, use no host name (user name only)") | |
596 | |
597 ;; Internal variables. | |
598 | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
599 (defconst gnus-version "GNUS 4.1" |
257 | 600 "Version numbers of this version of GNUS.") |
601 | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
602 (defconst gnus-emacs-version |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
603 (progn |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
604 (string-match "[0-9]*" emacs-version) |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
605 (string-to-int (substring emacs-version |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
606 (match-beginning 0) (match-end 0)))) |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
607 "Major version number of this emacs.") |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
608 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
609 (defvar gnus-info-nodes |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
610 '((gnus-group-mode "(gnus)Newsgroup Commands") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
611 (gnus-summary-mode "(gnus)Summary Commands") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
612 (gnus-article-mode "(gnus)Article Commands") |
4118
4248276b1113
(gnus-info-nodes): Update node names.
Richard M. Stallman <rms@gnu.org>
parents:
3922
diff
changeset
|
613 (gnus-kill-file-mode "(gnus)Kill File") |
4248276b1113
(gnus-info-nodes): Update node names.
Richard M. Stallman <rms@gnu.org>
parents:
3922
diff
changeset
|
614 (gnus-browse-killed-mode "(gnus)Maintaining Subscriptions")) |
257 | 615 "Assoc list of major modes and related Info nodes.") |
616 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
617 ;; Alist syntax is different from that of 3.14.3. |
257 | 618 (defvar gnus-access-methods |
619 '((nntp | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
620 (gnus-retrieve-headers nntp-retrieve-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
621 (gnus-open-server nntp-open-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
622 (gnus-close-server nntp-close-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
623 (gnus-server-opened nntp-server-opened) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
624 (gnus-status-message nntp-status-message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
625 (gnus-request-article nntp-request-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
626 (gnus-request-group nntp-request-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
627 (gnus-request-list nntp-request-list) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
628 (gnus-request-list-newsgroups nntp-request-list-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
629 (gnus-request-list-distributions nntp-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
630 (gnus-request-post nntp-request-post)) |
257 | 631 (nnspool |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
632 (gnus-retrieve-headers nnspool-retrieve-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
633 (gnus-open-server nnspool-open-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
634 (gnus-close-server nnspool-close-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
635 (gnus-server-opened nnspool-server-opened) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
636 (gnus-status-message nnspool-status-message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
637 (gnus-request-article nnspool-request-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
638 (gnus-request-group nnspool-request-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
639 (gnus-request-list nnspool-request-list) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
640 (gnus-request-list-newsgroups nnspool-request-list-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
641 (gnus-request-list-distributions nnspool-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
642 (gnus-request-post nnspool-request-post)) |
257 | 643 (mhspool |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
644 (gnus-retrieve-headers mhspool-retrieve-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
645 (gnus-open-server mhspool-open-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
646 (gnus-close-server mhspool-close-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
647 (gnus-server-opened mhspool-server-opened) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
648 (gnus-status-message mhspool-status-message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
649 (gnus-request-article mhspool-request-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
650 (gnus-request-group mhspool-request-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
651 (gnus-request-list mhspool-request-list) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
652 (gnus-request-list-newsgroups mhspool-request-list-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
653 (gnus-request-list-distributions mhspool-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
654 (gnus-request-post mhspool-request-post))) |
257 | 655 "Access method for NNTP, nnspool, and mhspool.") |
656 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
657 (defvar gnus-group-buffer "*Newsgroup*") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
658 (defvar gnus-summary-buffer "*Summary*") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
659 (defvar gnus-article-buffer "*Article*") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
660 (defvar gnus-digest-buffer "GNUS Digest") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
661 (defvar gnus-digest-summary-buffer "GNUS Digest-summary") |
257 | 662 |
663 (defvar gnus-buffer-list | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
664 (list gnus-group-buffer gnus-summary-buffer gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
665 gnus-digest-buffer gnus-digest-summary-buffer) |
257 | 666 "GNUS buffer names which should be killed when exiting.") |
667 | |
668 (defvar gnus-variable-list | |
669 '(gnus-newsrc-options | |
670 gnus-newsrc-options-n-yes gnus-newsrc-options-n-no | |
671 gnus-newsrc-assoc gnus-killed-assoc gnus-marked-assoc) | |
672 "GNUS variables saved in the quick startup file.") | |
673 | |
674 (defvar gnus-overload-functions | |
675 '((news-inews gnus-inews-news "rnewspost") | |
676 (caesar-region gnus-caesar-region "rnews")) | |
677 "Functions overloaded by gnus. | |
678 It is a list of `(original overload &optional file)'.") | |
679 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
680 (defvar gnus-distribution-list nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
681 |
257 | 682 (defvar gnus-newsrc-options nil |
683 "Options line in the .newsrc file.") | |
684 | |
685 (defvar gnus-newsrc-options-n-yes nil | |
686 "Regexp representing subscribed newsgroups.") | |
687 | |
688 (defvar gnus-newsrc-options-n-no nil | |
689 "Regexp representing unsubscribed newsgroups.") | |
690 | |
691 (defvar gnus-newsrc-assoc nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
692 "Assoc list of read articles. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
693 gnus-newsrc-hashtb should be kept so that both hold the same information.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
694 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
695 (defvar gnus-newsrc-hashtb nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
696 "Hashtable of gnus-newsrc-assoc.") |
257 | 697 |
698 (defvar gnus-killed-assoc nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
699 "Assoc list of newsgroups removed from gnus-newsrc-assoc. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
700 gnus-killed-hashtb should be kept so that both hold the same information.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
701 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
702 (defvar gnus-killed-hashtb nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
703 "Hashtable of gnus-killed-assoc.") |
257 | 704 |
705 (defvar gnus-marked-assoc nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
706 "Assoc list of articles marked as unread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
707 gnus-marked-hashtb should be kept so that both hold the same information.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
708 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
709 (defvar gnus-marked-hashtb nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
710 "Hashtable of gnus-marked-assoc.") |
257 | 711 |
712 (defvar gnus-unread-hashtb nil | |
713 "Hashtable of unread articles.") | |
714 | |
715 (defvar gnus-active-hashtb nil | |
716 "Hashtable of active articles.") | |
717 | |
718 (defvar gnus-octive-hashtb nil | |
719 "Hashtable of OLD active articles.") | |
720 | |
721 (defvar gnus-current-startup-file nil | |
722 "Startup file for the current host.") | |
723 | |
724 (defvar gnus-last-search-regexp nil | |
725 "Default regexp for article search command.") | |
726 | |
727 (defvar gnus-last-shell-command nil | |
728 "Default shell command on article.") | |
729 | |
730 (defvar gnus-have-all-newsgroups nil) | |
731 | |
732 (defvar gnus-newsgroup-name nil) | |
733 (defvar gnus-newsgroup-begin nil) | |
734 (defvar gnus-newsgroup-end nil) | |
735 (defvar gnus-newsgroup-last-rmail nil) | |
736 (defvar gnus-newsgroup-last-mail nil) | |
737 (defvar gnus-newsgroup-last-folder nil) | |
738 (defvar gnus-newsgroup-last-file nil) | |
739 | |
740 (defvar gnus-newsgroup-unreads nil | |
741 "List of unread articles in the current newsgroup.") | |
742 | |
743 (defvar gnus-newsgroup-unselected nil | |
744 "List of unselected unread articles in the current newsgroup.") | |
745 | |
746 (defvar gnus-newsgroup-marked nil | |
747 "List of marked articles in the current newsgroup (a subset of unread art).") | |
748 | |
749 (defvar gnus-newsgroup-headers nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
750 "List of article headers in the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
751 If the variable is modified (added or deleted), the function |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
752 gnus-clear-hashtables-for-newsgroup-headers must be called to clear |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
753 the hash tables.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
754 (defvar gnus-newsgroup-headers-hashtb-by-id nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
755 (defvar gnus-newsgroup-headers-hashtb-by-number nil) |
257 | 756 |
757 (defvar gnus-current-article nil) | |
758 (defvar gnus-current-headers nil) | |
759 (defvar gnus-current-history nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
760 (defvar gnus-have-all-headers nil "Must be either T or NIL.") |
257 | 761 (defvar gnus-last-article nil) |
762 (defvar gnus-current-kill-article nil) | |
763 | |
764 ;; Save window configuration. | |
765 (defvar gnus-winconf-kill-file nil) | |
766 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
767 (defvar gnus-group-mode-map nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
768 (defvar gnus-summary-mode-map nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
769 (defvar gnus-article-mode-map nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
770 (defvar gnus-kill-file-mode-map nil) |
257 | 771 |
7560
e63efa2d587c
rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents:
7524
diff
changeset
|
772 (defvar rmail-default-file (expand-file-name "~/XMBOX")) |
e63efa2d587c
rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents:
7524
diff
changeset
|
773 (defvar rmail-default-rmail-file (expand-file-name "~/XNEWS")) |
257 | 774 |
775 ;; Define GNUS Subsystems. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
776 (autoload 'gnus-group-post-news "gnuspost" |
257 | 777 "Post an article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
778 (autoload 'gnus-summary-post-news "gnuspost" |
257 | 779 "Post an article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
780 (autoload 'gnus-summary-followup "gnuspost" |
257 | 781 "Post a reply article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
782 (autoload 'gnus-summary-followup-with-original "gnuspost" |
257 | 783 "Post a reply article with original article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
784 (autoload 'gnus-summary-cancel-article "gnuspost" |
257 | 785 "Cancel an article you posted." t) |
786 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
787 (autoload 'gnus-summary-reply "gnusmail" |
257 | 788 "Reply mail to news author." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
789 (autoload 'gnus-summary-reply-with-original "gnusmail" |
257 | 790 "Reply mail to news author with original article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
791 (autoload 'gnus-summary-mail-forward "gnusmail" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
792 "Forward the current message to another user." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
793 (autoload 'gnus-summary-mail-other-window "gnusmail" |
257 | 794 "Compose mail in other window." t) |
795 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
796 (autoload 'gnus-group-kill-group "gnusmisc" |
257 | 797 "Kill newsgroup on current line." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
798 (autoload 'gnus-group-yank-group "gnusmisc" |
257 | 799 "Yank the last killed newsgroup on current line." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
800 (autoload 'gnus-group-kill-region "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
801 "Kill newsgroups in current region." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
802 (autoload 'gnus-group-transpose-groups "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
803 "Exchange current newsgroup and previous newsgroup." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
804 (autoload 'gnus-list-killed-groups "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
805 "List the killed newsgroups." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
806 (autoload 'gnus-gmt-to-local "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
807 "Rewrite Date field in GMT to local in current buffer.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
808 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
809 (autoload 'metamail-buffer "metamail" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
810 "Process current buffer through 'metamail'." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
811 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
812 (autoload 'timezone-make-sortable-date "timezone") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
813 (autoload 'timezone-parse-date "timezone") |
257 | 814 |
815 (autoload 'rmail-output "rmailout" | |
816 "Append this message to Unix mail file named FILE-NAME." t) | |
817 (autoload 'mail-position-on-field "sendmail") | |
818 (autoload 'mh-find-path "mh-e") | |
819 (autoload 'mh-prompt-for-folder "mh-e") | |
820 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
821 (put 'gnus-group-mode 'mode-class 'special) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
822 (put 'gnus-summary-mode 'mode-class 'special) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
823 (put 'gnus-article-mode 'mode-class 'special) |
257 | 824 |
7216
6ecee038c1c9
(gnus-summary-mode-map): Bind C-c C-v to gnus-uu-ctl-map.
Richard M. Stallman <rms@gnu.org>
parents:
6309
diff
changeset
|
825 (autoload 'gnus-uu-ctl-map "gnus-uu" nil nil 'keymap) |
7228
14df71736eae
(gnus-summary-mode-map): Bind # to gnus-uu-mark-article.
Richard M. Stallman <rms@gnu.org>
parents:
7216
diff
changeset
|
826 (autoload 'gnus-uu-mark-article "gnus-uu" nil t) |
257 | 827 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
828 ;;(put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1) |
257 | 829 |
830 (defmacro gnus-eval-in-buffer-window (buffer &rest forms) | |
831 "Pop to BUFFER, evaluate FORMS, and then returns to original window." | |
832 (` (let ((GNUSStartBufferWindow (selected-window))) | |
833 (unwind-protect | |
834 (progn | |
835 (pop-to-buffer (, buffer)) | |
836 (,@ forms)) | |
837 (select-window GNUSStartBufferWindow))))) | |
838 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
839 (defmacro gnus-make-hashtable (&optional hashsize) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
840 "Make a hash table (default and minimum size is 200). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
841 Optional argument HASHSIZE specifies the table size." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
842 (` (make-vector (, (if hashsize (` (max (, hashsize) 200)) 200)) 0))) |
257 | 843 |
844 (defmacro gnus-gethash (string hashtable) | |
845 "Get hash value of STRING in HASHTABLE." | |
846 ;;(` (symbol-value (abbrev-symbol (, string) (, hashtable)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
847 ;;(` (abbrev-expansion (, string) (, hashtable))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
848 (` (symbol-value (intern-soft (, string) (, hashtable))))) |
257 | 849 |
850 (defmacro gnus-sethash (string value hashtable) | |
851 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE." | |
852 ;; We cannot use define-abbrev since it only accepts string as value. | |
853 (` (set (intern (, string) (, hashtable)) (, value)))) | |
854 | |
855 ;; Note: Macros defined here are also defined in nntp.el. I don't like | |
856 ;; to put them here, but many users got troubled with the old | |
857 ;; definitions in nntp.elc. These codes are NNTP 3.10 version. | |
858 | |
859 (defmacro nntp-header-number (header) | |
860 "Return article number in HEADER." | |
861 (` (aref (, header) 0))) | |
862 | |
863 (defmacro nntp-set-header-number (header number) | |
864 "Set article number of HEADER to NUMBER." | |
865 (` (aset (, header) 0 (, number)))) | |
866 | |
867 (defmacro nntp-header-subject (header) | |
868 "Return subject string in HEADER." | |
869 (` (aref (, header) 1))) | |
870 | |
871 (defmacro nntp-set-header-subject (header subject) | |
872 "Set article subject of HEADER to SUBJECT." | |
873 (` (aset (, header) 1 (, subject)))) | |
874 | |
875 (defmacro nntp-header-from (header) | |
876 "Return author string in HEADER." | |
877 (` (aref (, header) 2))) | |
878 | |
879 (defmacro nntp-set-header-from (header from) | |
880 "Set article author of HEADER to FROM." | |
881 (` (aset (, header) 2 (, from)))) | |
882 | |
883 (defmacro nntp-header-xref (header) | |
884 "Return xref string in HEADER." | |
885 (` (aref (, header) 3))) | |
886 | |
887 (defmacro nntp-set-header-xref (header xref) | |
888 "Set article xref of HEADER to xref." | |
889 (` (aset (, header) 3 (, xref)))) | |
890 | |
891 (defmacro nntp-header-lines (header) | |
892 "Return lines in HEADER." | |
893 (` (aref (, header) 4))) | |
894 | |
895 (defmacro nntp-set-header-lines (header lines) | |
896 "Set article lines of HEADER to LINES." | |
897 (` (aset (, header) 4 (, lines)))) | |
898 | |
899 (defmacro nntp-header-date (header) | |
900 "Return date in HEADER." | |
901 (` (aref (, header) 5))) | |
902 | |
903 (defmacro nntp-set-header-date (header date) | |
904 "Set article date of HEADER to DATE." | |
905 (` (aset (, header) 5 (, date)))) | |
906 | |
907 (defmacro nntp-header-id (header) | |
908 "Return Id in HEADER." | |
909 (` (aref (, header) 6))) | |
910 | |
911 (defmacro nntp-set-header-id (header id) | |
912 "Set article Id of HEADER to ID." | |
913 (` (aset (, header) 6 (, id)))) | |
914 | |
915 (defmacro nntp-header-references (header) | |
916 "Return references in HEADER." | |
917 (` (aref (, header) 7))) | |
918 | |
919 (defmacro nntp-set-header-references (header ref) | |
920 "Set article references of HEADER to REF." | |
921 (` (aset (, header) 7 (, ref)))) | |
922 | |
923 | |
924 ;;; | |
925 ;;; GNUS Group Mode | |
926 ;;; | |
927 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
928 (if gnus-group-mode-map |
257 | 929 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
930 (setq gnus-group-mode-map (make-keymap)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
931 (suppress-keymap gnus-group-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
932 (define-key gnus-group-mode-map " " 'gnus-group-read-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
933 (define-key gnus-group-mode-map "=" 'gnus-group-select-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
934 (define-key gnus-group-mode-map "j" 'gnus-group-jump-to-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
935 (define-key gnus-group-mode-map "n" 'gnus-group-next-unread-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
936 (define-key gnus-group-mode-map "p" 'gnus-group-prev-unread-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
937 (define-key gnus-group-mode-map "\177" 'gnus-group-prev-unread-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
938 (define-key gnus-group-mode-map "N" 'gnus-group-next-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
939 (define-key gnus-group-mode-map "P" 'gnus-group-prev-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
940 (define-key gnus-group-mode-map "\C-n" 'gnus-group-next-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
941 (define-key gnus-group-mode-map "\C-p" 'gnus-group-prev-group) |
7466
b48210278981
(gnus-group-mode-map, gnus-summary-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
942 (define-key gnus-group-mode-map [down] 'gnus-group-next-group) |
7524
66d8171f3d42
(gnus-group-mode-map): Fix typo in prev change.
Richard M. Stallman <rms@gnu.org>
parents:
7466
diff
changeset
|
943 (define-key gnus-group-mode-map [up] 'gnus-group-prev-group) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
944 (define-key gnus-group-mode-map "\r" 'next-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
945 ;;(define-key gnus-group-mode-map "/" 'isearch-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
946 (define-key gnus-group-mode-map "<" 'beginning-of-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
947 (define-key gnus-group-mode-map ">" 'end-of-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
948 (define-key gnus-group-mode-map "u" 'gnus-group-unsubscribe-current-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
949 (define-key gnus-group-mode-map "U" 'gnus-group-unsubscribe-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
950 (define-key gnus-group-mode-map "c" 'gnus-group-catchup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
951 (define-key gnus-group-mode-map "C" 'gnus-group-catchup-all) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
952 (define-key gnus-group-mode-map "l" 'gnus-group-list-groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
953 (define-key gnus-group-mode-map "L" 'gnus-group-list-all-groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
954 (define-key gnus-group-mode-map "g" 'gnus-group-get-new-news) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
955 (define-key gnus-group-mode-map "R" 'gnus-group-restart) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
956 (define-key gnus-group-mode-map "b" 'gnus-group-check-bogus-groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
957 (define-key gnus-group-mode-map "r" 'gnus-group-restrict-groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
958 (define-key gnus-group-mode-map "a" 'gnus-group-post-news) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
959 (define-key gnus-group-mode-map "\ek" 'gnus-group-edit-local-kill) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
960 (define-key gnus-group-mode-map "\eK" 'gnus-group-edit-global-kill) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
961 (define-key gnus-group-mode-map "\C-k" 'gnus-group-kill-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
962 (define-key gnus-group-mode-map "\C-y" 'gnus-group-yank-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
963 (define-key gnus-group-mode-map "\C-w" 'gnus-group-kill-region) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
964 (define-key gnus-group-mode-map "\C-x\C-t" 'gnus-group-transpose-groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
965 (define-key gnus-group-mode-map "\C-c\C-l" 'gnus-list-killed-groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
966 (define-key gnus-group-mode-map "V" 'gnus-version) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
967 ;;(define-key gnus-group-mode-map "x" 'gnus-group-force-update) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
968 (define-key gnus-group-mode-map "s" 'gnus-group-force-update) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
969 (define-key gnus-group-mode-map "z" 'gnus-group-suspend) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
970 (define-key gnus-group-mode-map "q" 'gnus-group-exit) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
971 (define-key gnus-group-mode-map "Q" 'gnus-group-quit) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
972 (define-key gnus-group-mode-map "?" 'gnus-group-describe-briefly) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
973 (define-key gnus-group-mode-map "\C-c\C-i" 'gnus-info-find-node)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
974 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
975 (defun gnus-group-mode () |
257 | 976 "Major mode for reading network news. |
977 All normal editing commands are turned off. | |
978 Instead, these commands are available: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
979 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
980 SPC Read articles in this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
981 = Select this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
982 j Move to the specified newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
983 n Move to the next unread newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
984 p Move to the previous unread newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
985 C-n Move to the next newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
986 C-p Move to the previous newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
987 < Move point to the beginning of this buffer. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
988 > Move point to the end of this buffer. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
989 u Unsubscribe from (subscribe to) this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
990 U Unsubscribe from (subscribe to) the specified newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
991 c Mark all articles as read, preserving marked articles. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
992 C Mark all articles in this newsgroup as read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
993 l Revert this buffer. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
994 L List all newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
995 g Get new news. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
996 R Force to read the raw .newsrc file and get new news. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
997 b Check bogus newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
998 r Restrict visible newsgroups to the current region. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
999 a Post a new article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1000 ESC k Edit a local KILL file applied to this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1001 ESC K Edit a global KILL file applied to all newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1002 C-k Kill this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1003 C-y Yank killed newsgroup here. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1004 C-w Kill newsgroups in current region (excluding current point). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1005 C-x C-t Exchange this newsgroup and previous newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1006 C-c C-l list killed newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1007 s Save .newsrc file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1008 z Suspend reading news. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1009 q Quit reading news. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1010 Q Quit reading news without saving .newsrc file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1011 V Show the version number of this GNUS. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1012 ? Describe Group Mode commands briefly. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1013 C-h m Describe Group Mode. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1014 C-c C-i Read Info about Group Mode. |
257 | 1015 |
1016 The name of the host running NNTP server is asked for if no default | |
1017 host is specified. It is also possible to choose another NNTP server | |
1018 even when the default server is defined by giving a prefix argument to | |
1019 the command `\\[gnus]'. | |
1020 | |
1021 If an NNTP server is preceded by a colon such as `:Mail', the user's | |
1022 private directory `~/Mail' is used as a news spool. This makes it | |
1023 possible to read mail stored in MH folders or articles saved by GNUS. | |
1024 File names of mail or articles must consist of only numeric | |
1025 characters. Otherwise, they are ignored. | |
1026 | |
1027 If there is a file named `~/.newsrc-SERVER', it is used as the | |
1028 startup file instead of standard one when talking to SERVER. It is | |
1029 possible to talk to many hosts by using different startup files for | |
1030 each. | |
1031 | |
1032 Option `-n' of the options line in the startup file is recognized | |
1033 properly the same as the Bnews system. For example, if the options | |
1034 line is `options -n !talk talk.rumors', newsgroups under the `talk' | |
1035 hierarchy except for `talk.rumors' are ignored while checking new | |
1036 newsgroups. | |
1037 | |
1038 If there is a file named `~/.signature-DISTRIBUTION', it is used as | |
1039 signature file instead of standard one when posting a news in | |
1040 DISTRIBUTION. | |
1041 | |
1042 If an Info file generated from `gnus.texinfo' is installed, you can | |
1043 read an appropriate Info node of the Info file according to the | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1044 current major mode of GNUS by \\[gnus-info-find-node]. |
257 | 1045 |
1046 The variable `gnus-version', `nntp-version', `nnspool-version', and | |
1047 `mhspool-version' have the version numbers of this version of gnus.el, | |
1048 nntp.el, nnspool.el, and mhspoo.el, respectively. | |
1049 | |
1050 User customizable variables: | |
1051 gnus-nntp-server | |
1052 Specifies the name of the host running the NNTP server. If its | |
1053 value is a string such as `:DIRECTORY', the user's private | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1054 DIRECTORY is used as a news spool. The variable is initialized |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1055 from the NNTPSERVER environment variable. |
257 | 1056 |
1057 gnus-nntp-service | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1058 Specifies a NNTP service name. It is usually \"nntp\" or 119. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1059 Nil forces GNUS to use a local news spool if the variable |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1060 `gnus-nntp-server' is set to the local host name. |
257 | 1061 |
1062 gnus-startup-file | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1063 Specifies a startup file (.newsrc). If there is a file named |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1064 `.newsrc-SERVER', it's used instead when talking to SERVER. I |
257 | 1065 recommend you to use the server specific file, if you'd like to |
1066 talk to many servers. Especially if you'd like to read your | |
1067 private directory, the name of the file must be | |
1068 `.newsrc-:DIRECTORY'. | |
1069 | |
1070 gnus-signature-file | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1071 Specifies a signature file (.signature). If there is a file named |
257 | 1072 `.signature-DISTRIBUTION', it's used instead when posting an |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1073 article in DISTRIBUTION. Set the variable to nil to prevent |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1074 appending the file automatically. If you use an NNTP inews which |
257 | 1075 comes with the NNTP package, you may have to set the variable to |
1076 nil. | |
1077 | |
1078 gnus-use-cross-reference | |
1079 Specifies what to do with cross references (Xref: field). If it | |
1080 is nil, cross references are ignored. If it is t, articles in | |
1081 subscribed newsgroups are only marked as read. Otherwise, if it | |
1082 is not nil nor t, articles in all newsgroups are marked as read. | |
1083 | |
1084 gnus-use-followup-to | |
1085 Specifies what to do with followup-to: field. If it is nil, its | |
1086 value is ignored. If it is non-nil, its value is used as followup | |
1087 newsgroups. Especially, if it is t and field value is `poster', | |
1088 your confirmation is required. | |
1089 | |
1090 gnus-author-copy | |
1091 Specifies a file name to save a copy of article you posted using | |
1092 FCC: field. If the first character of the value is `|', the | |
1093 contents of the article is piped out to a program specified by the | |
1094 rest of the value. The variable is initialized from the | |
1095 AUTHORCOPY environment variable. | |
1096 | |
1097 gnus-author-copy-saver | |
1098 Specifies a function to save an author copy. The function is | |
1099 called with a file name. The default function `rmail-output' | |
1100 saves in Unix mail format. | |
1101 | |
1102 gnus-kill-file-name | |
1103 Use specified file name as a KILL file (default to `KILL'). | |
1104 | |
1105 gnus-novice-user | |
1106 Non-nil means that you are a novice to USENET. If non-nil, | |
1107 verbose messages may be displayed or your confirmations may be | |
1108 required. | |
1109 | |
1110 gnus-interactive-post | |
1111 Non-nil means that newsgroup, subject and distribution are asked | |
1112 for interactively when posting a new article. | |
1113 | |
1114 gnus-use-full-window | |
1115 Non-nil means to take up the entire screen of Emacs. | |
1116 | |
1117 gnus-window-configuration | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1118 Specifies the configuration of Group, Summary, and Article |
257 | 1119 windows. It is a list of (ACTION (G S A)), where G, S, and A are |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1120 the relative height of Group, Summary, and Article windows, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1121 respectively. ACTION is `summary', `newsgroups', or `article'. |
257 | 1122 |
1123 gnus-subscribe-newsgroup-method | |
1124 Specifies a function called with a newsgroup name when new | |
1125 newsgroup is found. The default definition adds new newsgroup at | |
1126 the beginning of other newsgroups. | |
1127 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1128 And more and more. Please refer to texinfo documentation. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1129 |
257 | 1130 Various hooks for customization: |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1131 gnus-group-mode-hook |
257 | 1132 Entry to this mode calls the value with no arguments, if that |
1133 value is non-nil. This hook is called before GNUS is connected to | |
1134 the NNTP server. So, you can change or define the NNTP server in | |
1135 this hook. | |
1136 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1137 gnus-startup-hook |
257 | 1138 Called with no arguments after the NNTP server is selected. It is |
1139 possible to change the behavior of GNUS or initialize the | |
1140 variables according to the selected NNTP server. | |
1141 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1142 gnus-group-prepare-hook |
257 | 1143 Called with no arguments after a newsgroup list is created in the |
1144 Newsgroup buffer, if that value is non-nil. | |
1145 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1146 gnus-save-newsrc-hook |
257 | 1147 Called with no arguments when saving newsrc file if that value is |
1148 non-nil. | |
1149 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1150 gnus-prepare-article-hook |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1151 Called with no arguments after preparing message body, but before |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1152 preparing header fields which is automatically generated if that |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1153 value is non-nil. The default hook (gnus-inews-insert-signature) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1154 inserts a signature file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1155 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1156 gnus-inews-article-hook |
257 | 1157 Called with no arguments when posting an article if that value is |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1158 non-nil. This hook is called just before posting an article. The |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1159 default hook does FCC (save an article to the specified file). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1160 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1161 gnus-suspend-gnus-hook |
257 | 1162 Called with no arguments when suspending (not exiting) GNUS, if |
1163 that value is non-nil. | |
1164 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1165 gnus-exit-gnus-hook |
257 | 1166 Called with no arguments when exiting (not suspending) GNUS, if |
1167 that value is non-nil." | |
1168 (interactive) | |
1169 (kill-all-local-variables) | |
1170 ;; Gee. Why don't you upgrade? | |
1171 (cond ((boundp 'mode-line-modified) | |
1172 (setq mode-line-modified "--- ")) | |
1173 ((listp (default-value 'mode-line-format)) | |
1174 (setq mode-line-format | |
1175 (cons "--- " (cdr (default-value 'mode-line-format))))) | |
1176 (t | |
1177 (setq mode-line-format | |
1178 "--- GNUS: List of Newsgroups %[(%m)%]----%3p-%-"))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1179 (setq major-mode 'gnus-group-mode) |
257 | 1180 (setq mode-name "Newsgroup") |
1181 (setq mode-line-buffer-identification "GNUS: List of Newsgroups") | |
1182 (setq mode-line-process nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1183 (use-local-map gnus-group-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1184 (buffer-flush-undo (current-buffer)) |
257 | 1185 (setq buffer-read-only t) ;Disable modification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1186 (run-hooks 'gnus-group-mode-hook)) |
257 | 1187 |
1188 ;;;###autoload | |
1189 (defun gnus (&optional confirm) | |
1190 "Read network news. | |
1191 If optional argument CONFIRM is non-nil, ask NNTP server." | |
1192 (interactive "P") | |
1193 (unwind-protect | |
1194 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1195 (switch-to-buffer (get-buffer-create gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1196 (gnus-group-mode) |
257 | 1197 (gnus-start-news-server confirm)) |
1198 (if (not (gnus-server-opened)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1199 (gnus-group-quit) |
257 | 1200 ;; NNTP server is successfully open. |
1201 (setq mode-line-process (format " {%s}" gnus-nntp-server)) | |
1202 (let ((buffer-read-only nil)) | |
1203 (erase-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1204 (gnus-group-startup-message) |
257 | 1205 (sit-for 0)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1206 (run-hooks 'gnus-startup-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1207 (gnus-setup-news) |
257 | 1208 (if gnus-novice-user |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1209 (gnus-group-describe-briefly)) ;Show brief help message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1210 (gnus-group-list-groups nil) |
257 | 1211 ))) |
1212 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1213 (defun gnus-group-startup-message () |
257 | 1214 "Insert startup message in current buffer." |
1215 ;; Insert the message. | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1216 (insert |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1217 (format " |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1218 %s |
257 | 1219 |
1220 NNTP-based News Reader for GNU Emacs | |
1221 | |
1222 | |
1223 If you have any trouble with this software, please let me | |
1224 know. I will fix your problems in the next release. | |
1225 | |
1226 Comments, suggestions, and bug fixes are welcome. | |
1227 | |
1228 Masanobu UMEDA | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1229 umerin@mse.kyutech.ac.jp" gnus-version)) |
257 | 1230 ;; And then hack it. |
1231 ;; 57 is the longest line. | |
1232 (indent-rigidly (point-min) (point-max) (/ (max (- (window-width) 57) 0) 2)) | |
1233 (goto-char (point-min)) | |
1234 ;; +4 is fuzzy factor. | |
1235 (insert-char ?\n (/ (max (- (window-height) 18) 0) 2))) | |
1236 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1237 (defun gnus-group-list-groups (show-all) |
257 | 1238 "List newsgroups in the Newsgroup buffer. |
1239 If argument SHOW-ALL is non-nil, unsubscribed groups are also listed." | |
1240 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1241 (let ((case-fold-search nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1242 (last-group ;Current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1243 (gnus-group-group-name)) |
257 | 1244 (next-group ;Next possible newsgroup. |
1245 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1246 (gnus-group-search-forward nil nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1247 (gnus-group-group-name))) |
257 | 1248 (prev-group ;Previous possible newsgroup. |
1249 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1250 (gnus-group-search-forward t nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1251 (gnus-group-group-name)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1252 (set-buffer gnus-group-buffer) ;May call from out of Group buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1253 (gnus-group-prepare show-all) |
257 | 1254 (if (zerop (buffer-size)) |
1255 (message "No news is good news") | |
1256 ;; Go to last newsgroup if possible. If cannot, try next and | |
1257 ;; previous. If all fail, go to first unread newsgroup. | |
1258 (goto-char (point-min)) | |
1259 (or (and last-group | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1260 (re-search-forward (gnus-group-make-regexp last-group) nil t)) |
257 | 1261 (and next-group |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1262 (re-search-forward (gnus-group-make-regexp next-group) nil t)) |
257 | 1263 (and prev-group |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1264 (re-search-forward (gnus-group-make-regexp prev-group) nil t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1265 (gnus-group-search-forward nil nil t)) |
257 | 1266 ;; Adjust cursor point. |
1267 (beginning-of-line) | |
1268 (search-forward ":" nil t) | |
1269 ))) | |
1270 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1271 (defun gnus-group-prepare (&optional all) |
257 | 1272 "Prepare list of newsgroups in current buffer. |
1273 If optional argument ALL is non-nil, unsubscribed groups are also listed." | |
1274 (let ((buffer-read-only nil) | |
1275 (newsrc gnus-newsrc-assoc) | |
1276 (group-info nil) | |
1277 (group-name nil) | |
1278 (unread-count 0) | |
1279 ;; This specifies the format of Group buffer. | |
1280 (cntl "%s%s%5d: %s\n")) | |
1281 (erase-buffer) | |
1282 ;; List newsgroups. | |
1283 (while newsrc | |
1284 (setq group-info (car newsrc)) | |
1285 (setq group-name (car group-info)) | |
1286 (setq unread-count (nth 1 (gnus-gethash group-name gnus-unread-hashtb))) | |
1287 (if (or all | |
1288 (and (nth 1 group-info) ;Subscribed. | |
1289 (> unread-count 0))) ;There are unread articles. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1290 ;; Yes, I can use gnus-group-prepare-line, but this is faster. |
257 | 1291 (insert |
1292 (format cntl | |
1293 ;; Subscribed or not. | |
1294 (if (nth 1 group-info) " " "U") | |
1295 ;; Has new news? | |
1296 (if (and (> unread-count 0) | |
1297 (>= 0 | |
1298 (- unread-count | |
1299 (length | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1300 (cdr (gnus-gethash group-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1301 gnus-marked-hashtb)))))) |
257 | 1302 "*" " ") |
1303 ;; Number of unread articles. | |
1304 unread-count | |
1305 ;; Newsgroup name. | |
1306 group-name)) | |
1307 ) | |
1308 (setq newsrc (cdr newsrc)) | |
1309 ) | |
1310 (setq gnus-have-all-newsgroups all) | |
1311 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1312 (run-hooks 'gnus-group-prepare-hook) |
257 | 1313 )) |
1314 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1315 (defun gnus-group-prepare-line (info) |
257 | 1316 "Return a string for the Newsgroup buffer from INFO. |
1317 INFO is an element of gnus-newsrc-assoc or gnus-killed-assoc." | |
1318 (let* ((group-name (car info)) | |
1319 (unread-count | |
1320 (or (nth 1 (gnus-gethash group-name gnus-unread-hashtb)) | |
1321 ;; Not in hash table, so compute it now. | |
1322 (gnus-number-of-articles | |
1323 (gnus-difference-of-range | |
1324 (nth 2 (gnus-gethash group-name gnus-active-hashtb)) | |
1325 (nthcdr 2 info))))) | |
1326 ;; This specifies the format of Group buffer. | |
1327 (cntl "%s%s%5d: %s\n")) | |
1328 (format cntl | |
1329 ;; Subscribed or not. | |
1330 (if (nth 1 info) " " "U") | |
1331 ;; Has new news? | |
1332 (if (and (> unread-count 0) | |
1333 (>= 0 | |
1334 (- unread-count | |
1335 (length | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1336 (cdr (gnus-gethash group-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1337 gnus-marked-hashtb)))))) |
257 | 1338 "*" " ") |
1339 ;; Number of unread articles. | |
1340 unread-count | |
1341 ;; Newsgroup name. | |
1342 group-name | |
1343 ))) | |
1344 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1345 (defun gnus-group-update-group (group &optional visible-only) |
257 | 1346 "Update newsgroup info of GROUP. |
1347 If optional argument VISIBLE-ONLY is non-nil, non displayed group is ignored." | |
1348 (let ((buffer-read-only nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1349 (case-fold-search nil) ;appleIIgs vs. appleiigs |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1350 (regexp (gnus-group-make-regexp group)) |
257 | 1351 (visible nil)) |
1352 ;; Buffer may be narrowed. | |
1353 (save-restriction | |
1354 (widen) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1355 ;; Search a line to modify. If the buffer is large, the search |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1356 ;; takes long time. In most cases, current point is on the line |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1357 ;; we are looking for. So, first of all, check current line. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1358 ;; And then if current point is in the first half, search from |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1359 ;; the beginning. Otherwise, search from the end. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1360 (if (cond ((progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1361 (beginning-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1362 (looking-at regexp))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1363 ((and (> (/ (buffer-size) 2) (point)) ;In the first half. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1364 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1365 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1366 (re-search-forward regexp nil t)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1367 ((progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1368 (goto-char (point-max)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1369 (re-search-backward regexp nil t)))) |
257 | 1370 ;; GROUP is listed in current buffer. So, delete old line. |
1371 (progn | |
1372 (setq visible t) | |
1373 (beginning-of-line) | |
1374 (delete-region (point) (progn (forward-line 1) (point))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1375 ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1376 ;; No such line in the buffer, so insert it at the top. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1377 (goto-char (point-min))) |
257 | 1378 (if (or visible (not visible-only)) |
1379 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1380 (insert (gnus-group-prepare-line |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1381 (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 1382 (forward-line -1) ;Move point on that line. |
1383 )) | |
1384 ))) | |
1385 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1386 (defun gnus-group-group-name () |
257 | 1387 "Get newsgroup name around point." |
1388 (save-excursion | |
1389 (beginning-of-line) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1390 (if (looking-at "^.+:[ \t]+\\([^ \t\n]+\\)\\([ \t].*\\|$\\)") |
257 | 1391 (buffer-substring (match-beginning 1) (match-end 1)) |
1392 ))) | |
1393 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1394 (defun gnus-group-make-regexp (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1395 "Return regexp that matches for a line of NEWSGROUP." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1396 (concat "^.+: " (regexp-quote newsgroup) "\\([ \t].*\\|$\\)")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1397 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1398 (defun gnus-group-search-forward (backward norest &optional heretoo) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1399 "Search for the next (or previous) newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1400 If 1st argument BACKWARD is non-nil, search backward instead. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1401 If 2nd argument NOREST is non-nil, don't care about newsgroup property. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1402 If optional argument HERETOO is non-nil, current line is searched for, too." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1403 (let ((case-fold-search nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1404 (func |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1405 (if backward |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1406 (function re-search-backward) (function re-search-forward))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1407 (regexp |
257 | 1408 (format "^%s[ \t]*\\(%s\\):" |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1409 (if norest ".." " [ \t]") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1410 (if norest "[0-9]+" "[1-9][0-9]*"))) |
257 | 1411 (found nil)) |
1412 (if backward | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1413 (if heretoo |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1414 (end-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1415 (beginning-of-line)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1416 (if heretoo |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1417 (beginning-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1418 (end-of-line))) |
257 | 1419 (setq found (funcall func regexp nil t)) |
1420 ;; Adjust cursor point. | |
1421 (beginning-of-line) | |
1422 (search-forward ":" nil t) | |
1423 ;; Return T if found. | |
1424 found | |
1425 )) | |
1426 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1427 ;; GNUS Group mode command |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1428 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1429 (defun gnus-group-read-group (all &optional no-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1430 "Read news in this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1431 If argument ALL is non-nil, already read articles become readable. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1432 If optional argument NO-ARTICLE is non-nil, no article body is displayed." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1433 (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1434 (let ((group (gnus-group-group-name))) ;Newsgroup name to read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1435 (if group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1436 (gnus-summary-read-group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1437 group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1438 (or all |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1439 ;;(not (nth 1 (gnus-gethash group gnus-newsrc-hashtb))) ;Unsubscribed |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1440 (zerop |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1441 (nth 1 (gnus-gethash group gnus-unread-hashtb)))) ;No unread |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1442 no-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1443 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1444 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1445 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1446 (defun gnus-group-select-group (all) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1447 "Select this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1448 No article is selected automatically. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1449 If argument ALL is non-nil, already read articles become readable." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1450 (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1451 (gnus-group-read-group all t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1452 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1453 (defun gnus-group-jump-to-group (group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1454 "Jump to newsgroup GROUP." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1455 (interactive |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1456 (list (completing-read "Newsgroup: " gnus-newsrc-assoc nil 'require-match))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1457 (let ((case-fold-search nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1458 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1459 (or (re-search-forward (gnus-group-make-regexp group) nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1460 (if (gnus-gethash group gnus-newsrc-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1461 ;; Add GROUP entry, then seach again. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1462 (gnus-group-update-group group))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1463 ;; Adjust cursor point. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1464 (beginning-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1465 (search-forward ":" nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1466 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1467 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1468 (defun gnus-group-next-group (n) |
257 | 1469 "Go to next N'th newsgroup." |
1470 (interactive "p") | |
1471 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1472 (gnus-group-search-forward nil t)) |
257 | 1473 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1474 (or (gnus-group-search-forward nil t) |
257 | 1475 (message "No more newsgroups"))) |
1476 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1477 (defun gnus-group-next-unread-group (n) |
257 | 1478 "Go to next N'th unread newsgroup." |
1479 (interactive "p") | |
1480 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1481 (gnus-group-search-forward nil nil)) |
257 | 1482 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1483 (or (gnus-group-search-forward nil nil) |
257 | 1484 (message "No more unread newsgroups"))) |
1485 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1486 (defun gnus-group-prev-group (n) |
257 | 1487 "Go to previous N'th newsgroup." |
1488 (interactive "p") | |
1489 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1490 (gnus-group-search-forward t t)) |
257 | 1491 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1492 (or (gnus-group-search-forward t t) |
257 | 1493 (message "No more newsgroups"))) |
1494 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1495 (defun gnus-group-prev-unread-group (n) |
257 | 1496 "Go to previous N'th unread newsgroup." |
1497 (interactive "p") | |
1498 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1499 (gnus-group-search-forward t nil)) |
257 | 1500 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1501 (or (gnus-group-search-forward t nil) |
257 | 1502 (message "No more unread newsgroups"))) |
1503 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1504 (defun gnus-group-catchup (all) |
257 | 1505 "Mark all articles not marked as unread in current newsgroup as read. |
1506 If prefix argument ALL is non-nil, all articles are marked as read. | |
1507 Cross references (Xref: field) of articles are ignored." | |
1508 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1509 (let* ((group (gnus-group-group-name)) |
257 | 1510 (marked (if (not all) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1511 (cdr (gnus-gethash group gnus-marked-hashtb))))) |
257 | 1512 (and group |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1513 (or (not gnus-interactive-catchup) ;Without confirmation? |
257 | 1514 (y-or-n-p |
1515 (if all | |
1516 "Do you really want to mark everything as read? " | |
1517 "Delete all articles not marked as read? "))) | |
1518 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1519 (message "") ;Clear "Yes or No" question. |
257 | 1520 ;; Any marked articles will be preserved. |
1521 (gnus-update-unread-articles group marked marked) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1522 (gnus-group-update-group group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1523 (gnus-group-next-group 1))) |
257 | 1524 )) |
1525 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1526 (defun gnus-group-catchup-all () |
257 | 1527 "Mark all articles in current newsgroup as read. |
1528 Cross references (Xref: field) of articles are ignored." | |
1529 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1530 (gnus-group-catchup t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1531 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1532 (defun gnus-group-unsubscribe-current-group () |
257 | 1533 "Toggle subscribe from/to unsubscribe current group." |
1534 (interactive) | |
7573
059281285df7
(gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents:
7560
diff
changeset
|
1535 (let ((group (gnus-group-group-name))) |
059281285df7
(gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents:
7560
diff
changeset
|
1536 (if group |
059281285df7
(gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents:
7560
diff
changeset
|
1537 (progn |
059281285df7
(gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents:
7560
diff
changeset
|
1538 (gnus-group-unsubscribe-group group) |
059281285df7
(gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents:
7560
diff
changeset
|
1539 (gnus-group-next-group 1)) |
059281285df7
(gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents:
7560
diff
changeset
|
1540 (message "No Newsgroup found to \(un\)subscribe")))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1541 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1542 (defun gnus-group-unsubscribe-group (group) |
257 | 1543 "Toggle subscribe from/to unsubscribe GROUP. |
1544 New newsgroup is added to .newsrc automatically." | |
1545 (interactive | |
1546 (list (completing-read "Newsgroup: " | |
1547 gnus-active-hashtb nil 'require-match))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1548 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 1549 (cond ((not (null newsrc)) |
1550 ;; Toggle subscription flag. | |
1551 (setcar (nthcdr 1 newsrc) (not (nth 1 newsrc))) | |
1552 (gnus-update-newsrc-buffer group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1553 (gnus-group-update-group group) |
257 | 1554 ;; Adjust cursor point. |
1555 (beginning-of-line) | |
1556 (search-forward ":" nil t)) | |
1557 ((and (stringp group) | |
1558 (gnus-gethash group gnus-active-hashtb)) | |
1559 ;; Add new newsgroup. | |
1560 (gnus-add-newsgroup group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1561 (gnus-group-update-group group) |
257 | 1562 ;; Adjust cursor point. |
1563 (beginning-of-line) | |
1564 (search-forward ":" nil t)) | |
1565 (t (error "No such newsgroup: %s" group))) | |
1566 )) | |
1567 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1568 (defun gnus-group-list-all-groups () |
257 | 1569 "List all of newsgroups in the Newsgroup buffer." |
1570 (interactive) | |
5510
d3e04700d190
(gnus-group-list-all-groups): Display a message in the echo area.
Richard M. Stallman <rms@gnu.org>
parents:
5313
diff
changeset
|
1571 (message "Listing all groups...") |
d3e04700d190
(gnus-group-list-all-groups): Display a message in the echo area.
Richard M. Stallman <rms@gnu.org>
parents:
5313
diff
changeset
|
1572 (gnus-group-list-groups t) |
d3e04700d190
(gnus-group-list-all-groups): Display a message in the echo area.
Richard M. Stallman <rms@gnu.org>
parents:
5313
diff
changeset
|
1573 (message "Listing all groups...done")) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1574 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1575 (defun gnus-group-get-new-news () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1576 "Get newly arrived articles. In fact, read the active file again." |
257 | 1577 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1578 (gnus-setup-news) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1579 (gnus-group-list-groups gnus-have-all-newsgroups)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1580 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1581 (defun gnus-group-restart () |
257 | 1582 "Force GNUS to read the raw startup file." |
1583 (interactive) | |
1584 (gnus-save-newsrc-file) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1585 (gnus-setup-news t) ;Force to read the raw startup file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1586 (gnus-group-list-groups gnus-have-all-newsgroups)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1587 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1588 (defun gnus-group-check-bogus-groups () |
257 | 1589 "Check bogus newsgroups." |
1590 (interactive) | |
1591 (gnus-check-bogus-newsgroups t) ;Require confirmation. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1592 (gnus-group-list-groups gnus-have-all-newsgroups)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1593 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1594 (defun gnus-group-restrict-groups (start end) |
257 | 1595 "Restrict visible newsgroups to the current region (START and END). |
1596 Type \\[widen] to remove restriction." | |
1597 (interactive "r") | |
1598 (save-excursion | |
1599 (narrow-to-region (progn | |
1600 (goto-char start) | |
1601 (beginning-of-line) | |
1602 (point)) | |
1603 (progn | |
1604 (goto-char end) | |
1605 (forward-line 1) | |
1606 (point)))) | |
1607 (message (substitute-command-keys "Type \\[widen] to remove restriction"))) | |
1608 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1609 (defun gnus-group-edit-global-kill () |
257 | 1610 "Edit a global KILL file." |
1611 (interactive) | |
1612 (setq gnus-current-kill-article nil) ;No articles selected. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1613 (gnus-kill-file-edit-file nil) ;Nil stands for global KILL file. |
257 | 1614 (message |
1615 (substitute-command-keys | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1616 "Editing a global KILL file (Type \\[gnus-kill-file-exit] to exit)"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1617 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1618 (defun gnus-group-edit-local-kill () |
257 | 1619 "Edit a local KILL file." |
1620 (interactive) | |
1621 (setq gnus-current-kill-article nil) ;No articles selected. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1622 (gnus-kill-file-edit-file (gnus-group-group-name)) |
257 | 1623 (message |
1624 (substitute-command-keys | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1625 "Editing a local KILL file (Type \\[gnus-kill-file-exit] to exit)"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1626 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1627 (defun gnus-group-force-update () |
257 | 1628 "Update .newsrc file." |
1629 (interactive) | |
1630 (gnus-save-newsrc-file)) | |
1631 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1632 (defun gnus-group-suspend () |
257 | 1633 "Suspend the current GNUS session. |
1634 In fact, cleanup buffers except for Group Mode buffer. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1635 The hook gnus-suspend-gnus-hook is called before actually suspending." |
257 | 1636 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1637 (run-hooks 'gnus-suspend-gnus-hook) |
257 | 1638 ;; Kill GNUS buffers except for Group Mode buffer. |
1639 (let ((buffers gnus-buffer-list)) | |
1640 (while buffers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1641 (and (not (eq (car buffers) gnus-group-buffer)) |
257 | 1642 (get-buffer (car buffers)) |
1643 (kill-buffer (car buffers))) | |
1644 (setq buffers (cdr buffers)) | |
1645 )) | |
1646 (bury-buffer)) | |
1647 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1648 (defun gnus-group-exit () |
257 | 1649 "Quit reading news after updating .newsrc. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1650 The hook gnus-exit-gnus-hook is called before actually quitting." |
257 | 1651 (interactive) |
1652 (if (or noninteractive ;For gnus-batch-kill | |
1653 (zerop (buffer-size)) ;No news is good news. | |
1654 (not (gnus-server-opened)) ;NNTP connection closed. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1655 (not gnus-interactive-exit) ;Without confirmation |
257 | 1656 (y-or-n-p "Are you sure you want to quit reading news? ")) |
1657 (progn | |
1658 (message "") ;Erase "Yes or No" question. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1659 (run-hooks 'gnus-exit-gnus-hook) |
257 | 1660 (gnus-save-newsrc-file) |
1661 (gnus-clear-system) | |
1662 (gnus-close-server)) | |
1663 )) | |
1664 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1665 (defun gnus-group-quit () |
257 | 1666 "Quit reading news without updating .newsrc. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1667 The hook gnus-exit-gnus-hook is called before actually quitting." |
257 | 1668 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1669 (if (or noninteractive ;For gnus-batch-kill |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1670 (zerop (buffer-size)) |
257 | 1671 (not (gnus-server-opened)) |
1672 (yes-or-no-p | |
1673 (format "Quit reading news without saving %s? " | |
1674 (file-name-nondirectory gnus-current-startup-file)))) | |
1675 (progn | |
1676 (message "") ;Erase "Yes or No" question. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1677 (run-hooks 'gnus-exit-gnus-hook) |
257 | 1678 (gnus-clear-system) |
1679 (gnus-close-server)) | |
1680 )) | |
1681 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1682 (defun gnus-group-describe-briefly () |
257 | 1683 "Describe Group mode commands briefly." |
1684 (interactive) | |
1685 (message | |
1686 (concat | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1687 (substitute-command-keys "\\[gnus-group-read-group]:Select ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1688 (substitute-command-keys "\\[gnus-group-next-unread-group]:Forward ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1689 (substitute-command-keys "\\[gnus-group-prev-unread-group]:Backward ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1690 (substitute-command-keys "\\[gnus-group-exit]:Exit ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1691 (substitute-command-keys "\\[gnus-info-find-node]:Run Info ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1692 (substitute-command-keys "\\[gnus-group-describe-briefly]:This help") |
257 | 1693 ))) |
1694 | |
1695 | |
1696 ;;; | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1697 ;;; GNUS Summary Mode |
257 | 1698 ;;; |
1699 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1700 (if gnus-summary-mode-map |
257 | 1701 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1702 (setq gnus-summary-mode-map (make-keymap)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1703 (suppress-keymap gnus-summary-mode-map) |
7216
6ecee038c1c9
(gnus-summary-mode-map): Bind C-c C-v to gnus-uu-ctl-map.
Richard M. Stallman <rms@gnu.org>
parents:
6309
diff
changeset
|
1704 (define-key gnus-summary-mode-map "\C-c\C-v" 'gnus-uu-ctl-map) |
7228
14df71736eae
(gnus-summary-mode-map): Bind # to gnus-uu-mark-article.
Richard M. Stallman <rms@gnu.org>
parents:
7216
diff
changeset
|
1705 (define-key gnus-summary-mode-map "#" 'gnus-uu-mark-article) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1706 (define-key gnus-summary-mode-map " " 'gnus-summary-next-page) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1707 (define-key gnus-summary-mode-map "\177" 'gnus-summary-prev-page) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1708 (define-key gnus-summary-mode-map "\r" 'gnus-summary-scroll-up) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1709 (define-key gnus-summary-mode-map "n" 'gnus-summary-next-unread-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1710 (define-key gnus-summary-mode-map "p" 'gnus-summary-prev-unread-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1711 (define-key gnus-summary-mode-map "N" 'gnus-summary-next-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1712 (define-key gnus-summary-mode-map "P" 'gnus-summary-prev-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1713 (define-key gnus-summary-mode-map "\e\C-n" 'gnus-summary-next-same-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1714 (define-key gnus-summary-mode-map "\e\C-p" 'gnus-summary-prev-same-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1715 ;;(define-key gnus-summary-mode-map "\e\C-n" 'gnus-summary-next-unread-same-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1716 ;;(define-key gnus-summary-mode-map "\e\C-p" 'gnus-summary-prev-unread-same-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1717 (define-key gnus-summary-mode-map "\C-c\C-n" 'gnus-summary-next-digest) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1718 (define-key gnus-summary-mode-map "\C-c\C-p" 'gnus-summary-prev-digest) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1719 (define-key gnus-summary-mode-map "\C-n" 'gnus-summary-next-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1720 (define-key gnus-summary-mode-map "\C-p" 'gnus-summary-prev-subject) |
7466
b48210278981
(gnus-group-mode-map, gnus-summary-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
1721 (define-key gnus-summary-mode-map [down] 'gnus-summary-next-subject) |
b48210278981
(gnus-group-mode-map, gnus-summary-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
7300
diff
changeset
|
1722 (define-key gnus-summary-mode-map [up] 'gnus-summary-prev-subject) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1723 (define-key gnus-summary-mode-map "\en" 'gnus-summary-next-unread-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1724 (define-key gnus-summary-mode-map "\ep" 'gnus-summary-prev-unread-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1725 ;;(define-key gnus-summary-mode-map "\C-cn" 'gnus-summary-next-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1726 ;;(define-key gnus-summary-mode-map "\C-cp" 'gnus-summary-prev-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1727 (define-key gnus-summary-mode-map "." 'gnus-summary-first-unread-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1728 ;;(define-key gnus-summary-mode-map "/" 'isearch-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1729 (define-key gnus-summary-mode-map "s" 'gnus-summary-isearch-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1730 (define-key gnus-summary-mode-map "\es" 'gnus-summary-search-article-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1731 ;;(define-key gnus-summary-mode-map "\eS" 'gnus-summary-search-article-backward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1732 (define-key gnus-summary-mode-map "\er" 'gnus-summary-search-article-backward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1733 (define-key gnus-summary-mode-map "<" 'gnus-summary-beginning-of-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1734 (define-key gnus-summary-mode-map ">" 'gnus-summary-end-of-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1735 (define-key gnus-summary-mode-map "j" 'gnus-summary-goto-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1736 ;;(define-key gnus-summary-mode-map "J" 'gnus-summary-goto-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1737 (define-key gnus-summary-mode-map "l" 'gnus-summary-goto-last-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1738 (define-key gnus-summary-mode-map "^" 'gnus-summary-refer-parent-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1739 ;;(define-key gnus-summary-mode-map "\er" 'gnus-summary-refer-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1740 (define-key gnus-summary-mode-map "\e^" 'gnus-summary-refer-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1741 (define-key gnus-summary-mode-map "u" 'gnus-summary-mark-as-unread-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1742 (define-key gnus-summary-mode-map "U" 'gnus-summary-mark-as-unread-backward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1743 (define-key gnus-summary-mode-map "d" 'gnus-summary-mark-as-read-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1744 (define-key gnus-summary-mode-map "D" 'gnus-summary-mark-as-read-backward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1745 (define-key gnus-summary-mode-map "\eu" 'gnus-summary-clear-mark-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1746 (define-key gnus-summary-mode-map "\eU" 'gnus-summary-clear-mark-backward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1747 (define-key gnus-summary-mode-map "k" 'gnus-summary-kill-same-subject-and-select) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1748 (define-key gnus-summary-mode-map "\C-k" 'gnus-summary-kill-same-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1749 (define-key gnus-summary-mode-map "\e\C-t" 'gnus-summary-toggle-threads) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1750 (define-key gnus-summary-mode-map "\e\C-s" 'gnus-summary-show-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1751 (define-key gnus-summary-mode-map "\e\C-h" 'gnus-summary-hide-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1752 (define-key gnus-summary-mode-map "\e\C-f" 'gnus-summary-next-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1753 (define-key gnus-summary-mode-map "\e\C-b" 'gnus-summary-prev-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1754 (define-key gnus-summary-mode-map "\e\C-u" 'gnus-summary-up-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1755 (define-key gnus-summary-mode-map "\e\C-d" 'gnus-summary-down-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1756 (define-key gnus-summary-mode-map "\e\C-k" 'gnus-summary-kill-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1757 (define-key gnus-summary-mode-map "&" 'gnus-summary-execute-command) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1758 ;;(define-key gnus-summary-mode-map "c" 'gnus-summary-catchup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1759 ;;(define-key gnus-summary-mode-map "c" 'gnus-summary-catchup-all) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1760 (define-key gnus-summary-mode-map "c" 'gnus-summary-catchup-and-exit) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1761 ;;(define-key gnus-summary-mode-map "c" 'gnus-summary-catchup-all-and-exit) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1762 (define-key gnus-summary-mode-map "\C-t" 'gnus-summary-toggle-truncation) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1763 (define-key gnus-summary-mode-map "x" 'gnus-summary-delete-marked-as-read) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1764 (define-key gnus-summary-mode-map "X" 'gnus-summary-delete-marked-with) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1765 (define-key gnus-summary-mode-map "\C-c\C-sn" 'gnus-summary-sort-by-number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1766 (define-key gnus-summary-mode-map "\C-c\C-sa" 'gnus-summary-sort-by-author) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1767 (define-key gnus-summary-mode-map "\C-c\C-ss" 'gnus-summary-sort-by-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1768 (define-key gnus-summary-mode-map "\C-c\C-sd" 'gnus-summary-sort-by-date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1769 (define-key gnus-summary-mode-map "\C-c\C-s\C-n" 'gnus-summary-sort-by-number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1770 (define-key gnus-summary-mode-map "\C-c\C-s\C-a" 'gnus-summary-sort-by-author) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1771 (define-key gnus-summary-mode-map "\C-c\C-s\C-s" 'gnus-summary-sort-by-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1772 (define-key gnus-summary-mode-map "\C-c\C-s\C-d" 'gnus-summary-sort-by-date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1773 (define-key gnus-summary-mode-map "=" 'gnus-summary-expand-window) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1774 ;;(define-key gnus-summary-mode-map "G" 'gnus-summary-reselect-current-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1775 (define-key gnus-summary-mode-map "\C-x\C-s" 'gnus-summary-reselect-current-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1776 (define-key gnus-summary-mode-map "w" 'gnus-summary-stop-page-breaking) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1777 (define-key gnus-summary-mode-map "\C-c\C-r" 'gnus-summary-caesar-message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1778 (define-key gnus-summary-mode-map "g" 'gnus-summary-show-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1779 (define-key gnus-summary-mode-map "t" 'gnus-summary-toggle-header) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1780 ;;(define-key gnus-summary-mode-map "v" 'gnus-summary-show-all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1781 (define-key gnus-summary-mode-map "\et" 'gnus-summary-toggle-mime) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1782 (define-key gnus-summary-mode-map "\C-d" 'gnus-summary-rmail-digest) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1783 (define-key gnus-summary-mode-map "a" 'gnus-summary-post-news) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1784 (define-key gnus-summary-mode-map "f" 'gnus-summary-followup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1785 (define-key gnus-summary-mode-map "F" 'gnus-summary-followup-with-original) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1786 (define-key gnus-summary-mode-map "C" 'gnus-summary-cancel-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1787 (define-key gnus-summary-mode-map "r" 'gnus-summary-reply) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1788 (define-key gnus-summary-mode-map "R" 'gnus-summary-reply-with-original) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1789 (define-key gnus-summary-mode-map "\C-c\C-f" 'gnus-summary-mail-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1790 (define-key gnus-summary-mode-map "m" 'gnus-summary-mail-other-window) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1791 (define-key gnus-summary-mode-map "o" 'gnus-summary-save-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1792 (define-key gnus-summary-mode-map "\C-o" 'gnus-summary-save-in-mail) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1793 (define-key gnus-summary-mode-map "|" 'gnus-summary-pipe-output) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1794 (define-key gnus-summary-mode-map "\ek" 'gnus-summary-edit-local-kill) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1795 (define-key gnus-summary-mode-map "\eK" 'gnus-summary-edit-global-kill) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1796 (define-key gnus-summary-mode-map "V" 'gnus-version) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1797 (define-key gnus-summary-mode-map "q" 'gnus-summary-exit) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1798 (define-key gnus-summary-mode-map "Q" 'gnus-summary-quit) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1799 (define-key gnus-summary-mode-map "?" 'gnus-summary-describe-briefly) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1800 (define-key gnus-summary-mode-map "\C-c\C-i" 'gnus-info-find-node)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1801 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1802 (defun gnus-summary-mode () |
257 | 1803 "Major mode for reading articles in this newsgroup. |
1804 All normal editing commands are turned off. | |
1805 Instead, these commands are available: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1806 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1807 SPC Scroll to the next page of the current article. The next unread |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1808 article is selected automatically at the end of the message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1809 DEL Scroll to the previous page of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1810 RET Scroll up (or down) one line the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1811 n Move to the next unread article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1812 p Move to the previous unread article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1813 N Move to the next article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1814 P Move to the previous article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1815 ESC C-n Move to the next article which has the same subject as the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1816 current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1817 ESC C-p Move to the previous article which has the same subject as the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1818 current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1819 \\[gnus-summary-next-unread-same-subject] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1820 Move to the next unread article which has the same subject as the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1821 current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1822 \\[gnus-summary-prev-unread-same-subject] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1823 Move to the previous unread article which has the same subject as |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1824 the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1825 C-c C-n Scroll to the next digested message of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1826 C-c C-p Scroll to the previous digested message of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1827 C-n Move to the next subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1828 C-p Move to the previous subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1829 ESC n Move to the next unread subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1830 ESC p Move to the previous unread subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1831 \\[gnus-summary-next-group] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1832 Exit the current newsgroup and select the next unread newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1833 \\[gnus-summary-prev-group] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1834 Exit the current newsgroup and select the previous unread newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1835 . Jump to the first unread article in the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1836 s Do an incremental search forward on the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1837 ESC s Search for an article containing a regexp forward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1838 ESC r Search for an article containing a regexp backward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1839 < Move point to the beginning of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1840 > Move point to the end of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1841 j Jump to the article specified by the numeric article ID. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1842 l Jump to the article you read last. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1843 ^ Refer to parent of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1844 ESC ^ Refer to the article specified by the Message-ID. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1845 u Mark the current article as unread, and go forward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1846 U Mark the current article as unread, and go backward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1847 d Mark the current article as read, and go forward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1848 D Mark the current article as read, and go backward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1849 ESC u Clear the current article's mark, and go forward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1850 ESC U Clear the current article's mark, and go backward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1851 k Mark articles which has the same subject as the current article as |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1852 read, and then select the next unread article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1853 C-k Mark articles which has the same subject as the current article as |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1854 read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1855 ESC k Edit a local KILL file applied to the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1856 ESC K Edit a global KILL file applied to all newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1857 ESC C-t Toggle showing conversation threads. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1858 ESC C-s Show thread subtrees. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1859 ESC C-h Hide thread subtrees. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1860 \\[gnus-summary-show-all-threads] Show all thread subtrees. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1861 \\[gnus-summary-hide-all-threads] Hide all thread subtrees. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1862 ESC C-f Go to the same level next thread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1863 ESC C-b Go to the same level previous thread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1864 ESC C-d Go downward current thread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1865 ESC C-u Go upward current thread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1866 ESC C-k Mark articles under current thread as read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1867 & Execute a command for each article conditionally. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1868 \\[gnus-summary-catchup] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1869 Mark all articles as read in the current newsgroup, preserving |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1870 articles marked as unread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1871 \\[gnus-summary-catchup-all] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1872 Mark all articles as read in the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1873 \\[gnus-summary-catchup-and-exit] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1874 Catch up all articles not marked as unread, and then exit the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1875 current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1876 \\[gnus-summary-catchup-all-and-exit] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1877 Catch up all articles, and then exit the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1878 C-t Toggle truncations of subject lines. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1879 x Delete subject lines marked as read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1880 X Delete subject lines with the specific marks. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1881 C-c C-s C-n Sort subjects by article number. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1882 C-c C-s C-a Sort subjects by article author. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1883 C-c C-s C-s Sort subjects alphabetically. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1884 C-c C-s C-d Sort subjects by date. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1885 = Expand Summary window to show headers full window. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1886 C-x C-s Reselect the current newsgroup. Prefix argument means to select all. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1887 w Stop page breaking by linefeed. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1888 C-c C-r Caesar rotates letters by 13/47 places. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1889 g Force to show the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1890 t Show original article header if pruned header currently shown, or |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1891 vice versa. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1892 ESC-t Toggle MIME processing. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1893 C-d Run RMAIL on the current digest article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1894 a Post a new article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1895 f Post a reply article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1896 F Post a reply article with original article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1897 C Cancel the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1898 r Mail a message to the author. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1899 R Mail a message to the author with original author. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1900 C-c C-f Forward the current message to another user. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1901 m Mail a message in other window. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1902 o Save the current article in your favorite format. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1903 C-o Append the current article to a file in Unix mail format. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1904 | Pipe the contents of the current article to a subprocess. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1905 q Quit reading news in the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1906 Q Quit reading news without recording unread articles information. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1907 V Show the version number of this GNUS. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1908 ? Describe Summary mode commands briefly. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1909 C-h m Describe Summary mode. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1910 C-c C-i Read Info about Summary mode. |
257 | 1911 |
1912 User customizable variables: | |
1913 gnus-large-newsgroup | |
1914 The number of articles which indicates a large newsgroup. If the | |
1915 number of articles in a newsgroup is greater than the value, the | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1916 number of articles to be selected is asked for. If the given value |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1917 N is positive, the last N articles is selected. If N is negative, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1918 the first N articles are selected. An empty string means to select |
257 | 1919 all articles. |
1920 | |
1921 gnus-use-long-file-name | |
1922 Non-nil means that a newsgroup name is used as a default file name | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1923 to save articles to. If it's nil, the directory form of a |
257 | 1924 newsgroup is used instead. |
1925 | |
1926 gnus-default-article-saver | |
1927 Specifies your favorite article saver which is interactively | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1928 funcallable. Following functions are available: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1929 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1930 gnus-summary-save-in-rmail (in Rmail format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1931 gnus-summary-save-in-mail (in Unix mail format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1932 gnus-summary-save-in-folder (in MH folder) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1933 gnus-summary-save-in-file (in article format). |
257 | 1934 |
1935 gnus-rmail-save-name | |
1936 gnus-mail-save-name | |
1937 gnus-folder-save-name | |
1938 gnus-file-save-name | |
1939 Specifies a function generating a file name to save articles in | |
1940 specified format. The function is called with NEWSGROUP, HEADERS, | |
1941 and optional LAST-FILE. Access macros to the headers are defined | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1942 as nntp-header-FIELD, and functions are defined as |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1943 gnus-header-FIELD. |
257 | 1944 |
1945 gnus-article-save-directory | |
1946 Specifies a directory name to save articles to using the commands | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1947 gnus-summary-save-in-rmail, gnus-summary-save-in-mail and |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1948 gnus-summary-save-in-file. The variable is initialized from the |
257 | 1949 SAVEDIR environment variable. |
1950 | |
1951 gnus-show-all-headers | |
1952 Non-nil means that all headers of an article are shown. | |
1953 | |
1954 gnus-save-all-headers | |
1955 Non-nil means that all headers of an article are saved in a file. | |
1956 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1957 gnus-show-mime |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1958 Non-nil means that show a MIME message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1959 |
257 | 1960 gnus-show-threads |
1961 Non-nil means that conversation threads are shown in tree structure. | |
1962 | |
1963 gnus-thread-hide-subject | |
1964 Non-nil means that subjects for thread subtrees are hidden. | |
1965 | |
1966 gnus-thread-hide-subtree | |
1967 Non-nil means that thread subtrees are hidden initially. | |
1968 | |
1969 gnus-thread-hide-killed | |
1970 Non-nil means that killed thread subtrees are hidden automatically. | |
1971 | |
1972 gnus-thread-ignore-subject | |
1973 Non-nil means that subject differences are ignored in constructing | |
1974 thread trees. | |
1975 | |
1976 gnus-thread-indent-level | |
1977 Indentation of thread subtrees. | |
1978 | |
1979 gnus-optional-headers | |
1980 Specifies a function which generates an optional string displayed | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1981 in the Summary buffer. The function is called with an article |
257 | 1982 HEADERS. The result must be a string excluding `[' and `]'. The |
1983 default function returns a string like NNN:AUTHOR, where NNN is | |
1984 the number of lines in an article and AUTHOR is the name of the | |
1985 author. | |
1986 | |
1987 gnus-auto-extend-newsgroup | |
1988 Non-nil means visible articles are extended to forward and | |
1989 backward automatically if possible. | |
1990 | |
1991 gnus-auto-select-first | |
1992 Non-nil means the first unread article is selected automagically | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1993 when a newsgroup is selected normally (by gnus-group-read-group). |
257 | 1994 If you'd like to prevent automatic selection of the first unread |
1995 article in some newsgroups, set the variable to nil in | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1996 gnus-select-group-hook or gnus-apply-kill-hook. |
257 | 1997 |
1998 gnus-auto-select-next | |
1999 Non-nil means the next newsgroup is selected automagically at the | |
2000 end of the newsgroup. If the value is t and the next newsgroup is | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2001 empty (no unread articles), GNUS will exit Summary mode and go |
257 | 2002 back to Group mode. If the value is neither nil nor t, GNUS won't |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2003 exit Summary mode but select the following unread newsgroup. |
257 | 2004 Especially, if the value is the symbol `quietly', the next unread |
2005 newsgroup will be selected without any confirmations. | |
2006 | |
2007 gnus-auto-select-same | |
2008 Non-nil means an article with the same subject as the current | |
2009 article is selected automagically like `rn -S'. | |
2010 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2011 gnus-auto-center-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2012 Non-nil means the point of Summary Mode window is always kept |
257 | 2013 centered. |
2014 | |
2015 gnus-break-pages | |
2016 Non-nil means an article is broken into pages at page delimiters. | |
2017 This may not work with some versions of GNU Emacs earlier than | |
2018 version 18.50. | |
2019 | |
2020 gnus-page-delimiter | |
2021 Specifies a regexp describing line-beginnings that separate pages | |
2022 of news article. | |
2023 | |
2024 [gnus-more-message is obsolete. overlay-arrow-string interfares | |
2025 with other subsystems, such as dbx mode.] | |
2026 | |
2027 gnus-digest-show-summary | |
2028 Non-nil means that a summary of digest messages is shown when | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2029 reading a digest article using `gnus-summary-rmail-digest' |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2030 command. |
257 | 2031 |
2032 gnus-digest-separator | |
2033 Specifies a regexp separating messages in a digest article. | |
2034 | |
2035 gnus-mail-reply-method | |
2036 gnus-mail-other-window-method | |
2037 Specifies a function to begin composing mail message using | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2038 commands gnus-summary-reply and gnus-summary-mail-other-window. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2039 Functions gnus-mail-reply-using-mail and gnus-mail-reply-using-mhe |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2040 are available for the value of gnus-mail-reply-method. And |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2041 functions gnus-mail-other-window-using-mail and |
257 | 2042 gnus-mail-other-window-using-mhe are available for the value of |
2043 gnus-mail-other-window-method. | |
2044 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2045 gnus-mail-send-method |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2046 Specifies a function to mail a message too which is being posted |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2047 as an article. The message must have To: or Cc: field. The value |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2048 of the variable send-mail-function is the default function which |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2049 uses sendmail mail program. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2050 |
257 | 2051 Various hooks for customization: |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2052 gnus-summary-mode-hook |
257 | 2053 Entry to this mode calls the value with no arguments, if that |
2054 value is non-nil. | |
2055 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2056 gnus-select-group-hook |
257 | 2057 Called with no arguments when newsgroup is selected, if that value |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2058 is non-nil. It is possible to sort subjects in this hook. See the |
257 | 2059 documentation of this variable for more information. |
2060 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2061 gnus-summary-prepare-hook |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2062 Called with no arguments after a summary list is created in the |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2063 Summary buffer, if that value is non-nil. If you'd like to modify |
257 | 2064 the buffer, you can use this hook. |
2065 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2066 gnus-select-article-hook |
257 | 2067 Called with no arguments when an article is selected, if that |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2068 value is non-nil. See the documentation of this variable for more |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2069 information. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2070 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2071 gnus-select-digest-hook |
257 | 2072 Called with no arguments when reading digest messages using Rmail, |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2073 if that value is non-nil. This hook can be used to modify an |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2074 article so that Rmail can work with it. See the documentation of |
257 | 2075 the variable for more information. |
2076 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2077 gnus-rmail-digest-hook |
257 | 2078 Called with no arguments when reading digest messages using Rmail, |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2079 if that value is non-nil. This hook is intended to customize Rmail |
257 | 2080 mode. |
2081 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2082 gnus-apply-kill-hook |
257 | 2083 Called with no arguments when a newsgroup is selected and the |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2084 Summary buffer is prepared. This hook is intended to apply a KILL |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2085 file to the selected newsgroup. The format of KILL file is |
257 | 2086 completely different from that of version 3.8. You have to rewrite |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2087 them in the new format. See the documentation of Kill file mode |
257 | 2088 for more information. |
2089 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2090 gnus-mark-article-hook |
257 | 2091 Called with no arguments when an article is selected at the first |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2092 time. The hook is intended to mark an article as read (or unread) |
257 | 2093 automatically when it is selected. See the documentation of the |
2094 variable for more information. | |
2095 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2096 gnus-exit-group-hook |
257 | 2097 Called with no arguments when exiting the current newsgroup, if |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2098 that value is non-nil. If your machine is so slow that exiting |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2099 from Summary mode takes very long time, inhibit marking articles |
257 | 2100 as read using cross-references by setting the variable |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2101 gnus-use-cross-reference to nil in this hook." |
257 | 2102 (interactive) |
2103 (kill-all-local-variables) | |
2104 ;; Gee. Why don't you upgrade? | |
2105 (cond ((boundp 'mode-line-modified) | |
2106 (setq mode-line-modified "--- ")) | |
2107 ((listp (default-value 'mode-line-format)) | |
2108 (setq mode-line-format | |
2109 (cons "--- " (cdr (default-value 'mode-line-format)))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2110 ;; To disable display-time facility. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2111 ;;(make-local-variable 'global-mode-string) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2112 ;;(setq global-mode-string nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2113 (setq major-mode 'gnus-summary-mode) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2114 (setq mode-name "Summary") |
257 | 2115 ;;(setq mode-line-process '(" " gnus-newsgroup-name)) |
2116 (make-local-variable 'minor-mode-alist) | |
2117 (or (assq 'gnus-show-threads minor-mode-alist) | |
2118 (setq minor-mode-alist | |
2119 (cons (list 'gnus-show-threads " Thread") minor-mode-alist))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2120 (gnus-summary-set-mode-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2121 (use-local-map gnus-summary-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2122 (buffer-flush-undo (current-buffer)) |
257 | 2123 (setq buffer-read-only t) ;Disable modification |
2124 (setq truncate-lines t) ;Stop line folding | |
2125 (setq selective-display t) | |
2126 (setq selective-display-ellipses t) ;Display `...' | |
2127 ;;(setq case-fold-search t) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2128 (run-hooks 'gnus-summary-mode-hook)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2129 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2130 (defun gnus-summary-setup-buffer () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2131 "Initialize Summary buffer." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2132 (if (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2133 (set-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2134 (set-buffer (get-buffer-create gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2135 (gnus-summary-mode) |
257 | 2136 )) |
2137 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2138 (defun gnus-summary-read-group (group &optional show-all no-article) |
257 | 2139 "Start reading news in newsgroup GROUP. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2140 If optional 1st argument SHOW-ALL is non-nil, already read articles are |
257 | 2141 also listed. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2142 If optional 2nd argument NO-ARTICLE is non-nil, no article is selected |
257 | 2143 initially." |
2144 (message "Retrieving newsgroup: %s..." group) | |
2145 (if (gnus-select-newsgroup group show-all) | |
2146 (progn | |
2147 ;; Don't switch-to-buffer to prevent displaying old contents | |
2148 ;; of the buffer until new subjects list is created. | |
2149 ;; Suggested by Juha Heinanen <jh@tut.fi> | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2150 (gnus-summary-setup-buffer) |
257 | 2151 ;; You can change the order of subjects in this hook. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2152 (run-hooks 'gnus-select-group-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2153 (gnus-summary-prepare) |
257 | 2154 ;; Function `gnus-apply-kill-file' must be called in this hook. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2155 (run-hooks 'gnus-apply-kill-hook) |
257 | 2156 (if (zerop (buffer-size)) |
2157 ;; This newsgroup is empty. | |
2158 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2159 (gnus-summary-catchup-and-exit nil t) ;Without confirmations. |
257 | 2160 (message "No unread news")) |
2161 ;; Hide conversation thread subtrees. We cannot do this in | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2162 ;; gnus-summary-prepare-hook since kill processing may not |
257 | 2163 ;; work with hidden articles. |
2164 (and gnus-show-threads | |
2165 gnus-thread-hide-subtree | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2166 (gnus-summary-hide-all-threads)) |
257 | 2167 ;; Show first unread article if requested. |
2168 (goto-char (point-min)) | |
2169 (if (and (not no-article) | |
2170 gnus-auto-select-first | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2171 (gnus-summary-first-unread-article)) |
257 | 2172 ;; Window is configured automatically. |
2173 ;; Current buffer may be changed as a result of hook | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2174 ;; evaluation, especially by gnus-summary-rmail-digest |
257 | 2175 ;; command, so we should adjust cursor point carefully. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2176 (if (eq (current-buffer) (get-buffer gnus-summary-buffer)) |
257 | 2177 (progn |
2178 ;; Adjust cursor point. | |
2179 (beginning-of-line) | |
2180 (search-forward ":" nil t))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2181 (gnus-configure-windows 'summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2182 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2183 (gnus-summary-set-mode-line) |
257 | 2184 ;; I sometime get confused with the old Article buffer. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2185 (if (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2186 (if (get-buffer-window gnus-article-buffer) |
257 | 2187 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2188 (set-buffer gnus-article-buffer) |
257 | 2189 (let ((buffer-read-only nil)) |
2190 (erase-buffer))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2191 (kill-buffer gnus-article-buffer))) |
257 | 2192 ;; Adjust cursor point. |
2193 (beginning-of-line) | |
2194 (search-forward ":" nil t)) | |
2195 )) | |
2196 ;; Cannot select newsgroup GROUP. | |
2197 (if (gnus-gethash group gnus-active-hashtb) | |
2198 (progn | |
2199 ;; If NNTP is used, nntp_access file may not be installed | |
2200 ;; properly. Otherwise, may be active file problem. | |
2201 (ding) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2202 (message |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2203 (gnus-nntp-message |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2204 (format "Cannot select %s. May be security or active file problem." group))) |
257 | 2205 (sit-for 0)) |
2206 ;; Check bogus newsgroups. | |
2207 ;; We must be in Group Mode buffer. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2208 (gnus-group-check-bogus-groups)) |
257 | 2209 )) |
2210 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2211 (defun gnus-summary-prepare () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2212 "Prepare summary list of current newsgroup in Summary buffer." |
257 | 2213 (let ((buffer-read-only nil)) |
2214 ;; Note: The next codes are not actually used because the user who | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2215 ;; want it can define them in gnus-select-group-hook. |
257 | 2216 ;; Print verbose messages if too many articles are selected. |
2217 ;; (and (numberp gnus-large-newsgroup) | |
2218 ;; (> (length gnus-newsgroup-headers) gnus-large-newsgroup) | |
2219 ;; (message "Preparing headers...")) | |
2220 (erase-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2221 (gnus-summary-prepare-threads |
257 | 2222 (if gnus-show-threads |
2223 (gnus-make-threads gnus-newsgroup-headers) | |
2224 gnus-newsgroup-headers) 0) | |
2225 ;; Erase header retrieval message. | |
2226 (message "") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2227 ;; Call hooks for modifying Summary buffer. |
257 | 2228 ;; Suggested by sven@tde.LTH.Se (Sven Mattisson). |
2229 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2230 (run-hooks 'gnus-summary-prepare-hook) |
257 | 2231 )) |
2232 | |
2233 ;; Basic ideas by Paul Dworkin <paul@media-lab.media.mit.edu> | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2234 ;; Subject bug fix by jbw@bigbird.bu.edu (Joe Wells) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2235 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2236 (defun gnus-summary-prepare-threads (threads level &optional parent-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2237 "Prepare Summary buffer from THREADS and indentation LEVEL. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2238 THREADS is a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...]).' |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2239 Optional PARENT-SUBJECT specifies the subject of the parent." |
257 | 2240 (let ((thread nil) |
2241 (header nil) | |
2242 (number nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2243 (subject nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2244 (child-subject nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2245 (parent-subject (or parent-subject "")) |
257 | 2246 ;; `M Indent NUM: [OPT] SUBJECT' |
2247 (cntl (format "%%s %%s%%%dd: [%%s] %%s\n" | |
2248 (length (prin1-to-string gnus-newsgroup-end))))) | |
2249 (while threads | |
2250 (setq thread (car threads)) | |
2251 (setq threads (cdr threads)) | |
2252 ;; If thread is a cons, hierarchical threads is given. | |
2253 ;; Otherwise, thread itself is header. | |
2254 (if (consp thread) | |
2255 (setq header (car thread)) | |
2256 (setq header thread)) | |
2257 ;; Print valid header only. | |
2258 (if (vectorp header) ;Depends on nntp.el. | |
2259 (progn | |
2260 (setq number (nntp-header-number header)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2261 (setq subject (nntp-header-subject header)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2262 (setq child-subject (gnus-simplify-subject subject 're-only)) |
257 | 2263 (insert |
2264 (format cntl | |
2265 ;; Read or not. | |
2266 (cond ((memq number gnus-newsgroup-marked) "-") | |
2267 ((memq number gnus-newsgroup-unreads) " ") | |
2268 (t "D")) | |
2269 ;; Thread level. | |
2270 (make-string (* level gnus-thread-indent-level) ? ) | |
2271 ;; Article number. | |
2272 number | |
2273 ;; Optional headers. | |
2274 (or (and gnus-optional-headers | |
2275 (funcall gnus-optional-headers header)) "") | |
2276 ;; Its subject string. | |
2277 (concat (if (or (zerop level) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2278 (not gnus-thread-hide-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2279 ;; Subject is different from the parent. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2280 (not (string-equal |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2281 parent-subject child-subject))) |
257 | 2282 nil |
2283 (make-string (window-width) ? )) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2284 subject) |
257 | 2285 )) |
2286 )) | |
2287 ;; Print subthreads. | |
2288 (and (consp thread) | |
2289 (cdr thread) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2290 (gnus-summary-prepare-threads |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2291 (cdr thread) (1+ level) child-subject)) |
257 | 2292 ))) |
2293 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2294 ;;(defun gnus-summary-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2295 ;; "Set Summary mode line string." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2296 ;; ;; The value must be a string to escape %-constructs. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2297 ;; (let ((subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2298 ;; (if gnus-current-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2299 ;; (nntp-header-subject gnus-current-headers) gnus-newsgroup-name))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2300 ;; (setq mode-line-buffer-identification |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2301 ;; (concat "GNUS: " |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2302 ;; subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2303 ;; ;; Enough spaces to pad subject to 17 positions. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2304 ;; (make-string (max 0 (- 17 (length subject))) ? )))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2305 ;; (set-buffer-modified-p t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2306 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2307 ;; New implementation in gnus 3.14.3 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2308 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2309 (defun gnus-summary-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2310 "Set Summary mode line string. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2311 If you don't like it, define your own gnus-summary-set-mode-line." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2312 (let ((unmarked |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2313 (- (length gnus-newsgroup-unreads) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2314 (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2315 gnus-newsgroup-unreads gnus-newsgroup-marked)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2316 (unselected |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2317 (- (length gnus-newsgroup-unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2318 (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2319 gnus-newsgroup-unselected gnus-newsgroup-marked))))) |
257 | 2320 (setq mode-line-buffer-identification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2321 (list 17 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2322 (format "GNUS: %s%s %s" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2323 gnus-newsgroup-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2324 (if gnus-current-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2325 (format "/%d" gnus-current-article) "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2326 ;; Basic ideas by tale@pawl.rpi.edu. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2327 (cond ((and (zerop unmarked) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2328 (zerop unselected)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2329 "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2330 ((zerop unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2331 (format "{%d more}" unmarked)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2332 (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2333 (format "{%d(+%d) more}" unmarked unselected))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2334 )))) |
257 | 2335 (set-buffer-modified-p t)) |
2336 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2337 ;; GNUS Summary mode command. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2338 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2339 (defun gnus-summary-search-group (&optional backward) |
257 | 2340 "Search for next unread newsgroup. |
2341 If optional argument BACKWARD is non-nil, search backward instead." | |
2342 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2343 (set-buffer gnus-group-buffer) |
257 | 2344 (save-excursion |
2345 ;; We don't want to alter current point of Group mode buffer. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2346 (if (gnus-group-search-forward backward nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2347 (gnus-group-group-name)) |
257 | 2348 ))) |
2349 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2350 (defun gnus-summary-search-subject (backward unread subject) |
257 | 2351 "Search for article forward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2352 If 1st argument BACKWARD is non-nil, search backward. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2353 If 2nd argument UNREAD is non-nil, only unread article is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2354 If 3rd argument SUBJECT is non-nil, the article which has |
257 | 2355 the same subject will be searched for." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2356 (let ((func |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2357 (if backward |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2358 (function re-search-backward) (function re-search-forward))) |
257 | 2359 (article nil) |
2360 ;; We have to take care of hidden lines. | |
2361 (regexp | |
2362 (format "^%s[ \t]+\\([0-9]+\\):.\\[[^]\r\n]*\\][ \t]+%s" | |
2363 ;;(if unread " " ".") | |
6309
9217f29851c2
Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents:
5911
diff
changeset
|
2364 (cond ((eq unread t) " ") (unread "[- ]") (t ".")) |
257 | 2365 (if subject |
2366 (concat "\\([Rr][Ee]:[ \t]+\\)*" | |
2367 (regexp-quote (gnus-simplify-subject subject)) | |
2368 ;; Ignore words in parentheses. | |
2369 "\\([ \t]*([^\r\n]*)\\)*[ \t]*\\(\r\\|$\\)") | |
2370 "") | |
2371 ))) | |
2372 (if backward | |
2373 (beginning-of-line) | |
2374 (end-of-line)) | |
2375 (if (funcall func regexp nil t) | |
2376 (setq article | |
2377 (string-to-int | |
2378 (buffer-substring (match-beginning 1) (match-end 1))))) | |
2379 ;; Adjust cursor point. | |
2380 (beginning-of-line) | |
2381 (search-forward ":" nil t) | |
2382 ;; This is the result. | |
2383 article | |
2384 )) | |
2385 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2386 (defun gnus-summary-search-forward (&optional unread subject) |
257 | 2387 "Search for article forward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2388 If 1st optional argument UNREAD is non-nil, only unread article is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2389 If 2nd optional argument SUBJECT is non-nil, the article which has |
257 | 2390 the same subject will be searched for." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2391 (gnus-summary-search-subject nil unread subject)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2392 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2393 (defun gnus-summary-search-backward (&optional unread subject) |
257 | 2394 "Search for article backward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2395 If 1st optional argument UNREAD is non-nil, only unread article is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2396 If 2nd optional argument SUBJECT is non-nil, the article which has |
257 | 2397 the same subject will be searched for." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2398 (gnus-summary-search-subject t unread subject)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2399 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2400 (defun gnus-summary-article-number () |
257 | 2401 "Article number around point. If nothing, return current number." |
2402 (save-excursion | |
2403 (beginning-of-line) | |
2404 (if (looking-at ".[ \t]+\\([0-9]+\\):") | |
2405 (string-to-int | |
2406 (buffer-substring (match-beginning 1) (match-end 1))) | |
2407 ;; If search fail, return current article number. | |
2408 gnus-current-article | |
2409 ))) | |
2410 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2411 (defun gnus-summary-subject-string () |
257 | 2412 "Return current subject string or nil if nothing." |
2413 (save-excursion | |
2414 ;; It is possible to implement this function using | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2415 ;; `gnus-summary-article-number' and `gnus-newsgroup-headers'. |
257 | 2416 (beginning-of-line) |
2417 ;; We have to take care of hidden lines. | |
2418 (if (looking-at ".[ \t]+[0-9]+:.\\[[^]\r\n]*\\][ \t]+\\([^\r\n]*\\)[\r\n]") | |
2419 (buffer-substring (match-beginning 1) (match-end 1))) | |
2420 )) | |
2421 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2422 (defun gnus-summary-goto-subject (article) |
257 | 2423 "Move point to ARTICLE's subject." |
2424 (interactive | |
2425 (list | |
2426 (string-to-int | |
2427 (completing-read "Article number: " | |
2428 (mapcar | |
2429 (function | |
2430 (lambda (headers) | |
2431 (list | |
2432 (int-to-string (nntp-header-number headers))))) | |
2433 gnus-newsgroup-headers) | |
2434 nil 'require-match)))) | |
2435 (let ((current (point))) | |
2436 (goto-char (point-min)) | |
2437 (or (and article (re-search-forward (format "^.[ \t]+%d:" article) nil t)) | |
2438 (progn (goto-char current) nil)) | |
2439 )) | |
2440 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2441 (defun gnus-summary-recenter () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2442 "Center point in Summary window." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2443 ;; Scroll window so as to cursor comes center of Summary window |
257 | 2444 ;; only when article is displayed. |
2445 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). | |
2446 ;; Recenter only when requested. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2447 ;; Subbested by popovich@park.cs.columbia.edu |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2448 (and gnus-auto-center-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2449 (get-buffer-window gnus-article-buffer) |
257 | 2450 (< (/ (- (window-height) 1) 2) |
2451 (count-lines (point) (point-max))) | |
2452 (recenter (/ (- (window-height) 2) 2)))) | |
2453 | |
2454 ;; Walking around Group mode buffer. | |
2455 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2456 (defun gnus-summary-jump-to-group (newsgroup) |
257 | 2457 "Move point to NEWSGROUP in Group mode buffer." |
2458 ;; Keep update point of Group mode buffer if visible. | |
2459 (if (eq (current-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2460 (get-buffer gnus-group-buffer)) |
257 | 2461 (save-window-excursion |
2462 ;; Take care of tree window mode. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2463 (if (get-buffer-window gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2464 (pop-to-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2465 (gnus-group-jump-to-group newsgroup)) |
257 | 2466 (save-excursion |
2467 ;; Take care of tree window mode. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2468 (if (get-buffer-window gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2469 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2470 (set-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2471 (gnus-group-jump-to-group newsgroup)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2472 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2473 (defun gnus-summary-next-group (no-article) |
257 | 2474 "Exit current newsgroup and then select next unread newsgroup. |
2475 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
2476 (interactive "P") | |
2477 ;; Make sure Group mode buffer point is on current newsgroup. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2478 (gnus-summary-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2479 (let ((group (gnus-summary-search-group))) |
257 | 2480 (if (null group) |
2481 (progn | |
2482 (message "Exiting %s..." gnus-newsgroup-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2483 (gnus-summary-exit) |
257 | 2484 (message "")) |
2485 (message "Selecting %s..." group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2486 (gnus-summary-exit t) ;Exit Summary mode temporary. |
257 | 2487 ;; We are now in Group mode buffer. |
2488 ;; Make sure Group mode buffer point is on GROUP. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2489 (gnus-summary-jump-to-group group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2490 (gnus-summary-read-group group nil no-article) |
257 | 2491 (or (eq (current-buffer) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2492 (get-buffer gnus-summary-buffer)) |
257 | 2493 (eq gnus-auto-select-next t) |
2494 ;; Expected newsgroup has nothing to read since the articles | |
2495 ;; are marked as read by cross-referencing. So, try next | |
2496 ;; newsgroup. (Make sure we are in Group mode buffer now.) | |
2497 (and (eq (current-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2498 (get-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2499 (gnus-group-group-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2500 (gnus-summary-read-group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2501 (gnus-group-group-name) nil no-article)) |
257 | 2502 ) |
2503 ))) | |
2504 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2505 (defun gnus-summary-prev-group (no-article) |
257 | 2506 "Exit current newsgroup and then select previous unread newsgroup. |
2507 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
2508 (interactive "P") | |
2509 ;; Make sure Group mode buffer point is on current newsgroup. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2510 (gnus-summary-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2511 (let ((group (gnus-summary-search-group t))) |
257 | 2512 (if (null group) |
2513 (progn | |
2514 (message "Exiting %s..." gnus-newsgroup-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2515 (gnus-summary-exit) |
257 | 2516 (message "")) |
2517 (message "Selecting %s..." group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2518 (gnus-summary-exit t) ;Exit Summary mode temporary. |
257 | 2519 ;; We are now in Group mode buffer. |
2520 ;; We have to adjust point of Group mode buffer because current | |
2521 ;; point is moved to next unread newsgroup by exiting. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2522 (gnus-summary-jump-to-group group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2523 (gnus-summary-read-group group nil no-article) |
257 | 2524 (or (eq (current-buffer) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2525 (get-buffer gnus-summary-buffer)) |
257 | 2526 (eq gnus-auto-select-next t) |
2527 ;; Expected newsgroup has nothing to read since the articles | |
2528 ;; are marked as read by cross-referencing. So, try next | |
2529 ;; newsgroup. (Make sure we are in Group mode buffer now.) | |
2530 (and (eq (current-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2531 (get-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2532 (gnus-summary-search-group t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2533 (gnus-summary-read-group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2534 (gnus-summary-search-group t) nil no-article)) |
257 | 2535 ) |
2536 ))) | |
2537 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2538 ;; Walking around summary lines. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2539 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2540 (defun gnus-summary-next-subject (n &optional unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2541 "Go to next N'th summary line. |
257 | 2542 If optional argument UNREAD is non-nil, only unread article is selected." |
2543 (interactive "p") | |
2544 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2545 (gnus-summary-search-forward unread)) |
257 | 2546 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2547 (cond ((gnus-summary-search-forward unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2548 (gnus-summary-recenter)) |
257 | 2549 (unread |
2550 (message "No more unread articles")) | |
2551 (t | |
2552 (message "No more articles")) | |
2553 )) | |
2554 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2555 (defun gnus-summary-next-unread-subject (n) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2556 "Go to next N'th unread summary line." |
257 | 2557 (interactive "p") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2558 (gnus-summary-next-subject n t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2559 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2560 (defun gnus-summary-prev-subject (n &optional unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2561 "Go to previous N'th summary line. |
257 | 2562 If optional argument UNREAD is non-nil, only unread article is selected." |
2563 (interactive "p") | |
2564 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2565 (gnus-summary-search-backward unread)) |
257 | 2566 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2567 (cond ((gnus-summary-search-backward unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2568 (gnus-summary-recenter)) |
257 | 2569 (unread |
2570 (message "No more unread articles")) | |
2571 (t | |
2572 (message "No more articles")) | |
2573 )) | |
2574 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2575 (defun gnus-summary-prev-unread-subject (n) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2576 "Go to previous N'th unread summary line." |
257 | 2577 (interactive "p") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2578 (gnus-summary-prev-subject n t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2579 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2580 ;; Walking around summary lines with displaying articles. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2581 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2582 (defun gnus-summary-expand-window () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2583 "Expand Summary window to show headers full window." |
257 | 2584 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2585 (gnus-configure-windows 'summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2586 (pop-to-buffer gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2587 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2588 (defun gnus-summary-display-article (article &optional all-header) |
257 | 2589 "Display ARTICLE in Article buffer." |
2590 (if (null article) | |
2591 nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2592 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2593 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2594 (gnus-article-prepare article all-header) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2595 (gnus-summary-recenter) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2596 (gnus-summary-set-mode-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2597 (run-hooks 'gnus-select-article-hook) |
257 | 2598 ;; Successfully display article. |
2599 t | |
2600 )) | |
2601 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2602 (defun gnus-summary-select-article (&optional all-headers force) |
257 | 2603 "Select the current article. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2604 Optional first argument ALL-HEADERS is non-nil, show all header fields. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2605 Optional second argument FORCE is nil, the article is only selected |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2606 again when current header does not match with ALL-HEADERS option." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2607 (let ((article (gnus-summary-article-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2608 (all-headers (not (not all-headers)))) ;Must be T or NIL. |
257 | 2609 (if (or (null gnus-current-article) |
2610 (/= article gnus-current-article) | |
2611 (and force (not (eq all-headers gnus-have-all-headers)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2612 ;; The selected one is different from that of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2613 (gnus-summary-display-article article all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2614 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2615 (pop-to-buffer gnus-summary-buffer)) |
257 | 2616 )) |
2617 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2618 (defun gnus-summary-set-current-mark (&optional current-mark) |
257 | 2619 "Put `+' at the current article. |
2620 Optional argument specifies CURRENT-MARK instead of `+'." | |
2621 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2622 (set-buffer gnus-summary-buffer) |
257 | 2623 (let ((buffer-read-only nil)) |
2624 (goto-char (point-min)) | |
2625 ;; First of all clear mark at last article. | |
2626 (if (re-search-forward "^.[ \t]+[0-9]+:[^ \t]" nil t) | |
2627 (progn | |
2628 (delete-char -1) | |
2629 (insert " ") | |
2630 (goto-char (point-min)))) | |
2631 (if (re-search-forward (format "^.[ \t]+%d:" gnus-current-article) nil t) | |
2632 (progn | |
2633 (delete-char 1) | |
2634 (insert (or current-mark "+")))) | |
2635 ))) | |
2636 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2637 ;;(defun gnus-summary-next-article (unread &optional subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2638 ;; "Select article after current one. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2639 ;;If argument UNREAD is non-nil, only unread article is selected." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2640 ;; (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2641 ;; (cond ((gnus-summary-display-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2642 ;; (gnus-summary-search-forward unread subject))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2643 ;; (unread |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2644 ;; (message "No more unread articles")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2645 ;; (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2646 ;; (message "No more articles")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2647 ;; )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2648 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2649 (defun gnus-summary-next-article (unread &optional subject) |
257 | 2650 "Select article after current one. |
2651 If argument UNREAD is non-nil, only unread article is selected." | |
2652 (interactive "P") | |
2653 (let ((header nil)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2654 (cond ((gnus-summary-display-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2655 (gnus-summary-search-forward unread subject))) |
257 | 2656 ((and subject |
2657 gnus-auto-select-same | |
2658 (gnus-set-difference gnus-newsgroup-unreads | |
2659 gnus-newsgroup-marked) | |
2660 (memq this-command | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2661 '(gnus-summary-next-unread-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2662 gnus-summary-next-page |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2663 gnus-summary-kill-same-subject-and-select |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2664 ;;gnus-summary-next-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2665 ;;gnus-summary-next-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2666 ;;gnus-summary-next-unread-same-subject |
257 | 2667 ))) |
2668 ;; Wrap article pointer if there are unread articles. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2669 ;; Hook function, such as gnus-summary-rmail-digest, may |
257 | 2670 ;; change current buffer, so need check. |
2671 (let ((buffer (current-buffer)) | |
2672 (last-point (point))) | |
2673 ;; No more articles with same subject, so jump to the first | |
2674 ;; unread article. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2675 (gnus-summary-first-unread-article) |
257 | 2676 ;;(and (eq buffer (current-buffer)) |
2677 ;; (= (point) last-point) | |
2678 ;; ;; Ignore given SUBJECT, and try again. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2679 ;; (gnus-summary-next-article unread nil)) |
257 | 2680 (and (eq buffer (current-buffer)) |
2681 (< (point) last-point) | |
2682 (message "Wrapped")) | |
2683 )) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2684 ((and gnus-auto-extend-newsgroup |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2685 (not unread) ;Not unread only |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2686 (not subject) ;Only if subject is not specified. |
257 | 2687 (setq header (gnus-more-header-forward))) |
2688 ;; Extend to next article if possible. | |
2689 ;; Basic ideas by himacdonald@watdragon.waterloo.edu | |
2690 (gnus-extend-newsgroup header nil) | |
2691 ;; Threads feature must be turned off. | |
2692 (let ((buffer-read-only nil)) | |
2693 (goto-char (point-max)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2694 (gnus-summary-prepare-threads (list header) 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2695 (gnus-summary-goto-article gnus-newsgroup-end)) |
257 | 2696 (t |
2697 ;; Select next newsgroup automatically if requested. | |
7974
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2698 (let ((cmd (aref (this-command-keys) 0)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2699 (group (gnus-summary-search-group)) |
257 | 2700 (auto-select |
2701 (and gnus-auto-select-next | |
2702 ;;(null (gnus-set-difference gnus-newsgroup-unreads | |
2703 ;; gnus-newsgroup-marked)) | |
2704 (memq this-command | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2705 '(gnus-summary-next-unread-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2706 gnus-summary-next-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2707 gnus-summary-next-page |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2708 gnus-summary-next-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2709 gnus-summary-next-unread-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2710 gnus-summary-kill-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2711 gnus-summary-kill-same-subject-and-select |
257 | 2712 )) |
2713 ;; Ignore characters typed ahead. | |
2714 (not (input-pending-p)) | |
2715 ))) | |
7974
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2716 ;; Keep just the event type of CMD. |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2717 (if (listp cmd) |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2718 (setq cmd (car cmd))) |
257 | 2719 (message "No more%s articles%s" |
2720 (if unread " unread" "") | |
2721 (if (and auto-select | |
2722 (not (eq gnus-auto-select-next 'quietly))) | |
2723 (if group | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2724 (format " (Type %s for %s [%d])" |
7974
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2725 (single-key-description cmd) |
257 | 2726 group |
2727 (nth 1 (gnus-gethash group | |
2728 gnus-unread-hashtb))) | |
2729 (format " (Type %s to exit %s)" | |
7974
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2730 (single-key-description cmd) |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2731 gnus-newsgroup-name)) |
257 | 2732 "")) |
2733 ;; Select next unread newsgroup automagically. | |
2734 (cond ((and auto-select | |
2735 (eq gnus-auto-select-next 'quietly)) | |
2736 ;; Select quietly. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2737 (gnus-summary-next-group nil)) |
257 | 2738 (auto-select |
2739 ;; Confirm auto selection. | |
7974
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2740 (let* ((event (read-event)) |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2741 (type |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2742 (if (listp event) |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2743 (car event) |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2744 event))) |
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2745 (if (eq char type) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2746 (gnus-summary-next-group nil) |
7974
de3b4f95a9db
(gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents:
7793
diff
changeset
|
2747 (setq unread-command-events (list event))))) |
257 | 2748 ) |
2749 )) | |
2750 ))) | |
2751 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2752 (defun gnus-summary-next-unread-article () |
257 | 2753 "Select unread article after current one." |
2754 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2755 (gnus-summary-next-article t (and gnus-auto-select-same |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2756 (gnus-summary-subject-string)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2757 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2758 (defun gnus-summary-prev-article (unread &optional subject) |
257 | 2759 "Select article before current one. |
2760 If argument UNREAD is non-nil, only unread article is selected." | |
2761 (interactive "P") | |
2762 (let ((header nil)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2763 (cond ((gnus-summary-display-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2764 (gnus-summary-search-backward unread subject))) |
257 | 2765 ((and subject |
2766 gnus-auto-select-same | |
2767 (gnus-set-difference gnus-newsgroup-unreads | |
2768 gnus-newsgroup-marked) | |
2769 (memq this-command | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2770 '(gnus-summary-prev-unread-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2771 ;;gnus-summary-prev-page |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2772 ;;gnus-summary-prev-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2773 ;;gnus-summary-prev-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2774 ;;gnus-summary-prev-unread-same-subject |
257 | 2775 ))) |
2776 ;; Ignore given SUBJECT, and try again. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2777 (gnus-summary-prev-article unread nil)) |
257 | 2778 (unread |
2779 (message "No more unread articles")) | |
2780 ((and gnus-auto-extend-newsgroup | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2781 (not subject) ;Only if subject is not specified. |
257 | 2782 (setq header (gnus-more-header-backward))) |
2783 ;; Extend to previous article if possible. | |
2784 ;; Basic ideas by himacdonald@watdragon.waterloo.edu | |
2785 (gnus-extend-newsgroup header t) | |
2786 (let ((buffer-read-only nil)) | |
2787 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2788 (gnus-summary-prepare-threads (list header) 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2789 (gnus-summary-goto-article gnus-newsgroup-begin)) |
257 | 2790 (t |
2791 (message "No more articles")) | |
2792 ))) | |
2793 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2794 (defun gnus-summary-prev-unread-article () |
257 | 2795 "Select unred article before current one." |
2796 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2797 (gnus-summary-prev-article t (and gnus-auto-select-same |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2798 (gnus-summary-subject-string)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2799 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2800 (defun gnus-summary-next-page (lines) |
257 | 2801 "Show next page of selected article. |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
2802 If end of article, select next article. |
257 | 2803 Argument LINES specifies lines to be scrolled up." |
2804 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2805 (let ((article (gnus-summary-article-number)) |
257 | 2806 (endp nil)) |
2807 (if (or (null gnus-current-article) | |
2808 (/= article gnus-current-article)) | |
2809 ;; Selected subject is different from current article's. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2810 (gnus-summary-display-article article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2811 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2812 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2813 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2814 (setq endp (gnus-article-next-page lines))) |
257 | 2815 (cond ((and endp lines) |
2816 (message "End of message")) | |
2817 ((and endp (null lines)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2818 (gnus-summary-next-unread-article))) |
257 | 2819 ))) |
2820 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2821 (defun gnus-summary-prev-page (lines) |
257 | 2822 "Show previous page of selected article. |
2823 Argument LINES specifies lines to be scrolled down." | |
2824 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2825 (let ((article (gnus-summary-article-number))) |
257 | 2826 (if (or (null gnus-current-article) |
2827 (/= article gnus-current-article)) | |
2828 ;; Selected subject is different from current article's. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2829 (gnus-summary-display-article article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2830 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2831 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2832 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2833 (gnus-article-prev-page lines)) |
257 | 2834 ))) |
2835 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2836 (defun gnus-summary-scroll-up (lines) |
257 | 2837 "Scroll up (or down) one line current article. |
2838 Argument LINES specifies lines to be scrolled up (or down if negative)." | |
2839 (interactive "p") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2840 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2841 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2842 (cond ((> lines 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2843 (if (gnus-article-next-page lines) |
257 | 2844 (message "End of message"))) |
2845 ((< lines 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2846 (gnus-article-prev-page (- 0 lines)))) |
257 | 2847 )) |
2848 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2849 (defun gnus-summary-next-same-subject () |
257 | 2850 "Select next article which has the same subject as current one." |
2851 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2852 (gnus-summary-next-article nil (gnus-summary-subject-string))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2853 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2854 (defun gnus-summary-prev-same-subject () |
257 | 2855 "Select previous article which has the same subject as current one." |
2856 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2857 (gnus-summary-prev-article nil (gnus-summary-subject-string))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2858 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2859 (defun gnus-summary-next-unread-same-subject () |
257 | 2860 "Select next unread article which has the same subject as current one." |
2861 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2862 (gnus-summary-next-article t (gnus-summary-subject-string))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2863 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2864 (defun gnus-summary-prev-unread-same-subject () |
257 | 2865 "Select previous unread article which has the same subject as current one." |
2866 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2867 (gnus-summary-prev-article t (gnus-summary-subject-string))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2868 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2869 (defun gnus-summary-refer-parent-article (child) |
257 | 2870 "Refer parent article of current article. |
2871 If a prefix argument CHILD is non-nil, go back to the child article | |
2872 using internally maintained articles history. | |
2873 NOTE: This command may not work with nnspool.el." | |
2874 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2875 (gnus-summary-select-article t t) ;Request all headers. |
257 | 2876 (let ((referenced-id nil)) ;Message-id of parent or child article. |
2877 (if child | |
2878 ;; Go back to child article using history. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2879 (gnus-summary-refer-article nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2880 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2881 ;; Look for parent Message-ID. |
2882 ;; We cannot use gnus-current-headers to get references | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
2883 ;; because we may be looking at parent or referred article. |
257 | 2884 (let ((references (gnus-fetch-field "References"))) |
2885 ;; Get the last message-id in the references. | |
2886 (and references | |
2887 (string-match "\\(<[^<>]+>\\)[^>]*\\'" references) | |
2888 (setq referenced-id | |
2889 (substring references | |
2890 (match-beginning 1) (match-end 1)))) | |
2891 )) | |
2892 (if (stringp referenced-id) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2893 (gnus-summary-refer-article referenced-id) |
257 | 2894 (error "No more parents")) |
2895 ))) | |
2896 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2897 (defun gnus-summary-refer-article (message-id) |
257 | 2898 "Refer article specified by MESSAGE-ID. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2899 If the MESSAGE-ID is nil or an empty string, Message-ID is poped from |
257 | 2900 internally maintained articles history. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2901 NOTE: This command may not work with nnspool.el nor mhspool.el." |
257 | 2902 (interactive "sMessage-ID: ") |
2903 ;; Make sure that this command depends on the fact that article | |
2904 ;; related information is not updated when an article is retrieved | |
2905 ;; by Message-ID. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2906 (gnus-summary-select-article t t) ;Request all headers. |
257 | 2907 (if (and (stringp message-id) |
2908 (> (length message-id) 0)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2909 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2910 ;; Construct the correct Message-ID if necessary. |
2911 ;; Suggested by tale@pawl.rpi.edu. | |
2912 (or (string-match "^<" message-id) | |
2913 (setq message-id (concat "<" message-id))) | |
2914 (or (string-match ">$" message-id) | |
2915 (setq message-id (concat message-id ">"))) | |
2916 ;; Push current message-id on history. | |
2917 ;; We cannot use gnus-current-headers to get current | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
2918 ;; message-id because we may be looking at parent or referred |
257 | 2919 ;; article. |
2920 (let ((current (gnus-fetch-field "Message-ID"))) | |
2921 (or (equal current message-id) ;Nothing to do. | |
2922 (equal current (car gnus-current-history)) | |
2923 (setq gnus-current-history | |
2924 (cons current gnus-current-history))) | |
2925 )) | |
2926 ;; Pop message-id from history. | |
2927 (setq message-id (car gnus-current-history)) | |
2928 (setq gnus-current-history (cdr gnus-current-history))) | |
2929 (if (stringp message-id) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2930 ;; Retrieve article by message-id. This may not work with |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2931 ;; nnspool nor mhspool. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2932 (gnus-article-prepare message-id t) |
257 | 2933 (error "No such references")) |
2934 ) | |
2935 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2936 (defun gnus-summary-next-digest (nth) |
257 | 2937 "Move to head of NTH next digested message." |
2938 (interactive "p") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2939 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2940 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2941 (gnus-article-next-digest (or nth 1)) |
257 | 2942 )) |
2943 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2944 (defun gnus-summary-prev-digest (nth) |
257 | 2945 "Move to head of NTH previous digested message." |
2946 (interactive "p") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2947 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2948 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2949 (gnus-article-prev-digest (or nth 1)) |
257 | 2950 )) |
2951 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2952 (defun gnus-summary-first-unread-article () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2953 "Select first unread article. Return non-nil if successfully selected." |
257 | 2954 (interactive) |
2955 (let ((begin (point))) | |
2956 (goto-char (point-min)) | |
2957 (if (re-search-forward "^ [ \t]+[0-9]+:" nil t) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2958 (gnus-summary-display-article (gnus-summary-article-number)) |
257 | 2959 ;; If there is no unread articles, stay there. |
2960 (goto-char begin) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2961 ;;(gnus-summary-display-article (gnus-summary-article-number)) |
257 | 2962 (message "No more unread articles") |
2963 nil | |
2964 ) | |
2965 )) | |
2966 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2967 (defun gnus-summary-isearch-article () |
257 | 2968 "Do incremental search forward on current article." |
2969 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2970 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2971 (gnus-eval-in-buffer-window gnus-article-buffer |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
2972 (isearch-forward))) |
257 | 2973 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2974 (defun gnus-summary-search-article-forward (regexp) |
257 | 2975 "Search for an article containing REGEXP forward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2976 gnus-select-article-hook is not called during the search." |
257 | 2977 (interactive |
2978 (list (read-string | |
2979 (concat "Search forward (regexp): " | |
2980 (if gnus-last-search-regexp | |
2981 (concat "(default " gnus-last-search-regexp ") ")))))) | |
2982 (if (string-equal regexp "") | |
2983 (setq regexp (or gnus-last-search-regexp "")) | |
2984 (setq gnus-last-search-regexp regexp)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2985 (if (gnus-summary-search-article regexp nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2986 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2987 (recenter 0) |
2988 ;;(sit-for 1) | |
2989 ) | |
2990 (error "Search failed: \"%s\"" regexp) | |
2991 )) | |
2992 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2993 (defun gnus-summary-search-article-backward (regexp) |
257 | 2994 "Search for an article containing REGEXP backward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2995 gnus-select-article-hook is not called during the search." |
257 | 2996 (interactive |
2997 (list (read-string | |
2998 (concat "Search backward (regexp): " | |
2999 (if gnus-last-search-regexp | |
3000 (concat "(default " gnus-last-search-regexp ") ")))))) | |
3001 (if (string-equal regexp "") | |
3002 (setq regexp (or gnus-last-search-regexp "")) | |
3003 (setq gnus-last-search-regexp regexp)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3004 (if (gnus-summary-search-article regexp t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3005 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3006 (recenter 0) |
3007 ;;(sit-for 1) | |
3008 ) | |
3009 (error "Search failed: \"%s\"" regexp) | |
3010 )) | |
3011 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3012 (defun gnus-summary-search-article (regexp &optional backward) |
257 | 3013 "Search for an article containing REGEXP. |
3014 Optional argument BACKWARD means do search for backward. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3015 gnus-select-article-hook is not called during the search." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3016 (let ((gnus-select-article-hook nil) ;Disable hook. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3017 (gnus-mark-article-hook nil) ;Inhibit marking as read. |
257 | 3018 (re-search |
3019 (if backward | |
3020 (function re-search-backward) (function re-search-forward))) | |
3021 (found nil) | |
3022 (last nil)) | |
3023 ;; Hidden thread subtrees must be searched for ,too. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3024 (gnus-summary-show-all-threads) |
257 | 3025 ;; First of all, search current article. |
3026 ;; We don't want to read article again from NNTP server nor reset | |
3027 ;; current point. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3028 (gnus-summary-select-article) |
257 | 3029 (message "Searching article: %d..." gnus-current-article) |
3030 (setq last gnus-current-article) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3031 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3032 (save-restriction |
3033 (widen) | |
3034 ;; Begin search from current point. | |
3035 (setq found (funcall re-search regexp nil t)))) | |
3036 ;; Then search next articles. | |
3037 (while (and (not found) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3038 (gnus-summary-display-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3039 (gnus-summary-search-subject backward nil nil))) |
257 | 3040 (message "Searching article: %d..." gnus-current-article) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3041 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3042 (save-restriction |
3043 (widen) | |
3044 (goto-char (if backward (point-max) (point-min))) | |
3045 (setq found (funcall re-search regexp nil t))) | |
3046 )) | |
3047 (message "") | |
3048 ;; Adjust article pointer. | |
3049 (or (eq last gnus-current-article) | |
3050 (setq gnus-last-article last)) | |
3051 ;; Return T if found such article. | |
3052 found | |
3053 )) | |
3054 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3055 (defun gnus-summary-execute-command (field regexp command &optional backward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3056 "If FIELD of article header matches REGEXP, execute a COMMAND string. |
257 | 3057 If FIELD is an empty string (or nil), entire article body is searched for. |
3058 If optional (prefix) argument BACKWARD is non-nil, do backward instead." | |
3059 (interactive | |
3060 (list (let ((completion-ignore-case t)) | |
3061 (completing-read "Field name: " | |
3062 '(("Number")("Subject")("From") | |
3063 ("Lines")("Date")("Id") | |
3064 ("Xref")("References")) | |
3065 nil 'require-match)) | |
3066 (read-string "Regexp: ") | |
3067 (read-key-sequence "Command: ") | |
3068 current-prefix-arg)) | |
3069 ;; Hidden thread subtrees must be searched for ,too. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3070 (gnus-summary-show-all-threads) |
257 | 3071 ;; We don't want to change current point nor window configuration. |
3072 (save-excursion | |
3073 (save-window-excursion | |
3074 (message "Executing %s..." (key-description command)) | |
3075 ;; We'd like to execute COMMAND interactively so as to give arguments. | |
3076 (gnus-execute field regexp | |
3077 (` (lambda () | |
3078 (call-interactively '(, (key-binding command))))) | |
3079 backward) | |
3080 (message "Executing %s... done" (key-description command))))) | |
3081 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3082 (defun gnus-summary-beginning-of-article () |
257 | 3083 "Go to beginning of article body" |
3084 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3085 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3086 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3087 (widen) |
3088 (beginning-of-buffer) | |
3089 (if gnus-break-pages | |
3090 (gnus-narrow-to-page)) | |
3091 )) | |
3092 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3093 (defun gnus-summary-end-of-article () |
257 | 3094 "Go to end of article body" |
3095 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3096 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3097 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3098 (widen) |
3099 (end-of-buffer) | |
3100 (if gnus-break-pages | |
3101 (gnus-narrow-to-page)) | |
3102 )) | |
3103 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3104 (defun gnus-summary-goto-article (article &optional all-headers) |
257 | 3105 "Read ARTICLE if exists. |
3106 Optional argument ALL-HEADERS means all headers are shown." | |
3107 (interactive | |
3108 (list | |
3109 (string-to-int | |
3110 (completing-read "Article number: " | |
3111 (mapcar | |
3112 (function | |
3113 (lambda (headers) | |
3114 (list | |
3115 (int-to-string (nntp-header-number headers))))) | |
3116 gnus-newsgroup-headers) | |
3117 nil 'require-match)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3118 (if (gnus-summary-goto-subject article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3119 (gnus-summary-display-article article all-headers))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3120 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3121 (defun gnus-summary-goto-last-article () |
257 | 3122 "Go to last subject line." |
3123 (interactive) | |
3124 (if gnus-last-article | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3125 (gnus-summary-goto-article gnus-last-article))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3126 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3127 (defun gnus-summary-show-article () |
257 | 3128 "Force to show current article." |
3129 (interactive) | |
3130 ;; The following is a trick to force to read the current article again. | |
3131 (setq gnus-have-all-headers (not gnus-have-all-headers)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3132 (gnus-summary-select-article (not gnus-have-all-headers) t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3133 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3134 (defun gnus-summary-toggle-header (arg) |
257 | 3135 "Show original header if pruned header currently shown, or vice versa. |
3136 With arg, show original header iff arg is positive." | |
3137 (interactive "P") | |
3138 ;; Variable gnus-show-all-headers must be NIL to toggle really. | |
3139 (let ((gnus-show-all-headers nil) | |
3140 (all-headers | |
3141 (if (null arg) (not gnus-have-all-headers) | |
3142 (> (prefix-numeric-value arg) 0)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3143 (gnus-summary-select-article all-headers t))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3144 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3145 (defun gnus-summary-show-all-headers () |
257 | 3146 "Show original article header." |
3147 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3148 (gnus-summary-select-article t t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3149 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3150 (defun gnus-summary-toggle-mime (arg) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3151 "Toggle MIME processing. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3152 With arg, turn MIME processing on iff arg is positive." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3153 (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3154 (setq gnus-show-mime |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3155 (if (null arg) (not gnus-show-mime) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3156 (> (prefix-numeric-value arg) 0))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3157 ;; The following is a trick to force to read the current article again. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3158 (setq gnus-have-all-headers (not gnus-have-all-headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3159 (gnus-summary-select-article (not gnus-have-all-headers) t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3160 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3161 (defun gnus-summary-stop-page-breaking () |
257 | 3162 "Stop page breaking by linefeed temporary (Widen article buffer)." |
3163 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3164 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3165 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3166 (widen) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3167 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3168 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3169 (defun gnus-summary-kill-same-subject-and-select (unmark) |
257 | 3170 "Mark articles which has the same subject as read, and then select next. |
3171 If argument UNMARK is positive, remove any kinds of marks. | |
3172 If argument UNMARK is negative, mark articles as unread instead." | |
3173 (interactive "P") | |
3174 (if unmark | |
3175 (setq unmark (prefix-numeric-value unmark))) | |
3176 (let ((count | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3177 (gnus-summary-mark-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3178 (gnus-summary-subject-string) unmark))) |
257 | 3179 ;; Select next unread article. If auto-select-same mode, should |
3180 ;; select the first unread article. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3181 (gnus-summary-next-article t (and gnus-auto-select-same |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3182 (gnus-summary-subject-string))) |
257 | 3183 (message "%d articles are marked as %s" |
3184 count (if unmark "unread" "read")) | |
3185 )) | |
3186 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3187 (defun gnus-summary-kill-same-subject (unmark) |
257 | 3188 "Mark articles which has the same subject as read. |
3189 If argument UNMARK is positive, remove any kinds of marks. | |
3190 If argument UNMARK is negative, mark articles as unread instead." | |
3191 (interactive "P") | |
3192 (if unmark | |
3193 (setq unmark (prefix-numeric-value unmark))) | |
3194 (let ((count | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3195 (gnus-summary-mark-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3196 (gnus-summary-subject-string) unmark))) |
257 | 3197 ;; If marked as read, go to next unread subject. |
3198 (if (null unmark) | |
3199 ;; Go to next unread subject. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3200 (gnus-summary-next-subject 1 t)) |
257 | 3201 (message "%d articles are marked as %s" |
3202 count (if unmark "unread" "read")) | |
3203 )) | |
3204 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3205 (defun gnus-summary-mark-same-subject (subject &optional unmark) |
257 | 3206 "Mark articles with same SUBJECT as read, and return marked number. |
3207 If optional argument UNMARK is positive, remove any kinds of marks. | |
3208 If optional argument UNMARK is negative, mark articles as unread instead." | |
3209 (let ((count 1)) | |
3210 (save-excursion | |
3211 (cond ((null unmark) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3212 (gnus-summary-mark-as-read nil "K")) |
257 | 3213 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3214 (gnus-summary-mark-as-unread nil t)) |
257 | 3215 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3216 (gnus-summary-mark-as-unread))) |
257 | 3217 (while (and subject |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3218 (gnus-summary-search-forward nil subject)) |
257 | 3219 (cond ((null unmark) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3220 (gnus-summary-mark-as-read nil "K")) |
257 | 3221 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3222 (gnus-summary-mark-as-unread nil t)) |
257 | 3223 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3224 (gnus-summary-mark-as-unread))) |
257 | 3225 (setq count (1+ count)) |
3226 )) | |
3227 ;; Hide killed thread subtrees. Does not work properly always. | |
3228 ;;(and (null unmark) | |
3229 ;; gnus-thread-hide-killed | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3230 ;; (gnus-summary-hide-thread)) |
257 | 3231 ;; Return number of articles marked as read. |
3232 count | |
3233 )) | |
3234 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3235 (defun gnus-summary-mark-as-unread-forward (count) |
257 | 3236 "Mark current article as unread, and then go forward. |
3237 Argument COUNT specifies number of articles marked as unread." | |
3238 (interactive "p") | |
3239 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3240 (gnus-summary-mark-as-unread nil nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3241 (gnus-summary-next-subject 1 nil) |
257 | 3242 (setq count (1- count)))) |
3243 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3244 (defun gnus-summary-mark-as-unread-backward (count) |
257 | 3245 "Mark current article as unread, and then go backward. |
3246 Argument COUNT specifies number of articles marked as unread." | |
3247 (interactive "p") | |
3248 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3249 (gnus-summary-mark-as-unread nil nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3250 (gnus-summary-prev-subject 1 nil) |
257 | 3251 (setq count (1- count)))) |
3252 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3253 (defun gnus-summary-mark-as-unread (&optional article clear-mark) |
257 | 3254 "Mark current article as unread. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3255 Optional 1st argument ARTICLE specifies article number to be marked as unread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3256 Optional 2nd argument CLEAR-MARK remove any kinds of mark." |
257 | 3257 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3258 (set-buffer gnus-summary-buffer) |
257 | 3259 ;; First of all, show hidden thread subtrees. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3260 (gnus-summary-show-thread) |
257 | 3261 (let* ((buffer-read-only nil) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3262 (current (gnus-summary-article-number)) |
257 | 3263 (article (or article current))) |
3264 (gnus-mark-article-as-unread article clear-mark) | |
3265 (if (or (eq article current) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3266 (gnus-summary-goto-subject article)) |
257 | 3267 (progn |
3268 (beginning-of-line) | |
3269 (delete-char 1) | |
3270 (insert (if clear-mark " " "-")))) | |
3271 ))) | |
3272 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3273 (defun gnus-summary-mark-as-read-forward (count) |
257 | 3274 "Mark current article as read, and then go forward. |
3275 Argument COUNT specifies number of articles marked as read" | |
3276 (interactive "p") | |
3277 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3278 (gnus-summary-mark-as-read) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3279 (gnus-summary-next-subject 1 'unread-only) |
257 | 3280 (setq count (1- count)))) |
3281 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3282 (defun gnus-summary-mark-as-read-backward (count) |
257 | 3283 "Mark current article as read, and then go backward. |
3284 Argument COUNT specifies number of articles marked as read" | |
3285 (interactive "p") | |
3286 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3287 (gnus-summary-mark-as-read) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3288 (gnus-summary-prev-subject 1 'unread-only) |
257 | 3289 (setq count (1- count)))) |
3290 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3291 (defun gnus-summary-mark-as-read (&optional article mark) |
257 | 3292 "Mark current article as read. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3293 Optional 1st argument ARTICLE specifies article number to be marked as read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3294 Optional 2nd argument MARK specifies a string inserted at beginning of line. |
257 | 3295 Any kind of string (length 1) except for a space and `-' is ok." |
3296 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3297 (set-buffer gnus-summary-buffer) |
257 | 3298 ;; First of all, show hidden thread subtrees. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3299 (gnus-summary-show-thread) |
257 | 3300 (let* ((buffer-read-only nil) |
3301 (mark (or mark "D")) ;Default mark is `D'. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3302 (current (gnus-summary-article-number)) |
257 | 3303 (article (or article current))) |
3304 (gnus-mark-article-as-read article) | |
3305 (if (or (eq article current) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3306 (gnus-summary-goto-subject article)) |
257 | 3307 (progn |
3308 (beginning-of-line) | |
3309 (delete-char 1) | |
3310 (insert mark))) | |
3311 ))) | |
3312 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3313 (defun gnus-summary-clear-mark-forward (count) |
257 | 3314 "Remove current article's mark, and go forward. |
3315 Argument COUNT specifies number of articles unmarked" | |
3316 (interactive "p") | |
3317 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3318 (gnus-summary-mark-as-unread nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3319 (gnus-summary-next-subject 1 nil) |
257 | 3320 (setq count (1- count)))) |
3321 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3322 (defun gnus-summary-clear-mark-backward (count) |
257 | 3323 "Remove current article's mark, and go backward. |
3324 Argument COUNT specifies number of articles unmarked" | |
3325 (interactive "p") | |
3326 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3327 (gnus-summary-mark-as-unread nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3328 (gnus-summary-prev-subject 1 nil) |
257 | 3329 (setq count (1- count)))) |
3330 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3331 (defun gnus-summary-delete-marked-as-read () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3332 "Delete lines which is marked as read." |
257 | 3333 (interactive) |
3334 (if gnus-newsgroup-unreads | |
3335 (let ((buffer-read-only nil)) | |
3336 (save-excursion | |
3337 (goto-char (point-min)) | |
6309
9217f29851c2
Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents:
5911
diff
changeset
|
3338 (delete-non-matching-lines "^[- ]")) |
257 | 3339 ;; Adjust point. |
3340 (if (eobp) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3341 (gnus-summary-prev-subject 1) |
257 | 3342 (beginning-of-line) |
3343 (search-forward ":" nil t))) | |
3344 ;; It is not so good idea to make the buffer empty. | |
3345 (message "All articles are marked as read") | |
3346 )) | |
3347 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3348 (defun gnus-summary-delete-marked-with (marks) |
257 | 3349 "Delete lines which are marked with MARKS (e.g. \"DK\")." |
3350 (interactive "sMarks: ") | |
3351 (let ((buffer-read-only nil)) | |
3352 (save-excursion | |
3353 (goto-char (point-min)) | |
3354 (delete-matching-lines (concat "^[" marks "]"))) | |
3355 ;; Adjust point. | |
3356 (or (zerop (buffer-size)) | |
3357 (if (eobp) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3358 (gnus-summary-prev-subject 1) |
257 | 3359 (beginning-of-line) |
3360 (search-forward ":" nil t))) | |
3361 )) | |
3362 | |
3363 ;; Thread-based commands. | |
3364 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3365 (defun gnus-summary-toggle-threads (arg) |
257 | 3366 "Toggle showing conversation threads. |
3367 With arg, turn showing conversation threads on iff arg is positive." | |
3368 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3369 (let ((current (gnus-summary-article-number))) |
257 | 3370 (setq gnus-show-threads |
3371 (if (null arg) (not gnus-show-threads) | |
3372 (> (prefix-numeric-value arg) 0))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3373 (gnus-summary-prepare) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3374 (gnus-summary-goto-subject current) |
257 | 3375 )) |
3376 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3377 (defun gnus-summary-show-all-threads () |
257 | 3378 "Show all thread subtrees." |
3379 (interactive) | |
3380 (if gnus-show-threads | |
3381 (save-excursion | |
3382 (let ((buffer-read-only nil)) | |
3383 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t) | |
3384 )))) | |
3385 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3386 (defun gnus-summary-show-thread () |
257 | 3387 "Show thread subtrees." |
3388 (interactive) | |
3389 (if gnus-show-threads | |
3390 (save-excursion | |
3391 (let ((buffer-read-only nil)) | |
3392 (subst-char-in-region (progn | |
3393 (beginning-of-line) (point)) | |
3394 (progn | |
3395 (end-of-line) (point)) | |
3396 ?\^M ?\n t) | |
3397 )))) | |
3398 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3399 (defun gnus-summary-hide-all-threads () |
257 | 3400 "Hide all thread subtrees." |
3401 (interactive) | |
3402 (if gnus-show-threads | |
3403 (save-excursion | |
3404 ;; Adjust cursor point. | |
3405 (goto-char (point-min)) | |
3406 (search-forward ":" nil t) | |
3407 (let ((level (current-column))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3408 (gnus-summary-hide-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3409 (while (gnus-summary-search-forward) |
257 | 3410 (and (>= level (current-column)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3411 (gnus-summary-hide-thread))) |
257 | 3412 )))) |
3413 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3414 (defun gnus-summary-hide-thread () |
257 | 3415 "Hide thread subtrees." |
3416 (interactive) | |
3417 (if gnus-show-threads | |
3418 (save-excursion | |
3419 ;; Adjust cursor point. | |
3420 (beginning-of-line) | |
3421 (search-forward ":" nil t) | |
3422 (let ((buffer-read-only nil) | |
3423 (init (point)) | |
3424 (last (point)) | |
3425 (level (current-column))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3426 (while (and (gnus-summary-search-forward) |
257 | 3427 (< level (current-column))) |
3428 ;; Interested in lower levels. | |
3429 (if (< level (current-column)) | |
3430 (progn | |
3431 (setq last (point)) | |
3432 )) | |
3433 ) | |
3434 (subst-char-in-region init last ?\n ?\^M t) | |
3435 )))) | |
3436 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3437 (defun gnus-summary-next-thread (n) |
257 | 3438 "Go to the same level next thread. |
3439 Argument N specifies the number of threads." | |
3440 (interactive "p") | |
3441 ;; Adjust cursor point. | |
3442 (beginning-of-line) | |
3443 (search-forward ":" nil t) | |
3444 (let ((init (point)) | |
3445 (last (point)) | |
3446 (level (current-column))) | |
3447 (while (and (> n 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3448 (gnus-summary-search-forward) |
257 | 3449 (<= level (current-column))) |
3450 ;; We have to skip lower levels. | |
3451 (if (= level (current-column)) | |
3452 (progn | |
3453 (setq last (point)) | |
3454 (setq n (1- n)) | |
3455 )) | |
3456 ) | |
3457 ;; Return non-nil if successfully move to the next. | |
3458 (prog1 (not (= init last)) | |
3459 (goto-char last)) | |
3460 )) | |
3461 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3462 (defun gnus-summary-prev-thread (n) |
257 | 3463 "Go to the same level previous thread. |
3464 Argument N specifies the number of threads." | |
3465 (interactive "p") | |
3466 ;; Adjust cursor point. | |
3467 (beginning-of-line) | |
3468 (search-forward ":" nil t) | |
3469 (let ((init (point)) | |
3470 (last (point)) | |
3471 (level (current-column))) | |
3472 (while (and (> n 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3473 (gnus-summary-search-backward) |
257 | 3474 (<= level (current-column))) |
3475 ;; We have to skip lower levels. | |
3476 (if (= level (current-column)) | |
3477 (progn | |
3478 (setq last (point)) | |
3479 (setq n (1- n)) | |
3480 )) | |
3481 ) | |
3482 ;; Return non-nil if successfully move to the previous. | |
3483 (prog1 (not (= init last)) | |
3484 (goto-char last)) | |
3485 )) | |
3486 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3487 (defun gnus-summary-down-thread (d) |
257 | 3488 "Go downward current thread. |
3489 Argument D specifies the depth goes down." | |
3490 (interactive "p") | |
3491 ;; Adjust cursor point. | |
3492 (beginning-of-line) | |
3493 (search-forward ":" nil t) | |
3494 (let ((last (point)) | |
3495 (level (current-column))) | |
3496 (while (and (> d 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3497 (gnus-summary-search-forward) |
257 | 3498 (<= level (current-column))) ;<= can be <. Which do you like? |
3499 ;; We have to skip the same levels. | |
3500 (if (< level (current-column)) | |
3501 (progn | |
3502 (setq last (point)) | |
3503 (setq level (current-column)) | |
3504 (setq d (1- d)) | |
3505 )) | |
3506 ) | |
3507 (goto-char last) | |
3508 )) | |
3509 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3510 (defun gnus-summary-up-thread (d) |
257 | 3511 "Go upward current thread. |
3512 Argument D specifies the depth goes up." | |
3513 (interactive "p") | |
3514 ;; Adjust cursor point. | |
3515 (beginning-of-line) | |
3516 (search-forward ":" nil t) | |
3517 (let ((last (point)) | |
3518 (level (current-column))) | |
3519 (while (and (> d 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3520 (gnus-summary-search-backward)) |
257 | 3521 ;; We have to skip the same levels. |
3522 (if (> level (current-column)) | |
3523 (progn | |
3524 (setq last (point)) | |
3525 (setq level (current-column)) | |
3526 (setq d (1- d)) | |
3527 )) | |
3528 ) | |
3529 (goto-char last) | |
3530 )) | |
3531 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3532 (defun gnus-summary-kill-thread (unmark) |
257 | 3533 "Mark articles under current thread as read. |
3534 If argument UNMARK is positive, remove any kinds of marks. | |
3535 If argument UNMARK is negative, mark articles as unread instead." | |
3536 (interactive "P") | |
3537 (if unmark | |
3538 (setq unmark (prefix-numeric-value unmark))) | |
3539 ;; Adjust cursor point. | |
3540 (beginning-of-line) | |
3541 (search-forward ":" nil t) | |
3542 (save-excursion | |
3543 (let ((level (current-column))) | |
3544 ;; Mark current article. | |
3545 (cond ((null unmark) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3546 (gnus-summary-mark-as-read nil "K")) |
257 | 3547 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3548 (gnus-summary-mark-as-unread nil t)) |
257 | 3549 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3550 (gnus-summary-mark-as-unread)) |
257 | 3551 ) |
3552 ;; Mark following articles. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3553 (while (and (gnus-summary-search-forward) |
257 | 3554 (< level (current-column))) |
3555 (cond ((null unmark) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3556 (gnus-summary-mark-as-read nil "K")) |
257 | 3557 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3558 (gnus-summary-mark-as-unread nil t)) |
257 | 3559 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3560 (gnus-summary-mark-as-unread)) |
257 | 3561 )) |
3562 )) | |
3563 ;; Hide killed subtrees. | |
3564 (and (null unmark) | |
3565 gnus-thread-hide-killed | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3566 (gnus-summary-hide-thread)) |
257 | 3567 ;; If marked as read, go to next unread subject. |
3568 (if (null unmark) | |
3569 ;; Go to next unread subject. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3570 (gnus-summary-next-subject 1 t)) |
257 | 3571 ) |
3572 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3573 (defun gnus-summary-toggle-truncation (arg) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3574 "Toggle truncation of summary lines. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3575 With arg, turn line truncation on iff arg is positive." |
257 | 3576 (interactive "P") |
3577 (setq truncate-lines | |
3578 (if (null arg) (not truncate-lines) | |
3579 (> (prefix-numeric-value arg) 0))) | |
3580 (redraw-display)) | |
3581 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3582 (defun gnus-summary-sort-by-number (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3583 "Sort Summary buffer by article number. |
257 | 3584 Argument REVERSE means reverse order." |
3585 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3586 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3587 (function <) |
257 | 3588 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3589 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3590 (nntp-header-number a))) |
257 | 3591 reverse |
3592 )) | |
3593 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3594 (defun gnus-summary-sort-by-author (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3595 "Sort Summary buffer by author name alphabetically. |
257 | 3596 If case-fold-search is non-nil, case of letters is ignored. |
3597 Argument REVERSE means reverse order." | |
3598 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3599 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3600 (function string-lessp) |
257 | 3601 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3602 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3603 (if case-fold-search |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3604 (downcase (nntp-header-from a)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3605 (nntp-header-from a)))) |
257 | 3606 reverse |
3607 )) | |
3608 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3609 (defun gnus-summary-sort-by-subject (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3610 "Sort Summary buffer by subject alphabetically. `Re:'s are ignored. |
257 | 3611 If case-fold-search is non-nil, case of letters is ignored. |
3612 Argument REVERSE means reverse order." | |
3613 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3614 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3615 (function string-lessp) |
257 | 3616 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3617 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3618 (if case-fold-search |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3619 (downcase (gnus-simplify-subject (nntp-header-subject a) 're-only)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3620 (gnus-simplify-subject (nntp-header-subject a) 're-only)))) |
257 | 3621 reverse |
3622 )) | |
3623 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3624 (defun gnus-summary-sort-by-date (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3625 "Sort Summary buffer by date. |
257 | 3626 Argument REVERSE means reverse order." |
3627 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3628 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3629 (function string-lessp) |
257 | 3630 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3631 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3632 (gnus-sortable-date (nntp-header-date a)))) |
257 | 3633 reverse |
3634 )) | |
3635 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3636 (defun gnus-summary-keysort-summary (predicate key &optional reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3637 "Sort Summary buffer by PREDICATE using a value passed by KEY. |
257 | 3638 Optional argument REVERSE means reverse order." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3639 (let ((current (gnus-summary-article-number))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3640 (gnus-keysort-headers predicate key reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3641 (gnus-summary-prepare) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3642 (gnus-summary-goto-subject current) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3643 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3644 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3645 (defun gnus-summary-sort-summary (predicate &optional reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3646 "Sort Summary buffer by PREDICATE. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3647 Optional argument REVERSE means reverse order." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3648 (let ((current (gnus-summary-article-number))) |
257 | 3649 (gnus-sort-headers predicate reverse) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3650 (gnus-summary-prepare) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3651 (gnus-summary-goto-subject current) |
257 | 3652 )) |
3653 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3654 (defun gnus-summary-reselect-current-group (show-all) |
257 | 3655 "Once exit and then reselect the current newsgroup. |
3656 Prefix argument SHOW-ALL means to select all articles." | |
3657 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3658 (let ((current-subject (gnus-summary-article-number))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3659 (gnus-summary-exit t) |
257 | 3660 ;; We have to adjust the point of Group mode buffer because the |
3661 ;; current point was moved to the next unread newsgroup by | |
3662 ;; exiting. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3663 (gnus-summary-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3664 (gnus-group-read-group show-all t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3665 (gnus-summary-goto-subject current-subject) |
257 | 3666 )) |
3667 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3668 (defun gnus-summary-caesar-message (rotnum) |
257 | 3669 "Caesar rotates all letters of current message by 13/47 places. |
3670 With prefix arg, specifies the number of places to rotate each letter forward. | |
3671 Caesar rotates Japanese letters by 47 places in any case." | |
3672 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3673 (gnus-summary-select-article) |
257 | 3674 (gnus-overload-functions) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3675 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3676 (save-restriction |
3677 (widen) | |
3678 ;; We don't want to jump to the beginning of the message. | |
3679 ;; `save-excursion' does not do its job. | |
3680 (move-to-window-line 0) | |
3681 (let ((last (point))) | |
3682 (news-caesar-buffer-body rotnum) | |
3683 (goto-char last) | |
3684 (recenter 0) | |
3685 )) | |
3686 )) | |
3687 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3688 (defun gnus-summary-rmail-digest () |
257 | 3689 "Run RMAIL on current digest article. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3690 gnus-select-digest-hook will be called with no arguments, if that |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3691 value is non-nil. It is possible to modify the article so that Rmail |
257 | 3692 can work with it. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3693 gnus-rmail-digest-hook will be called with no arguments, if that value |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3694 is non-nil. The hook is intended to customize Rmail mode." |
257 | 3695 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3696 (gnus-summary-select-article) |
257 | 3697 (require 'rmail) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3698 (let ((artbuf gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3699 (digbuf (get-buffer-create gnus-digest-buffer)) |
257 | 3700 (mail-header-separator "")) |
3701 (set-buffer digbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3702 (buffer-flush-undo (current-buffer)) |
257 | 3703 (setq buffer-read-only nil) |
3704 (erase-buffer) | |
3705 (insert-buffer-substring artbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3706 (run-hooks 'gnus-select-digest-hook) |
257 | 3707 (gnus-convert-article-to-rmail) |
3708 (goto-char (point-min)) | |
3709 ;; Rmail initializations. | |
3710 (rmail-insert-rmail-file-header) | |
3711 (rmail-mode) | |
3712 (rmail-set-message-counters) | |
3713 (rmail-show-message) | |
3714 (condition-case () | |
3715 (progn | |
3716 (undigestify-rmail-message) | |
3717 (rmail-expunge) ;Delete original message. | |
3718 ;; File name is meaningless but `save-buffer' requires it. | |
3719 (setq buffer-file-name "GNUS Digest") | |
3720 (setq mode-line-buffer-identification | |
3721 (concat "Digest: " | |
3722 (nntp-header-subject gnus-current-headers))) | |
3723 ;; There is no need to write this buffer to a file. | |
3724 (make-local-variable 'write-file-hooks) | |
3725 (setq write-file-hooks | |
3726 (list (function | |
3727 (lambda () | |
3728 (set-buffer-modified-p nil) | |
3729 (message "(No changes need to be saved)") | |
3730 'no-need-to-write-this-buffer)))) | |
3731 ;; Default file name saving digest messages. | |
7560
e63efa2d587c
rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents:
7524
diff
changeset
|
3732 (setq rmail-default-rmail-file |
257 | 3733 (funcall gnus-rmail-save-name |
3734 gnus-newsgroup-name | |
3735 gnus-current-headers | |
3736 gnus-newsgroup-last-rmail | |
3737 )) | |
7560
e63efa2d587c
rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents:
7524
diff
changeset
|
3738 (setq rmail-default-file |
257 | 3739 (funcall gnus-mail-save-name |
3740 gnus-newsgroup-name | |
3741 gnus-current-headers | |
3742 gnus-newsgroup-last-mail | |
3743 )) | |
3744 ;; Prevent generating new buffer named ***<N> each time. | |
3745 (setq rmail-summary-buffer | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3746 (get-buffer-create gnus-digest-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3747 (run-hooks 'gnus-rmail-digest-hook) |
257 | 3748 ;; Take all windows safely. |
3749 (gnus-configure-windows '(1 0 0)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3750 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3751 ;; Use Summary Article windows for Digest summary and |
257 | 3752 ;; Digest buffers. |
3753 (if gnus-digest-show-summary | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3754 (let ((gnus-summary-buffer gnus-digest-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3755 (gnus-article-buffer gnus-digest-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3756 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3757 (pop-to-buffer gnus-digest-buffer) |
257 | 3758 (rmail-summary) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3759 (pop-to-buffer gnus-digest-summary-buffer) |
257 | 3760 (message (substitute-command-keys |
3761 "Type \\[rmail-summary-quit] to return to GNUS"))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3762 (let ((gnus-summary-buffer gnus-digest-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3763 (gnus-configure-windows 'summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3764 (pop-to-buffer gnus-digest-buffer) |
257 | 3765 (message (substitute-command-keys |
3766 "Type \\[rmail-quit] to return to GNUS"))) | |
3767 ) | |
3768 ;; Move the buffers to the end of buffer list. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3769 (bury-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3770 (bury-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3771 (bury-buffer gnus-digest-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3772 (bury-buffer gnus-digest-buffer)) |
257 | 3773 (error (set-buffer-modified-p nil) |
3774 (kill-buffer digbuf) | |
3775 ;; This command should not signal an error because the | |
3776 ;; command is called from hooks. | |
3777 (ding) (message "Article is not a digest"))) | |
3778 )) | |
3779 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3780 (defun gnus-summary-save-article () |
257 | 3781 "Save this article using default saver function. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3782 The variable `gnus-default-article-saver' specifies the saver function." |
257 | 3783 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3784 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers) |
257 | 3785 (if gnus-default-article-saver |
3786 (call-interactively gnus-default-article-saver) | |
3787 (error "No default saver is defined."))) | |
3788 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3789 (defun gnus-summary-save-in-rmail (&optional filename) |
257 | 3790 "Append this article to Rmail file. |
3791 Optional argument FILENAME specifies file name. | |
3792 Directory to save to is default to `gnus-article-save-directory' which | |
3793 is initialized from the SAVEDIR environment variable." | |
3794 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3795 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3796 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3797 (save-excursion |
3798 (save-restriction | |
3799 (widen) | |
3800 (let ((default-name | |
3801 (funcall gnus-rmail-save-name | |
3802 gnus-newsgroup-name | |
3803 gnus-current-headers | |
3804 gnus-newsgroup-last-rmail | |
3805 ))) | |
3806 (or filename | |
3807 (setq filename | |
3808 (read-file-name | |
3809 (concat "Save article in Rmail file: (default " | |
3810 (file-name-nondirectory default-name) | |
3811 ") ") | |
3812 (file-name-directory default-name) | |
3813 default-name))) | |
3814 (gnus-make-directory (file-name-directory filename)) | |
3815 (gnus-output-to-rmail filename) | |
3816 ;; Remember the directory name to save articles. | |
3817 (setq gnus-newsgroup-last-rmail filename) | |
3818 ))) | |
3819 )) | |
3820 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3821 (defun gnus-summary-save-in-mail (&optional filename) |
257 | 3822 "Append this article to Unix mail file. |
3823 Optional argument FILENAME specifies file name. | |
3824 Directory to save to is default to `gnus-article-save-directory' which | |
3825 is initialized from the SAVEDIR environment variable." | |
3826 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3827 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3828 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3829 (save-excursion |
3830 (save-restriction | |
3831 (widen) | |
3832 (let ((default-name | |
3833 (funcall gnus-mail-save-name | |
3834 gnus-newsgroup-name | |
3835 gnus-current-headers | |
3836 gnus-newsgroup-last-mail | |
3837 ))) | |
3838 (or filename | |
3839 (setq filename | |
3840 (read-file-name | |
3841 (concat "Save article in Unix mail file: (default " | |
3842 (file-name-nondirectory default-name) | |
3843 ") ") | |
3844 (file-name-directory default-name) | |
3845 default-name))) | |
5052
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3846 (setq filename |
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3847 (expand-file-name filename |
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3848 (and default-name |
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3849 (file-name-directory default-name)))) |
257 | 3850 (gnus-make-directory (file-name-directory filename)) |
5052
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3851 (if (and (file-readable-p filename) (rmail-file-p filename)) |
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3852 (gnus-output-to-rmail filename) |
5057
d15f5b49f3ea
(gnus-summary-save-in-mail): Use rmail-output
Richard M. Stallman <rms@gnu.org>
parents:
5052
diff
changeset
|
3853 (rmail-output filename 1 t t)) |
257 | 3854 ;; Remember the directory name to save articles. |
3855 (setq gnus-newsgroup-last-mail filename) | |
3856 ))) | |
3857 )) | |
3858 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3859 (defun gnus-summary-save-in-file (&optional filename) |
257 | 3860 "Append this article to file. |
3861 Optional argument FILENAME specifies file name. | |
3862 Directory to save to is default to `gnus-article-save-directory' which | |
3863 is initialized from the SAVEDIR environment variable." | |
3864 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3865 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3866 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3867 (save-excursion |
3868 (save-restriction | |
3869 (widen) | |
3870 (let ((default-name | |
3871 (funcall gnus-file-save-name | |
3872 gnus-newsgroup-name | |
3873 gnus-current-headers | |
3874 gnus-newsgroup-last-file | |
3875 ))) | |
3876 (or filename | |
3877 (setq filename | |
3878 (read-file-name | |
3879 (concat "Save article in file: (default " | |
3880 (file-name-nondirectory default-name) | |
3881 ") ") | |
3882 (file-name-directory default-name) | |
3883 default-name))) | |
3884 (gnus-make-directory (file-name-directory filename)) | |
3885 (gnus-output-to-file filename) | |
3886 ;; Remember the directory name to save articles. | |
3887 (setq gnus-newsgroup-last-file filename) | |
3888 ))) | |
3889 )) | |
3890 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3891 (defun gnus-summary-save-in-folder (&optional folder) |
257 | 3892 "Save this article to MH folder (using `rcvstore' in MH library). |
3893 Optional argument FOLDER specifies folder name." | |
3894 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3895 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3896 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3897 (save-restriction |
3898 (widen) | |
3899 ;; Thanks to yuki@flab.Fujitsu.JUNET and ohm@kaba.junet. | |
3900 (mh-find-path) | |
3901 (let ((folder | |
3902 (or folder | |
3903 (mh-prompt-for-folder "Save article in" | |
3904 (funcall gnus-folder-save-name | |
3905 gnus-newsgroup-name | |
3906 gnus-current-headers | |
3907 gnus-newsgroup-last-folder | |
3908 ) | |
3909 t | |
3910 ))) | |
3911 (errbuf (get-buffer-create " *GNUS rcvstore*"))) | |
3912 (unwind-protect | |
3913 (call-process-region (point-min) (point-max) | |
3914 (expand-file-name "rcvstore" mh-lib) | |
3915 nil errbuf nil folder) | |
3916 (set-buffer errbuf) | |
3917 (if (zerop (buffer-size)) | |
3918 (message "Article saved in folder: %s" folder) | |
3919 (message "%s" (buffer-string))) | |
3920 (kill-buffer errbuf) | |
3921 (setq gnus-newsgroup-last-folder folder)) | |
3922 )) | |
3923 )) | |
3924 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3925 (defun gnus-summary-pipe-output () |
257 | 3926 "Pipe this article to subprocess." |
3927 (interactive) | |
3928 ;; Ignore `gnus-save-all-headers' since this is not save command. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3929 ;;(gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3930 ;; Huuum. Is this right? |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3931 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3932 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3933 (save-restriction |
3934 (widen) | |
3935 (let ((command (read-string "Shell command on article: " | |
3936 gnus-last-shell-command))) | |
3937 (if (string-equal command "") | |
3938 (setq command gnus-last-shell-command)) | |
3939 (shell-command-on-region (point-min) (point-max) command nil) | |
3940 (setq gnus-last-shell-command command) | |
3941 )) | |
3942 )) | |
3943 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3944 (defun gnus-summary-catchup (all &optional quietly) |
257 | 3945 "Mark all articles not marked as unread in this newsgroup as read. |
3946 If prefix argument ALL is non-nil, all articles are marked as read." | |
3947 (interactive "P") | |
3948 (if (or quietly | |
7705
b10cc49f6c37
(gnus-summary-catchup): Check gnus-interactive-catchup.
Richard M. Stallman <rms@gnu.org>
parents:
7639
diff
changeset
|
3949 (not gnus-interactive-catchup) ;Without confirmation? |
257 | 3950 (y-or-n-p |
3951 (if all | |
3952 "Do you really want to mark everything as read? " | |
3953 "Delete all articles not marked as unread? "))) | |
3954 (let ((unmarked | |
3955 (gnus-set-difference gnus-newsgroup-unreads | |
3956 (if (not all) gnus-newsgroup-marked)))) | |
3957 (message "") ;Erase "Yes or No" question. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3958 ;; Hidden thread subtrees must be searched for ,too. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3959 (gnus-summary-show-all-threads) |
257 | 3960 (while unmarked |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3961 (gnus-summary-mark-as-read (car unmarked) "C") |
257 | 3962 (setq unmarked (cdr unmarked)) |
3963 )) | |
3964 )) | |
3965 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3966 (defun gnus-summary-catchup-all (&optional quietly) |
257 | 3967 "Mark all articles in this newsgroup as read." |
3968 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3969 (gnus-summary-catchup t quietly)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3970 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3971 (defun gnus-summary-catchup-and-exit (all &optional quietly) |
257 | 3972 "Mark all articles not marked as unread in this newsgroup as read, then exit. |
3973 If prefix argument ALL is non-nil, all articles are marked as read." | |
3974 (interactive "P") | |
3975 (if (or quietly | |
7705
b10cc49f6c37
(gnus-summary-catchup): Check gnus-interactive-catchup.
Richard M. Stallman <rms@gnu.org>
parents:
7639
diff
changeset
|
3976 (not gnus-interactive-catchup) ;Without confirmation? |
257 | 3977 (y-or-n-p |
3978 (if all | |
3979 "Do you really want to mark everything as read? " | |
3980 "Delete all articles not marked as unread? "))) | |
3981 (let ((unmarked | |
3982 (gnus-set-difference gnus-newsgroup-unreads | |
3983 (if (not all) gnus-newsgroup-marked)))) | |
3984 (message "") ;Erase "Yes or No" question. | |
3985 (while unmarked | |
3986 (gnus-mark-article-as-read (car unmarked)) | |
3987 (setq unmarked (cdr unmarked))) | |
3988 ;; Select next newsgroup or exit. | |
3989 (cond ((eq gnus-auto-select-next 'quietly) | |
3990 ;; Select next newsgroup quietly. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3991 (gnus-summary-next-group nil)) |
257 | 3992 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3993 (gnus-summary-exit))) |
257 | 3994 ))) |
3995 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3996 (defun gnus-summary-catchup-all-and-exit (&optional quietly) |
257 | 3997 "Mark all articles in this newsgroup as read, and then exit." |
3998 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3999 (gnus-summary-catchup-and-exit t quietly)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4000 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4001 (defun gnus-summary-edit-global-kill () |
257 | 4002 "Edit a global KILL file." |
4003 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4004 (setq gnus-current-kill-article (gnus-summary-article-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4005 (gnus-kill-file-edit-file nil) ;Nil stands for global KILL file. |
257 | 4006 (message |
4007 (substitute-command-keys | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4008 "Editing a global KILL file (Type \\[gnus-kill-file-exit] to exit)"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4009 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4010 (defun gnus-summary-edit-local-kill () |
257 | 4011 "Edit a local KILL file applied to the current newsgroup." |
4012 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4013 (setq gnus-current-kill-article (gnus-summary-article-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4014 (gnus-kill-file-edit-file gnus-newsgroup-name) |
257 | 4015 (message |
4016 (substitute-command-keys | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4017 "Editing a local KILL file (Type \\[gnus-kill-file-exit] to exit)"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4018 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4019 (defun gnus-summary-exit (&optional temporary) |
257 | 4020 "Exit reading current newsgroup, and then return to group selection mode. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4021 gnus-exit-group-hook is called with no arguments if that value is non-nil." |
257 | 4022 (interactive) |
4023 (let ((updated nil) | |
4024 (gnus-newsgroup-headers gnus-newsgroup-headers) | |
4025 (gnus-newsgroup-unreads gnus-newsgroup-unreads) | |
4026 (gnus-newsgroup-unselected gnus-newsgroup-unselected) | |
4027 (gnus-newsgroup-marked gnus-newsgroup-marked)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4028 ;; Important internal variables are saved, so we can reenter |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4029 ;; Summary buffer even if hook changes them. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4030 (run-hooks 'gnus-exit-group-hook) |
257 | 4031 (gnus-update-unread-articles gnus-newsgroup-name |
4032 (append gnus-newsgroup-unselected | |
4033 gnus-newsgroup-unreads) | |
4034 gnus-newsgroup-marked) | |
4035 ;; T means ignore unsubscribed newsgroups. | |
4036 (if gnus-use-cross-reference | |
4037 (setq updated | |
4038 (gnus-mark-as-read-by-xref gnus-newsgroup-name | |
4039 gnus-newsgroup-headers | |
4040 gnus-newsgroup-unreads | |
4041 (eq gnus-use-cross-reference t) | |
4042 ))) | |
4043 ;; Do not switch windows but change the buffer to work. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4044 (set-buffer gnus-group-buffer) |
257 | 4045 ;; Update cross referenced group info. |
4046 (while updated | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4047 (gnus-group-update-group (car updated) t) ;Ignore invisible group. |
257 | 4048 (setq updated (cdr updated))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4049 (gnus-group-update-group gnus-newsgroup-name)) |
257 | 4050 ;; Make sure where I was, and go to next newsgroup. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4051 (gnus-group-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4052 (gnus-group-next-unread-group 1) |
257 | 4053 (if temporary |
4054 ;; If exiting temporary, caller should adjust Group mode | |
4055 ;; buffer point by itself. | |
4056 nil ;Nothing to do. | |
4057 ;; Return to Group mode buffer. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4058 (if (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4059 (bury-buffer gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4060 (if (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4061 (bury-buffer gnus-article-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4062 (gnus-configure-windows 'newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4063 (pop-to-buffer gnus-group-buffer))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4064 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4065 (defun gnus-summary-quit () |
257 | 4066 "Quit reading current newsgroup without updating read article info." |
4067 (interactive) | |
4068 (if (y-or-n-p "Do you really wanna quit reading this group? ") | |
4069 (progn | |
4070 (message "") ;Erase "Yes or No" question. | |
4071 ;; Return to Group selection mode. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4072 (if (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4073 (bury-buffer gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4074 (if (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4075 (bury-buffer gnus-article-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4076 (gnus-configure-windows 'newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4077 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4078 (gnus-group-jump-to-group gnus-newsgroup-name) ;Make sure where I was. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4079 (gnus-group-next-group 1) ;(gnus-group-next-unread-group 1) |
257 | 4080 ))) |
4081 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4082 (defun gnus-summary-describe-briefly () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4083 "Describe Summary mode commands briefly." |
257 | 4084 (interactive) |
4085 (message | |
4086 (concat | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4087 (substitute-command-keys "\\[gnus-summary-next-page]:Select ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4088 (substitute-command-keys "\\[gnus-summary-next-unread-article]:Forward ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4089 (substitute-command-keys "\\[gnus-summary-prev-unread-article]:Backward ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4090 (substitute-command-keys "\\[gnus-summary-exit]:Exit ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4091 (substitute-command-keys "\\[gnus-info-find-node]:Run Info ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4092 (substitute-command-keys "\\[gnus-summary-describe-briefly]:This help") |
257 | 4093 ))) |
4094 | |
4095 | |
4096 ;;; | |
4097 ;;; GNUS Article Mode | |
4098 ;;; | |
4099 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4100 (if gnus-article-mode-map |
257 | 4101 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4102 (setq gnus-article-mode-map (make-keymap)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4103 (suppress-keymap gnus-article-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4104 (define-key gnus-article-mode-map " " 'gnus-article-next-page) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4105 (define-key gnus-article-mode-map "\177" 'gnus-article-prev-page) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4106 (define-key gnus-article-mode-map "r" 'gnus-article-refer-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4107 (define-key gnus-article-mode-map "o" 'gnus-article-pop-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4108 (define-key gnus-article-mode-map "h" 'gnus-article-show-summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4109 (define-key gnus-article-mode-map "s" 'gnus-article-show-summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4110 (define-key gnus-article-mode-map "?" 'gnus-article-describe-briefly) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4111 (define-key gnus-article-mode-map "\C-c\C-i" 'gnus-info-find-node)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4112 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4113 (defun gnus-article-mode () |
257 | 4114 "Major mode for browsing through an article. |
4115 All normal editing commands are turned off. | |
4116 Instead, these commands are available: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4117 \\{gnus-article-mode-map} |
257 | 4118 |
4119 Various hooks for customization: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4120 gnus-article-mode-hook |
257 | 4121 Entry to this mode calls the value with no arguments, if that |
4122 value is non-nil. | |
4123 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4124 gnus-article-prepare-hook |
257 | 4125 Called with no arguments after an article is prepared for reading, |
4126 if that value is non-nil." | |
4127 (interactive) | |
4128 (kill-all-local-variables) | |
4129 ;; Gee. Why don't you upgrade? | |
4130 (cond ((boundp 'mode-line-modified) | |
4131 (setq mode-line-modified "--- ")) | |
4132 ((listp (default-value 'mode-line-format)) | |
4133 (setq mode-line-format | |
4134 (cons "--- " (cdr (default-value 'mode-line-format)))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4135 ;; To disable display-time facility. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4136 ;;(make-local-variable 'global-mode-string) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4137 ;;(setq global-mode-string nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4138 (setq major-mode 'gnus-article-mode) |
257 | 4139 (setq mode-name "Article") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4140 (make-local-variable 'minor-mode-alist) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4141 (or (assq 'gnus-show-mime minor-mode-alist) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4142 (setq minor-mode-alist |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4143 (cons (list 'gnus-show-mime " MIME") minor-mode-alist))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4144 (gnus-article-set-mode-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4145 (use-local-map gnus-article-mode-map) |
257 | 4146 (make-local-variable 'page-delimiter) |
4147 (setq page-delimiter gnus-page-delimiter) | |
4148 (make-local-variable 'mail-header-separator) | |
4149 (setq mail-header-separator "") ;For caesar function. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4150 (buffer-flush-undo (current-buffer)) |
257 | 4151 (setq buffer-read-only t) ;Disable modification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4152 (run-hooks 'gnus-article-mode-hook)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4153 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4154 (defun gnus-article-setup-buffer () |
257 | 4155 "Initialize Article mode buffer." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4156 (or (get-buffer gnus-article-buffer) |
257 | 4157 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4158 (set-buffer (get-buffer-create gnus-article-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4159 (gnus-article-mode)) |
257 | 4160 )) |
4161 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4162 (defun gnus-article-prepare (article &optional all-headers) |
257 | 4163 "Prepare ARTICLE in Article mode buffer. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4164 ARTICLE can be either a article number or Message-ID. |
257 | 4165 If optional argument ALL-HEADERS is non-nil, all headers are inserted." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4166 ;; Make sure a connection to NNTP server is alive. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4167 (if (not (gnus-server-opened)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4168 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4169 (gnus-start-news-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4170 (gnus-request-group gnus-newsgroup-name))) |
257 | 4171 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4172 (set-buffer gnus-article-buffer) |
257 | 4173 (let ((buffer-read-only nil)) |
4174 (erase-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4175 ;; mhspool does not work with Message-ID. So, let's translate |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4176 ;; it into an article number as possible as can. This may help |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4177 ;; nnspool too. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4178 ;; Note: this conversion must be done here since if the article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4179 ;; is specified by number or message-id has a different meaning |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4180 ;; in the following. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4181 (if (let* ((header |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4182 (and (stringp article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4183 (gnus-get-header-by-id article))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4184 (article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4185 (if header |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4186 (nntp-header-number header) article))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4187 (gnus-request-article article)) |
257 | 4188 (progn |
4189 ;; Prepare article buffer | |
4190 (insert-buffer-substring nntp-server-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4191 ;; gnus-have-all-headers must be either T or NIL. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4192 (setq gnus-have-all-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4193 (not (not (or all-headers gnus-show-all-headers)))) |
257 | 4194 (if (and (numberp article) |
4195 (not (eq article gnus-current-article))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4196 ;; Seems me that a new article has been selected. |
257 | 4197 (progn |
4198 ;; gnus-current-article must be an article number. | |
4199 (setq gnus-last-article gnus-current-article) | |
4200 (setq gnus-current-article article) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4201 ;; (setq gnus-current-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4202 ;; (gnus-find-header-by-number gnus-newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4203 ;; gnus-current-article)) |
257 | 4204 (setq gnus-current-headers |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4205 (gnus-get-header-by-number gnus-current-article)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4206 (run-hooks 'gnus-mark-article-hook) |
257 | 4207 )) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4208 ;; Clear article history only when the article is |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4209 ;; retrieved by the article number. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4210 (if (numberp article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4211 (setq gnus-current-history nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4212 ;; Hooks for modifying contents of the article. This hook |
257 | 4213 ;; must be called before being narrowed. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4214 (run-hooks 'gnus-article-prepare-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4215 ;; Decode MIME message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4216 (if (and gnus-show-mime |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4217 (gnus-fetch-field "Mime-Version")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4218 (funcall gnus-show-mime-method)) |
257 | 4219 ;; Delete unnecessary headers. |
4220 (or gnus-have-all-headers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4221 (gnus-article-delete-headers)) |
257 | 4222 ;; Do page break. |
4223 (goto-char (point-min)) | |
4224 (if gnus-break-pages | |
4225 (gnus-narrow-to-page)) | |
4226 ;; Next function must be called after setting | |
4227 ;; `gnus-current-article' variable and narrowed to page. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4228 (gnus-article-set-mode-line) |
257 | 4229 ) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4230 ;; There is no such article. |
257 | 4231 (if (numberp article) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4232 (gnus-summary-mark-as-read article)) |
257 | 4233 (ding) (message "No such article (may be canceled)")) |
4234 ))) | |
4235 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4236 (defun gnus-article-show-all-headers () |
257 | 4237 "Show all article headers in Article mode buffer." |
4238 (or gnus-have-all-headers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4239 (gnus-article-prepare gnus-current-article t))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4240 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4241 ;;(defun gnus-article-set-mode-line () |
257 | 4242 ;; "Set Article mode line string." |
4243 ;; (setq mode-line-buffer-identification | |
4244 ;; (list 17 | |
4245 ;; (format "GNUS: %s {%d-%d} %d" | |
4246 ;; gnus-newsgroup-name | |
4247 ;; gnus-newsgroup-begin | |
4248 ;; gnus-newsgroup-end | |
4249 ;; gnus-current-article | |
4250 ;; ))) | |
4251 ;; (set-buffer-modified-p t)) | |
4252 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4253 ;;(defun gnus-article-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4254 ;; "Set Article mode line string." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4255 ;; (let ((unmarked |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4256 ;; (- (length gnus-newsgroup-unreads) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4257 ;; (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4258 ;; gnus-newsgroup-unreads gnus-newsgroup-marked)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4259 ;; (unselected |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4260 ;; (- (length gnus-newsgroup-unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4261 ;; (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4262 ;; gnus-newsgroup-unselected gnus-newsgroup-marked))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4263 ;; (setq mode-line-buffer-identification |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4264 ;; (list 17 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4265 ;; (format "GNUS: %s{%d} %s" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4266 ;; gnus-newsgroup-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4267 ;; gnus-current-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4268 ;; ;; This is proposed by tale@pawl.rpi.edu. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4269 ;; (cond ((and (zerop unmarked) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4270 ;; (zerop unselected)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4271 ;; " ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4272 ;; ((zerop unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4273 ;; (format "%d more" unmarked)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4274 ;; (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4275 ;; (format "%d(+%d) more" unmarked unselected))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4276 ;; )))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4277 ;; (set-buffer-modified-p t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4278 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4279 ;; New implementation in gnus 3.14.3 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4280 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4281 (defun gnus-article-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4282 "Set Article mode line string. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4283 If you don't like it, define your own gnus-article-set-mode-line." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4284 (let ((maxlen 15) ;Maximum subject length |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4285 (subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4286 (if gnus-current-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4287 (nntp-header-subject gnus-current-headers) ""))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4288 ;; The value must be a string to escape %-constructs because of subject. |
257 | 4289 (setq mode-line-buffer-identification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4290 (format "GNUS: %s%s %s%s%s" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4291 gnus-newsgroup-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4292 (if gnus-current-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4293 (format "/%d" gnus-current-article) "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4294 (substring subject 0 (min (length subject) maxlen)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4295 (if (> (length subject) maxlen) "..." "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4296 (make-string (max 0 (- 17 (length subject))) ? ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4297 ))) |
257 | 4298 (set-buffer-modified-p t)) |
4299 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4300 (defun gnus-article-delete-headers () |
257 | 4301 "Delete unnecessary headers." |
4302 (save-excursion | |
4303 (save-restriction | |
4304 (goto-char (point-min)) | |
4305 (narrow-to-region (point-min) | |
4306 (progn (search-forward "\n\n" nil 'move) (point))) | |
4307 (goto-char (point-min)) | |
4308 (and (stringp gnus-ignored-headers) | |
4309 (while (re-search-forward gnus-ignored-headers nil t) | |
4310 (beginning-of-line) | |
4311 (delete-region (point) | |
4312 (progn (re-search-forward "\n[^ \t]") | |
4313 (forward-char -1) | |
4314 (point))))) | |
4315 ))) | |
4316 | |
4317 ;; Working on article's buffer | |
4318 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4319 (defun gnus-article-next-page (lines) |
257 | 4320 "Show next page of current article. |
4321 If end of article, return non-nil. Otherwise return nil. | |
4322 Argument LINES specifies lines to be scrolled up." | |
4323 (interactive "P") | |
4324 (move-to-window-line -1) | |
4325 ;; Fixed by enami@ptgd.sony.co.jp (enami tsugutomo) | |
4326 (if (save-excursion | |
4327 (end-of-line) | |
4328 (and (pos-visible-in-window-p) ;Not continuation line. | |
4329 (eobp))) | |
4330 ;; Nothing in this page. | |
4331 (if (or (not gnus-break-pages) | |
4332 (save-excursion | |
4333 (save-restriction | |
4334 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer? | |
4335 t ;Nothing more. | |
4336 (gnus-narrow-to-page 1) ;Go to next page. | |
4337 nil | |
4338 ) | |
4339 ;; More in this page. | |
4340 (condition-case () | |
4341 (scroll-up lines) | |
4342 (end-of-buffer | |
4343 ;; Long lines may cause an end-of-buffer error. | |
4344 (goto-char (point-max)))) | |
4345 nil | |
4346 )) | |
4347 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4348 (defun gnus-article-prev-page (lines) |
257 | 4349 "Show previous page of current article. |
4350 Argument LINES specifies lines to be scrolled down." | |
4351 (interactive "P") | |
4352 (move-to-window-line 0) | |
4353 (if (and gnus-break-pages | |
4354 (bobp) | |
4355 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? | |
4356 (progn | |
4357 (gnus-narrow-to-page -1) ;Go to previous page. | |
4358 (goto-char (point-max)) | |
4359 (recenter -1)) | |
4360 (scroll-down lines))) | |
4361 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4362 (defun gnus-article-next-digest (nth) |
257 | 4363 "Move to head of NTH next digested message. |
4364 Set mark at end of digested message." | |
4365 ;; Stop page breaking in digest mode. | |
4366 (widen) | |
4367 (end-of-line) | |
4368 ;; Skip NTH - 1 digest. | |
4369 ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>. | |
4370 ;; Digest separator is customizable. | |
4371 ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>. | |
4372 (while (and (> nth 1) | |
4373 (re-search-forward gnus-digest-separator nil 'move)) | |
4374 (setq nth (1- nth))) | |
4375 (if (re-search-forward gnus-digest-separator nil t) | |
4376 (let ((begin (point))) | |
4377 ;; Search for end of this message. | |
4378 (end-of-line) | |
4379 (if (re-search-forward gnus-digest-separator nil t) | |
4380 (progn | |
4381 (search-backward "\n\n") ;This may be incorrect. | |
4382 (forward-line 1)) | |
4383 (goto-char (point-max))) | |
4384 (push-mark) ;Set mark at end of digested message. | |
4385 (goto-char begin) | |
4386 (beginning-of-line) | |
4387 ;; Show From: and Subject: fields. | |
4388 (recenter 1)) | |
4389 (message "End of message") | |
4390 )) | |
4391 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4392 (defun gnus-article-prev-digest (nth) |
257 | 4393 "Move to head of NTH previous digested message." |
4394 ;; Stop page breaking in digest mode. | |
4395 (widen) | |
4396 (beginning-of-line) | |
4397 ;; Skip NTH - 1 digest. | |
4398 ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>. | |
4399 ;; Digest separator is customizable. | |
4400 ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>. | |
4401 (while (and (> nth 1) | |
4402 (re-search-backward gnus-digest-separator nil 'move)) | |
4403 (setq nth (1- nth))) | |
4404 (if (re-search-backward gnus-digest-separator nil t) | |
4405 (let ((begin (point))) | |
4406 ;; Search for end of this message. | |
4407 (end-of-line) | |
4408 (if (re-search-forward gnus-digest-separator nil t) | |
4409 (progn | |
4410 (search-backward "\n\n") ;This may be incorrect. | |
4411 (forward-line 1)) | |
4412 (goto-char (point-max))) | |
4413 (push-mark) ;Set mark at end of digested message. | |
4414 (goto-char begin) | |
4415 ;; Show From: and Subject: fields. | |
4416 (recenter 1)) | |
4417 (goto-char (point-min)) | |
4418 (message "Top of message") | |
4419 )) | |
4420 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4421 (defun gnus-article-refer-article () |
257 | 4422 "Read article specified by message-id around point." |
4423 (interactive) | |
4424 (save-window-excursion | |
4425 (save-excursion | |
4426 (re-search-forward ">" nil t) ;Move point to end of "<....>". | |
4427 (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t) | |
4428 (let ((message-id | |
4429 (buffer-substring (match-beginning 1) (match-end 1)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4430 (set-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4431 (gnus-summary-refer-article message-id)) |
257 | 4432 (error "No references around point")) |
4433 ))) | |
4434 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4435 (defun gnus-article-pop-article () |
257 | 4436 "Pop up article history." |
4437 (interactive) | |
4438 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4439 (set-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4440 (gnus-summary-refer-article nil))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4441 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4442 (defun gnus-article-show-summary () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4443 "Reconfigure windows to show Summary buffer." |
257 | 4444 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4445 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4446 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4447 (gnus-summary-goto-subject gnus-current-article)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4448 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4449 (defun gnus-article-describe-briefly () |
257 | 4450 "Describe Article mode commands briefly." |
4451 (interactive) | |
4452 (message | |
4453 (concat | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4454 (substitute-command-keys "\\[gnus-article-next-page]:Next page ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4455 (substitute-command-keys "\\[gnus-article-prev-page]:Prev page ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4456 (substitute-command-keys "\\[gnus-article-show-summary]:Show Summary ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4457 (substitute-command-keys "\\[gnus-info-find-node]:Run Info ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4458 (substitute-command-keys "\\[gnus-article-describe-briefly]:This help") |
257 | 4459 ))) |
4460 | |
4461 | |
4462 ;;; | |
4463 ;;; GNUS KILL-File Mode | |
4464 ;;; | |
4465 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4466 (if gnus-kill-file-mode-map |
257 | 4467 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4468 (setq gnus-kill-file-mode-map (copy-keymap emacs-lisp-mode-map)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4469 (define-key gnus-kill-file-mode-map "\C-c\C-k\C-s" 'gnus-kill-file-kill-by-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4470 (define-key gnus-kill-file-mode-map "\C-c\C-k\C-a" 'gnus-kill-file-kill-by-author) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4471 (define-key gnus-kill-file-mode-map "\C-c\C-a" 'gnus-kill-file-apply-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4472 (define-key gnus-kill-file-mode-map "\C-c\C-e" 'gnus-kill-file-apply-last-sexp) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4473 (define-key gnus-kill-file-mode-map "\C-c\C-c" 'gnus-kill-file-exit) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4474 (define-key gnus-kill-file-mode-map "\C-c\C-i" 'gnus-info-find-node)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4475 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4476 (defun gnus-kill-file-mode () |
257 | 4477 "Major mode for editing KILL file. |
4478 | |
4479 In addition to Emacs-Lisp Mode, the following commands are available: | |
4480 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4481 \\[gnus-kill-file-kill-by-subject] Insert KILL command for current subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4482 \\[gnus-kill-file-kill-by-author] Insert KILL command for current author. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4483 \\[gnus-kill-file-apply-buffer] Apply current buffer to selected newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4484 \\[gnus-kill-file-apply-last-sexp] Apply sexp before point to selected newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4485 \\[gnus-kill-file-exit] Save file and exit editing KILL file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4486 \\[gnus-info-find-node] Read Info about KILL file. |
257 | 4487 |
4488 A KILL file contains lisp expressions to be applied to a selected | |
4489 newsgroup. The purpose is to mark articles as read on the basis of | |
4490 some set of regexps. A global KILL file is applied to every newsgroup, | |
4491 and a local KILL file is applied to a specified newsgroup. Since a | |
4492 global KILL file is applied to every newsgroup, for better performance | |
4493 use a local one. | |
4494 | |
4495 A KILL file can contain any kind of Emacs lisp expressions expected | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4496 to be evaluated in the Summary buffer. Writing lisp programs for this |
257 | 4497 purpose is not so easy because the internal working of GNUS must be |
4498 well-known. For this reason, GNUS provides a general function which | |
4499 does this easily for non-Lisp programmers. | |
4500 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4501 The `gnus-kill' function executes commands available in Summary Mode |
257 | 4502 by their key sequences. `gnus-kill' should be called with FIELD, |
4503 REGEXP and optional COMMAND and ALL. FIELD is a string representing | |
4504 the header field or an empty string. If FIELD is an empty string, the | |
4505 entire article body is searched for. REGEXP is a string which is | |
4506 compared with FIELD value. COMMAND is a string representing a valid | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4507 key sequence in Summary Mode or Lisp expression. COMMAND is default to |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4508 '(gnus-summary-mark-as-read nil \"X\"). Make sure that COMMAND is |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4509 executed in the Summary buffer. If the second optional argument ALL |
257 | 4510 is non-nil, the COMMAND is applied to articles which are already |
4511 marked as read or unread. Articles which are marked are skipped over | |
4512 by default. | |
4513 | |
4514 For example, if you want to mark articles of which subjects contain | |
4515 the string `AI' as read, a possible KILL file may look like: | |
4516 | |
4517 (gnus-kill \"Subject\" \"AI\") | |
4518 | |
4519 If you want to mark articles with `D' instead of `X', you can use | |
4520 the following expression: | |
4521 | |
4522 (gnus-kill \"Subject\" \"AI\" \"d\") | |
4523 | |
4524 In this example it is assumed that the command | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4525 `gnus-summary-mark-as-read-forward' is assigned to `d' in Summary Mode. |
257 | 4526 |
4527 It is possible to delete unnecessary headers which are marked with | |
4528 `X' in a KILL file as follows: | |
4529 | |
4530 (gnus-expunge \"X\") | |
4531 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4532 If the Summary buffer is empty after applying KILL files, GNUS will |
257 | 4533 exit the selected newsgroup normally. If headers which are marked |
4534 with `D' are deleted in a KILL file, it is impossible to read articles | |
4535 which are marked as read in the previous GNUS sessions. Marks other | |
4536 than `D' should be used for articles which should really be deleted. | |
4537 | |
4538 Entry to this mode calls emacs-lisp-mode-hook and | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4539 gnus-kill-file-mode-hook with no arguments, if that value is non-nil." |
257 | 4540 (interactive) |
4541 (kill-all-local-variables) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4542 (use-local-map gnus-kill-file-mode-map) |
257 | 4543 (set-syntax-table emacs-lisp-mode-syntax-table) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4544 (setq major-mode 'gnus-kill-file-mode) |
257 | 4545 (setq mode-name "KILL-File") |
4546 (lisp-mode-variables nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4547 (run-hooks 'emacs-lisp-mode-hook 'gnus-kill-file-mode-hook)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4548 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4549 (defun gnus-kill-file-edit-file (newsgroup) |
257 | 4550 "Begin editing a KILL file of NEWSGROUP. |
4551 If NEWSGROUP is nil, the global KILL file is selected." | |
4552 (interactive "sNewsgroup: ") | |
4553 (let ((file (gnus-newsgroup-kill-file newsgroup))) | |
4554 (gnus-make-directory (file-name-directory file)) | |
4555 ;; Save current window configuration if this is first invocation. | |
4556 (or (and (get-file-buffer file) | |
4557 (get-buffer-window (get-file-buffer file))) | |
4558 (setq gnus-winconf-kill-file (current-window-configuration))) | |
4559 ;; Hack windows. | |
4560 (let ((buffer (find-file-noselect file))) | |
4561 (cond ((get-buffer-window buffer) | |
4562 (pop-to-buffer buffer)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4563 ((eq major-mode 'gnus-group-mode) |
257 | 4564 (gnus-configure-windows '(1 0 0)) ;Take all windows. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4565 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4566 (let ((gnus-summary-buffer buffer)) |
257 | 4567 (gnus-configure-windows '(1 1 0)) ;Split into two. |
4568 (pop-to-buffer buffer))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4569 ((eq major-mode 'gnus-summary-mode) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4570 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4571 (pop-to-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4572 (bury-buffer gnus-article-buffer) |
257 | 4573 (switch-to-buffer buffer)) |
4574 (t ;No good rules. | |
4575 (find-file-other-window file)) | |
4576 )) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4577 (gnus-kill-file-mode) |
257 | 4578 )) |
4579 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4580 (defun gnus-kill-file-kill-by-subject () |
257 | 4581 "Insert KILL command for current subject." |
4582 (interactive) | |
4583 (insert | |
4584 (format "(gnus-kill \"Subject\" %s)\n" | |
4585 (prin1-to-string | |
4586 (if gnus-current-kill-article | |
4587 (regexp-quote | |
4588 (nntp-header-subject | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4589 ;; No need to speed up this command. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4590 ;;(gnus-get-header-by-number gnus-current-kill-article) |
257 | 4591 (gnus-find-header-by-number gnus-newsgroup-headers |
4592 gnus-current-kill-article))) | |
4593 ""))))) | |
4594 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4595 (defun gnus-kill-file-kill-by-author () |
257 | 4596 "Insert KILL command for current author." |
4597 (interactive) | |
4598 (insert | |
4599 (format "(gnus-kill \"From\" %s)\n" | |
4600 (prin1-to-string | |
4601 (if gnus-current-kill-article | |
4602 (regexp-quote | |
4603 (nntp-header-from | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4604 ;; No need to speed up this command. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4605 ;;(gnus-get-header-by-number gnus-current-kill-article) |
257 | 4606 (gnus-find-header-by-number gnus-newsgroup-headers |
4607 gnus-current-kill-article))) | |
4608 ""))))) | |
4609 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4610 (defun gnus-kill-file-apply-buffer () |
257 | 4611 "Apply current buffer to current newsgroup." |
4612 (interactive) | |
4613 (if (and gnus-current-kill-article | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4614 (get-buffer gnus-summary-buffer)) |
257 | 4615 ;; Assume newsgroup is selected. |
4616 (let ((string (concat "(progn \n" (buffer-string) "\n)" ))) | |
4617 (save-excursion | |
4618 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4619 (pop-to-buffer gnus-summary-buffer) |
257 | 4620 (eval (car (read-from-string string)))))) |
4621 (ding) (message "No newsgroup is selected."))) | |
4622 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4623 (defun gnus-kill-file-apply-last-sexp () |
257 | 4624 "Apply sexp before point in current buffer to current newsgroup." |
4625 (interactive) | |
4626 (if (and gnus-current-kill-article | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4627 (get-buffer gnus-summary-buffer)) |
257 | 4628 ;; Assume newsgroup is selected. |
4629 (let ((string | |
4630 (buffer-substring | |
4631 (save-excursion (forward-sexp -1) (point)) (point)))) | |
4632 (save-excursion | |
4633 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4634 (pop-to-buffer gnus-summary-buffer) |
257 | 4635 (eval (car (read-from-string string)))))) |
4636 (ding) (message "No newsgroup is selected."))) | |
4637 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4638 (defun gnus-kill-file-exit () |
257 | 4639 "Save a KILL file, then return to the previous buffer." |
4640 (interactive) | |
4641 (save-buffer) | |
4642 (let ((killbuf (current-buffer))) | |
4643 ;; We don't want to return to Article buffer. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4644 (and (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4645 (bury-buffer (get-buffer gnus-article-buffer))) |
257 | 4646 ;; Delete the KILL file windows. |
4647 (delete-windows-on killbuf) | |
4648 ;; Restore last window configuration if available. | |
4649 (and gnus-winconf-kill-file | |
4650 (set-window-configuration gnus-winconf-kill-file)) | |
4651 (setq gnus-winconf-kill-file nil) | |
4652 ;; Kill the KILL file buffer. Suggested by tale@pawl.rpi.edu. | |
4653 (kill-buffer killbuf))) | |
4654 | |
4655 | |
4656 ;;; | |
4657 ;;; Utility functions | |
4658 ;;; | |
4659 | |
4660 ;; Basic ideas by emv@math.lsa.umich.edu (Edward Vielmetti) | |
4661 | |
4662 (defun gnus-batch-kill () | |
4663 "Run batched KILL. | |
4664 Usage: emacs -batch -l gnus -f gnus-batch-kill NEWSGROUP ..." | |
4665 (if (not noninteractive) | |
4666 (error "gnus-batch-kill is to be used only with -batch")) | |
4667 (let* ((group nil) | |
4668 (subscribed nil) | |
4669 (newsrc nil) | |
4670 (yes-and-no | |
4671 (gnus-parse-n-options | |
4672 (apply (function concat) | |
4673 (mapcar (function (lambda (g) (concat g " "))) | |
4674 command-line-args-left)))) | |
4675 (yes (car yes-and-no)) | |
4676 (no (cdr yes-and-no)) | |
4677 ;; Disable verbose message. | |
4678 (gnus-novice-user nil) | |
4679 (gnus-large-newsgroup nil) | |
4680 (nntp-large-newsgroup nil)) | |
4681 ;; Eat all arguments. | |
4682 (setq command-line-args-left nil) | |
4683 ;; Startup GNUS. | |
4684 (gnus) | |
4685 ;; Apply kills to specified newsgroups in command line arguments. | |
4686 (setq newsrc (copy-sequence gnus-newsrc-assoc)) | |
4687 (while newsrc | |
4688 (setq group (car (car newsrc))) | |
4689 (setq subscribed (nth 1 (car newsrc))) | |
4690 (setq newsrc (cdr newsrc)) | |
4691 (if (and subscribed | |
4692 (not (zerop (nth 1 (gnus-gethash group gnus-unread-hashtb)))) | |
4693 (if yes | |
4694 (string-match yes group) t) | |
4695 (or (null no) | |
4696 (not (string-match no group)))) | |
4697 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4698 (gnus-summary-read-group group nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4699 (if (eq (current-buffer) (get-buffer gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4700 (gnus-summary-exit t)) |
257 | 4701 )) |
4702 ) | |
4703 ;; Finally, exit Emacs. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4704 (set-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4705 (gnus-group-exit) |
257 | 4706 )) |
4707 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4708 ;; For saving articles |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4709 |
257 | 4710 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file) |
4711 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4712 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group/num. | |
4713 Otherwise, it is like ~/News/news/group/num." | |
4714 (let ((default | |
4715 (expand-file-name | |
4716 (concat (if gnus-use-long-file-name | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4717 (gnus-capitalize-newsgroup newsgroup) |
257 | 4718 (gnus-newsgroup-directory-form newsgroup)) |
4719 "/" (int-to-string (nntp-header-number headers))) | |
4720 (or gnus-article-save-directory "~/News")))) | |
4721 (if (and last-file | |
4722 (string-equal (file-name-directory default) | |
4723 (file-name-directory last-file)) | |
4724 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
4725 default | |
4726 (or last-file default)))) | |
4727 | |
4728 (defun gnus-numeric-save-name (newsgroup headers &optional last-file) | |
4729 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4730 If variable `gnus-use-long-file-name' is nil, it is ~/News/news.group/num. | |
4731 Otherwise, it is like ~/News/news/group/num." | |
4732 (let ((default | |
4733 (expand-file-name | |
4734 (concat (if gnus-use-long-file-name | |
4735 newsgroup | |
4736 (gnus-newsgroup-directory-form newsgroup)) | |
4737 "/" (int-to-string (nntp-header-number headers))) | |
4738 (or gnus-article-save-directory "~/News")))) | |
4739 (if (and last-file | |
4740 (string-equal (file-name-directory default) | |
4741 (file-name-directory last-file)) | |
4742 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
4743 default | |
4744 (or last-file default)))) | |
4745 | |
4746 (defun gnus-Plain-save-name (newsgroup headers &optional last-file) | |
4747 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4748 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group. | |
4749 Otherwise, it is like ~/News/news/group/news." | |
4750 (or last-file | |
4751 (expand-file-name | |
4752 (if gnus-use-long-file-name | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4753 (gnus-capitalize-newsgroup newsgroup) |
257 | 4754 (concat (gnus-newsgroup-directory-form newsgroup) "/news")) |
4755 (or gnus-article-save-directory "~/News")))) | |
4756 | |
4757 (defun gnus-plain-save-name (newsgroup headers &optional last-file) | |
4758 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4759 If variable `gnus-use-long-file-name' is nil, it is ~/News/news.group. | |
4760 Otherwise, it is like ~/News/news/group/news." | |
4761 (or last-file | |
4762 (expand-file-name | |
4763 (if gnus-use-long-file-name | |
4764 newsgroup | |
4765 (concat (gnus-newsgroup-directory-form newsgroup) "/news")) | |
4766 (or gnus-article-save-directory "~/News")))) | |
4767 | |
4768 (defun gnus-Folder-save-name (newsgroup headers &optional last-folder) | |
4769 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER. | |
4770 If variable `gnus-use-long-file-name' is nil, it is +News.group. | |
4771 Otherwise, it is like +news/group." | |
4772 (or last-folder | |
4773 (concat "+" | |
4774 (if gnus-use-long-file-name | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4775 (gnus-capitalize-newsgroup newsgroup) |
257 | 4776 (gnus-newsgroup-directory-form newsgroup))))) |
4777 | |
4778 (defun gnus-folder-save-name (newsgroup headers &optional last-folder) | |
4779 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER. | |
4780 If variable `gnus-use-long-file-name' is nil, it is +news.group. | |
4781 Otherwise, it is like +news/group." | |
4782 (or last-folder | |
4783 (concat "+" | |
4784 (if gnus-use-long-file-name | |
4785 newsgroup | |
4786 (gnus-newsgroup-directory-form newsgroup))))) | |
4787 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4788 ;; For KILL files |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4789 |
257 | 4790 (defun gnus-apply-kill-file () |
4791 "Apply KILL file to the current newsgroup." | |
4792 ;; Apply the global KILL file. | |
4793 (load (gnus-newsgroup-kill-file nil) t nil t) | |
4794 ;; And then apply the local KILL file. | |
4795 (load (gnus-newsgroup-kill-file gnus-newsgroup-name) t nil t)) | |
4796 | |
4797 (defun gnus-Newsgroup-kill-file (newsgroup) | |
4798 "Return the name of a KILL file of NEWSGROUP. | |
4799 If NEWSGROUP is nil, return the global KILL file instead." | |
4800 (cond ((or (null newsgroup) | |
4801 (string-equal newsgroup "")) | |
4802 ;; The global KILL file is placed at top of the directory. | |
4803 (expand-file-name gnus-kill-file-name | |
4804 (or gnus-article-save-directory "~/News"))) | |
4805 (gnus-use-long-file-name | |
4806 ;; Append ".KILL" to capitalized newsgroup name. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4807 (expand-file-name (concat (gnus-capitalize-newsgroup newsgroup) |
257 | 4808 "." gnus-kill-file-name) |
4809 (or gnus-article-save-directory "~/News"))) | |
4810 (t | |
4811 ;; Place "KILL" under the hierarchical directory. | |
4812 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup) | |
4813 "/" gnus-kill-file-name) | |
4814 (or gnus-article-save-directory "~/News"))) | |
4815 )) | |
4816 | |
4817 (defun gnus-newsgroup-kill-file (newsgroup) | |
4818 "Return the name of a KILL file of NEWSGROUP. | |
4819 If NEWSGROUP is nil, return the global KILL file instead." | |
4820 (cond ((or (null newsgroup) | |
4821 (string-equal newsgroup "")) | |
4822 ;; The global KILL file is placed at top of the directory. | |
4823 (expand-file-name gnus-kill-file-name | |
4824 (or gnus-article-save-directory "~/News"))) | |
4825 (gnus-use-long-file-name | |
4826 ;; Append ".KILL" to newsgroup name. | |
4827 (expand-file-name (concat newsgroup "." gnus-kill-file-name) | |
4828 (or gnus-article-save-directory "~/News"))) | |
4829 (t | |
4830 ;; Place "KILL" under the hierarchical directory. | |
4831 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup) | |
4832 "/" gnus-kill-file-name) | |
4833 (or gnus-article-save-directory "~/News"))) | |
4834 )) | |
4835 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4836 ;; For subscribing new newsgroup |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4837 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4838 (defun gnus-subscribe-randomly (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4839 "Subscribe new NEWSGROUP and insert it at the beginning of newsgroups." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4840 (gnus-subscribe-newsgroup newsgroup |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4841 (car (car gnus-newsrc-assoc)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4842 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4843 (defun gnus-subscribe-alphabetically (newgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4844 "Subscribe new NEWSGROUP and insert it in strict alphabetic order." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4845 ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4846 (let ((groups gnus-newsrc-assoc) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4847 (before nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4848 (while (and (not before) groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4849 (if (string< newgroup (car (car groups))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4850 (setq before (car (car groups))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4851 (setq groups (cdr groups)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4852 (gnus-subscribe-newsgroup newgroup before) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4853 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4854 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4855 (defun gnus-subscribe-hierarchically (newgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4856 "Subscribe new NEWSGROUP and insert it in hierarchical newsgroup order." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4857 ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4858 (save-excursion |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4859 (set-buffer (find-file-noselect gnus-current-startup-file)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4860 (let ((groupkey newgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4861 (before nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4862 (while (and (not before) groupkey) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4863 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4864 (let ((groupkey-re |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4865 (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4866 (while (and (re-search-forward groupkey-re nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4867 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4868 (setq before (buffer-substring |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4869 (match-beginning 1) (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4870 (string< before newgroup))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4871 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4872 ;; Remove tail of newsgroup name (eg. a.b.c -> a.b) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4873 (setq groupkey |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4874 (if (string-match "^\\(.*\\)\\.[^.]+$" groupkey) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4875 (substring groupkey (match-beginning 1) (match-end 1))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4876 (gnus-subscribe-newsgroup newgroup before) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4877 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4878 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4879 (defun gnus-subscribe-interactively (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4880 "Subscribe new NEWSGROUP interactively. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4881 It is inserted in hierarchical newsgroup order if subscribed. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4882 Unless, it is killed." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4883 (if (y-or-n-p (format "Subscribe new newsgroup: %s " newsgroup)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4884 (gnus-subscribe-hierarchically newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4885 ;; Save in kill-ring |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4886 (gnus-subscribe-newsgroup newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4887 (gnus-kill-newsgroup newsgroup))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4888 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4889 (defun gnus-subscribe-newsgroup (newsgroup &optional next) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4890 "Subscribe new NEWSGROUP. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4891 If optional argument NEXT is non-nil, it is inserted before NEXT." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4892 (gnus-insert-newsgroup (list newsgroup t) next) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4893 (message "Subscribe newsgroup: %s" newsgroup)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4894 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4895 ;; For directories |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4896 |
257 | 4897 (defun gnus-newsgroup-directory-form (newsgroup) |
4898 "Make hierarchical directory name from NEWSGROUP name." | |
4899 (let ((newsgroup (substring newsgroup 0)) ;Copy string. | |
4900 (len (length newsgroup)) | |
4901 (idx 0)) | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
4902 ;; Replace all occurrences of `.' with `/'. |
257 | 4903 (while (< idx len) |
4904 (if (= (aref newsgroup idx) ?.) | |
4905 (aset newsgroup idx ?/)) | |
4906 (setq idx (1+ idx))) | |
4907 newsgroup | |
4908 )) | |
4909 | |
4910 (defun gnus-make-directory (directory) | |
4911 "Make DIRECTORY recursively." | |
4912 (let ((directory (expand-file-name directory default-directory))) | |
4913 (or (file-exists-p directory) | |
4914 (gnus-make-directory-1 "" directory)) | |
4915 )) | |
4916 | |
4917 (defun gnus-make-directory-1 (head tail) | |
4918 (cond ((string-match "^/\\([^/]+\\)" tail) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4919 ;; ange-ftp interferes with calling match-* after |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4920 ;; calling file-name-as-directory. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4921 (let ((beg (match-beginning 1)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4922 (end (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4923 (setq head (concat (file-name-as-directory head) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4924 (substring tail beg end))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4925 (or (file-exists-p head) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4926 (call-process "mkdir" nil nil nil head)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4927 (gnus-make-directory-1 head (substring tail end)))) |
257 | 4928 ((string-equal tail "") t) |
4929 )) | |
4930 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4931 (defun gnus-capitalize-newsgroup (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4932 "Capitalize NEWSGROUP name with treating '.' and '-' as part of words." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4933 ;; Suggested by "Jonathan I. Kamens" <jik@pit-manager.MIT.EDU>. |
5313
3189e46001fd
(gnus-capitalize-newsgroup): Modify a new temporary
Richard M. Stallman <rms@gnu.org>
parents:
5057
diff
changeset
|
4934 (let ((current-syntax-table (syntax-table))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4935 (unwind-protect |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4936 (progn |
5313
3189e46001fd
(gnus-capitalize-newsgroup): Modify a new temporary
Richard M. Stallman <rms@gnu.org>
parents:
5057
diff
changeset
|
4937 (set-syntax-table (copy-syntax-table current-syntax-table)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4938 (modify-syntax-entry ?- "w") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4939 (modify-syntax-entry ?. "w") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4940 (capitalize newsgroup)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4941 (set-syntax-table current-syntax-table)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4942 |
257 | 4943 (defun gnus-simplify-subject (subject &optional re-only) |
4944 "Remove `Re:' and words in parentheses. | |
4945 If optional argument RE-ONLY is non-nil, strip `Re:' only." | |
4946 (let ((case-fold-search t)) ;Ignore case. | |
4947 ;; Remove `Re:' and `Re^N:'. | |
4948 (if (string-match "\\`\\(re\\(\\^[0-9]+\\)?:[ \t]+\\)+" subject) | |
4949 (setq subject (substring subject (match-end 0)))) | |
4950 ;; Remove words in parentheses from end. | |
4951 (or re-only | |
4952 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject) | |
4953 (setq subject (substring subject 0 (match-beginning 0))))) | |
4954 ;; Return subject string. | |
4955 subject | |
4956 )) | |
4957 | |
4958 (defun gnus-optional-lines-and-from (header) | |
4959 "Return a string like `NNN:AUTHOR' from HEADER." | |
4960 (let ((name-length (length "umerin@photon"))) | |
4961 (substring (format "%3d:%s" | |
4962 ;; Lines of the article. | |
4963 ;; Suggested by dana@bellcore.com. | |
4964 (nntp-header-lines header) | |
4965 ;; Its author. | |
4966 (concat (mail-strip-quoted-names | |
4967 (nntp-header-from header)) | |
4968 (make-string name-length ? ))) | |
4969 ;; 4 stands for length of `NNN:'. | |
4970 0 (+ 4 name-length)))) | |
4971 | |
4972 (defun gnus-optional-lines (header) | |
4973 "Return a string like `NNN' from HEADER." | |
4974 (format "%4d" (nntp-header-lines header))) | |
4975 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4976 ;; Basic ideas by flee@cs.psu.edu (Felix Lee) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4977 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4978 (defun gnus-keysort-headers (predicate key &optional reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4979 "Sort current headers by PREDICATE using a value passed by KEY safely. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4980 *Safely* means C-g quitting is disabled during sort. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4981 Optional argument REVERSE means reverse order." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4982 (let ((inhibit-quit t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4983 (setq gnus-newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4984 (if reverse |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4985 (nreverse |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4986 (gnus-keysort (nreverse gnus-newsgroup-headers) predicate key)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4987 (gnus-keysort gnus-newsgroup-headers predicate key))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4988 ;; Make sure we don't have to call |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4989 ;; gnus-clear-hashtables-for-newsgroup-headers to clear hash |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4990 ;; tables for the variable gnus-newsgroup-headers since no new |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4991 ;; entry is added to nor deleted from the variable. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4992 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4993 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4994 (defun gnus-keysort (list predicate key) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4995 "Sort LIST by PREDICATE using a value passed by KEY." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4996 (mapcar (function cdr) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4997 (sort (mapcar (function (lambda (a) (cons (funcall key a) a))) list) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4998 (function (lambda (a b) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4999 (funcall predicate (car a) (car b))))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5000 |
257 | 5001 (defun gnus-sort-headers (predicate &optional reverse) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5002 "Sort current headers by PREDICATE safely. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5003 *Safely* means C-g quitting is disabled during sort. |
257 | 5004 Optional argument REVERSE means reverse order." |
5005 (let ((inhibit-quit t)) | |
5006 (setq gnus-newsgroup-headers | |
5007 (if reverse | |
5008 (nreverse (sort (nreverse gnus-newsgroup-headers) predicate)) | |
5009 (sort gnus-newsgroup-headers predicate))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5010 ;; Make sure we don't have to call |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5011 ;; gnus-clear-hashtables-for-newsgroup-headers to clear hash |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5012 ;; tables for the variable gnus-newsgroup-headers since no new |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5013 ;; entry is added to nor deleted from the variable. |
257 | 5014 )) |
5015 | |
5016 (defun gnus-string-lessp (a b) | |
5017 "Return T if first arg string is less than second in lexicographic order. | |
5018 If case-fold-search is non-nil, case of letters is ignored." | |
5019 (if case-fold-search | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5020 (string-lessp (downcase a) (downcase b)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5021 (string-lessp a b))) |
257 | 5022 |
5023 (defun gnus-date-lessp (date1 date2) | |
5024 "Return T if DATE1 is earlyer than DATE2." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5025 (string-lessp (gnus-sortable-date date1) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5026 (gnus-sortable-date date2))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5027 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5028 (defun gnus-sortable-date (date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5029 "Make sortable string by string-lessp from DATE. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5030 Timezone package is used." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5031 (let* ((date (timezone-parse-date date)) ;[Y M D T] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5032 (year (string-to-int (aref date 0))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5033 (month (string-to-int (aref date 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5034 (day (string-to-int (aref date 2))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5035 (time (aref date 3))) ;HH:MM:SS |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5036 ;; Timezone package is used. But, we don't have to care about |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5037 ;; the timezone since article's timezones are always GMT. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5038 (timezone-make-sortable-date year month day time) |
257 | 5039 )) |
5040 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5041 ;;(defun gnus-sortable-date (date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5042 ;; "Make sortable string by string-lessp from DATE." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5043 ;; (let ((month '(("JAN" . " 1")("FEB" . " 2")("MAR" . " 3") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5044 ;; ("APR" . " 4")("MAY" . " 5")("JUN" . " 6") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5045 ;; ("JUL" . " 7")("AUG" . " 8")("SEP" . " 9") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5046 ;; ("OCT" . "10")("NOV" . "11")("DEC" . "12"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5047 ;; (date (or date ""))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5048 ;; ;; Can understand the following styles: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5049 ;; ;; (1) 14 Apr 89 03:20:12 GMT |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5050 ;; ;; (2) Fri, 17 Mar 89 4:01:33 GMT |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5051 ;; (if (string-match |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5052 ;; "\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\) \\([0-9:]+\\)" date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5053 ;; (concat |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5054 ;; ;; Year |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5055 ;; (substring date (match-beginning 3) (match-end 3)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5056 ;; ;; Month |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5057 ;; (cdr |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5058 ;; (assoc |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5059 ;; (upcase (substring date (match-beginning 2) (match-end 2))) month)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5060 ;; ;; Day |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5061 ;; (format "%2d" (string-to-int |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5062 ;; (substring date |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5063 ;; (match-beginning 1) (match-end 1)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5064 ;; ;; Time |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5065 ;; (substring date (match-beginning 4) (match-end 4))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5066 ;; ;; Cannot understand DATE string. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5067 ;; date |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5068 ;; ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5069 ;; )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5070 |
257 | 5071 (defun gnus-fetch-field (field) |
5072 "Return the value of the header FIELD of current article." | |
5073 (save-excursion | |
5074 (save-restriction | |
5075 (widen) | |
5076 (goto-char (point-min)) | |
5077 (narrow-to-region (point-min) | |
5078 (progn (search-forward "\n\n" nil 'move) (point))) | |
5079 (mail-fetch-field field)))) | |
5080 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5081 (fset 'gnus-expunge 'gnus-summary-delete-marked-with) |
257 | 5082 |
5083 (defun gnus-kill (field regexp &optional command all) | |
5084 "If FIELD of an article matches REGEXP, execute COMMAND. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5085 Optional 1st argument COMMAND is default to |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5086 (gnus-summary-mark-as-read nil \"X\"). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5087 If optional 2nd argument ALL is non-nil, articles marked are also applied to. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5088 If FIELD is an empty string (or nil), entire article body is searched for. |
257 | 5089 COMMAND must be a lisp expression or a string representing a key sequence." |
5090 ;; We don't want to change current point nor window configuration. | |
5091 (save-excursion | |
5092 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5093 ;; Selected window must be Summary buffer to execute keyboard |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5094 ;; macros correctly. See command_loop_1. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5095 (switch-to-buffer gnus-summary-buffer 'norecord) |
257 | 5096 (goto-char (point-min)) ;From the beginning. |
5097 (if (null command) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5098 (setq command '(gnus-summary-mark-as-read nil "X"))) |
257 | 5099 (gnus-execute field regexp command nil (not all)) |
5100 ))) | |
5101 | |
5102 (defun gnus-execute (field regexp form &optional backward ignore-marked) | |
5103 "If FIELD of article header matches REGEXP, execute lisp FORM (or a string). | |
5104 If FIELD is an empty string (or nil), entire article body is searched for. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5105 If optional 1st argument BACKWARD is non-nil, do backward instead. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5106 If optional 2nd argument IGNORE-MARKED is non-nil, articles which are |
257 | 5107 marked as read or unread are ignored." |
5108 (let ((function nil) | |
5109 (header nil) | |
5110 (article nil)) | |
5111 (if (string-equal field "") | |
5112 (setq field nil)) | |
5113 (if (null field) | |
5114 nil | |
5115 (or (stringp field) | |
5116 (setq field (symbol-name field))) | |
5117 ;; Get access function of header filed. | |
5118 (setq function (intern-soft (concat "gnus-header-" (downcase field)))) | |
5119 (if (and function (fboundp function)) | |
5120 (setq function (symbol-function function)) | |
5121 (error "Unknown header field: \"%s\"" field))) | |
5122 ;; Make FORM funcallable. | |
5123 (if (and (listp form) (not (eq (car form) 'lambda))) | |
5124 (setq form (list 'lambda nil form))) | |
5125 ;; Starting from the current article. | |
5126 (or (and ignore-marked | |
5127 ;; Articles marked as read and unread should be ignored. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5128 (setq article (gnus-summary-article-number)) |
257 | 5129 (or (not (memq article gnus-newsgroup-unreads)) ;Marked as read. |
5130 (memq article gnus-newsgroup-marked) ;Marked as unread. | |
5131 )) | |
5132 (gnus-execute-1 function regexp form)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5133 (while (gnus-summary-search-subject backward ignore-marked nil) |
257 | 5134 (gnus-execute-1 function regexp form)) |
5135 )) | |
5136 | |
5137 (defun gnus-execute-1 (function regexp form) | |
5138 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5139 ;; The point of Summary buffer must be saved during execution. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5140 (let ((article (gnus-summary-article-number))) |
257 | 5141 (if (null article) |
5142 nil ;Nothing to do. | |
5143 (if function | |
5144 ;; Compare with header field. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5145 (let (;;(header (gnus-find-header-by-number |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5146 ;; gnus-newsgroup-headers article)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5147 (header (gnus-get-header-by-number article)) |
257 | 5148 (value nil)) |
5149 (and header | |
5150 (progn | |
5151 (setq value (funcall function header)) | |
5152 ;; Number (Lines:) or symbol must be converted to string. | |
5153 (or (stringp value) | |
5154 (setq value (prin1-to-string value))) | |
5155 (string-match regexp value)) | |
5156 (if (stringp form) ;Keyboard macro. | |
5157 (execute-kbd-macro form) | |
5158 (funcall form)))) | |
5159 ;; Search article body. | |
5160 (let ((gnus-current-article nil) ;Save article pointer. | |
5161 (gnus-last-article nil) | |
5162 (gnus-break-pages nil) ;No need to break pages. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5163 (gnus-mark-article-hook nil)) ;Inhibit marking as read. |
257 | 5164 (message "Searching for article: %d..." article) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5165 (gnus-article-setup-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5166 (gnus-article-prepare article t) |
257 | 5167 (if (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5168 (set-buffer gnus-article-buffer) |
257 | 5169 (goto-char (point-min)) |
5170 (re-search-forward regexp nil t)) | |
5171 (if (stringp form) ;Keyboard macro. | |
5172 (execute-kbd-macro form) | |
5173 (funcall form)))) | |
5174 )) | |
5175 ))) | |
5176 | |
5177 ;;; caesar-region written by phr@prep.ai.mit.edu Nov 86 | |
5178 ;;; modified by tower@prep Nov 86 | |
5179 ;;; Modified by umerin@flab.flab.Fujitsu.JUNET for ROT47. | |
5180 | |
5181 (defun gnus-caesar-region (&optional n) | |
5182 "Caesar rotation of region by N, default 13, for decrypting netnews. | |
5183 ROT47 will be performed for Japanese text in any case." | |
5184 (interactive (if current-prefix-arg ; Was there a prefix arg? | |
5185 (list (prefix-numeric-value current-prefix-arg)) | |
5186 (list nil))) | |
5187 (cond ((not (numberp n)) (setq n 13)) | |
4522
8fbd7ec97c6d
(gnus-caesar-region): Replace `%' by `mod' and simplify.
Paul Eggert <eggert@twinsun.com>
parents:
4321
diff
changeset
|
5188 (t (setq n (mod n 26)))) ;canonicalize N |
257 | 5189 (if (not (zerop n)) ; no action needed for a rot of 0 |
5190 (progn | |
5191 (if (or (not (boundp 'caesar-translate-table)) | |
5192 (/= (aref caesar-translate-table ?a) (+ ?a n))) | |
5193 (let ((i 0) (lower "abcdefghijklmnopqrstuvwxyz") upper) | |
5194 (message "Building caesar-translate-table...") | |
5195 (setq caesar-translate-table (make-vector 256 0)) | |
5196 (while (< i 256) | |
5197 (aset caesar-translate-table i i) | |
5198 (setq i (1+ i))) | |
5199 (setq lower (concat lower lower) upper (upcase lower) i 0) | |
5200 (while (< i 26) | |
5201 (aset caesar-translate-table (+ ?a i) (aref lower (+ i n))) | |
5202 (aset caesar-translate-table (+ ?A i) (aref upper (+ i n))) | |
5203 (setq i (1+ i))) | |
5204 ;; ROT47 for Japanese text. | |
5205 ;; Thanks to ichikawa@flab.fujitsu.junet. | |
5206 (setq i 161) | |
5207 (let ((t1 (logior ?O 128)) | |
5208 (t2 (logior ?! 128)) | |
5209 (t3 (logior ?~ 128))) | |
5210 (while (< i 256) | |
5211 (aset caesar-translate-table i | |
5212 (let ((v (aref caesar-translate-table i))) | |
5213 (if (<= v t1) (if (< v t2) v (+ v 47)) | |
5214 (if (<= v t3) (- v 47) v)))) | |
5215 (setq i (1+ i)))) | |
5216 (message "Building caesar-translate-table... done"))) | |
5217 (let ((from (region-beginning)) | |
5218 (to (region-end)) | |
5219 (i 0) str len) | |
5220 (setq str (buffer-substring from to)) | |
5221 (setq len (length str)) | |
5222 (while (< i len) | |
5223 (aset str i (aref caesar-translate-table (aref str i))) | |
5224 (setq i (1+ i))) | |
5225 (goto-char from) | |
5226 (delete-region from to) | |
5227 (insert str))))) | |
5228 | |
5229 ;; Functions accessing headers. | |
5230 ;; Functions are more convenient than macros in some case. | |
5231 | |
5232 (defun gnus-header-number (header) | |
5233 "Return article number in HEADER." | |
5234 (nntp-header-number header)) | |
5235 | |
5236 (defun gnus-header-subject (header) | |
5237 "Return subject string in HEADER." | |
5238 (nntp-header-subject header)) | |
5239 | |
5240 (defun gnus-header-from (header) | |
5241 "Return author string in HEADER." | |
5242 (nntp-header-from header)) | |
5243 | |
5244 (defun gnus-header-xref (header) | |
5245 "Return xref string in HEADER." | |
5246 (nntp-header-xref header)) | |
5247 | |
5248 (defun gnus-header-lines (header) | |
5249 "Return lines in HEADER." | |
5250 (nntp-header-lines header)) | |
5251 | |
5252 (defun gnus-header-date (header) | |
5253 "Return date in HEADER." | |
5254 (nntp-header-date header)) | |
5255 | |
5256 (defun gnus-header-id (header) | |
5257 "Return Id in HEADER." | |
5258 (nntp-header-id header)) | |
5259 | |
5260 (defun gnus-header-references (header) | |
5261 "Return references in HEADER." | |
5262 (nntp-header-references header)) | |
5263 | |
5264 | |
5265 ;;; | |
5266 ;;; Article savers. | |
5267 ;;; | |
5268 | |
5269 (defun gnus-output-to-rmail (file-name) | |
5270 "Append the current article to an Rmail file named FILE-NAME." | |
5271 (require 'rmail) | |
5272 ;; Most of these codes are borrowed from rmailout.el. | |
5273 (setq file-name (expand-file-name file-name)) | |
7560
e63efa2d587c
rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents:
7524
diff
changeset
|
5274 (setq rmail-default-rmail-file file-name) |
257 | 5275 (let ((artbuf (current-buffer)) |
5276 (tmpbuf (get-buffer-create " *GNUS-output*"))) | |
5277 (save-excursion | |
5278 (or (get-file-buffer file-name) | |
5279 (file-exists-p file-name) | |
5280 (if (yes-or-no-p | |
5281 (concat "\"" file-name "\" does not exist, create it? ")) | |
5282 (let ((file-buffer (create-file-buffer file-name))) | |
5283 (save-excursion | |
5284 (set-buffer file-buffer) | |
5285 (rmail-insert-rmail-file-header) | |
5286 (let ((require-final-newline nil)) | |
5287 (write-region (point-min) (point-max) file-name t 1))) | |
5288 (kill-buffer file-buffer)) | |
5289 (error "Output file does not exist"))) | |
5290 (set-buffer tmpbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5291 (buffer-flush-undo (current-buffer)) |
257 | 5292 (erase-buffer) |
5293 (insert-buffer-substring artbuf) | |
5294 (gnus-convert-article-to-rmail) | |
5295 ;; Decide whether to append to a file or to an Emacs buffer. | |
5296 (let ((outbuf (get-file-buffer file-name))) | |
5297 (if (not outbuf) | |
5298 (append-to-file (point-min) (point-max) file-name) | |
5299 ;; File has been visited, in buffer OUTBUF. | |
5300 (set-buffer outbuf) | |
5301 (let ((buffer-read-only nil) | |
5302 (msg (and (boundp 'rmail-current-message) | |
5303 rmail-current-message))) | |
5304 ;; If MSG is non-nil, buffer is in RMAIL mode. | |
5305 (if msg | |
5306 (progn (widen) | |
5307 (narrow-to-region (point-max) (point-max)))) | |
5308 (insert-buffer-substring tmpbuf) | |
5309 (if msg | |
5310 (progn | |
5311 (goto-char (point-min)) | |
5312 (widen) | |
5313 (search-backward "\^_") | |
5314 (narrow-to-region (point) (point-max)) | |
5315 (goto-char (1+ (point-min))) | |
5316 (rmail-count-new-messages t) | |
5317 (rmail-show-message msg)))))) | |
5318 ) | |
5319 (kill-buffer tmpbuf) | |
5320 )) | |
5321 | |
5322 (defun gnus-output-to-file (file-name) | |
5323 "Append the current article to a file named FILE-NAME." | |
5324 (setq file-name (expand-file-name file-name)) | |
5325 (let ((artbuf (current-buffer)) | |
5326 (tmpbuf (get-buffer-create " *GNUS-output*"))) | |
5327 (save-excursion | |
5328 (set-buffer tmpbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5329 (buffer-flush-undo (current-buffer)) |
257 | 5330 (erase-buffer) |
5331 (insert-buffer-substring artbuf) | |
5332 ;; Append newline at end of the buffer as separator, and then | |
5333 ;; save it to file. | |
5334 (goto-char (point-max)) | |
5335 (insert "\n") | |
5336 (append-to-file (point-min) (point-max) file-name)) | |
5337 (kill-buffer tmpbuf) | |
5338 )) | |
5339 | |
5340 (defun gnus-convert-article-to-rmail () | |
5341 "Convert article in current buffer to Rmail message format." | |
5342 (let ((buffer-read-only nil)) | |
5343 ;; Convert article directly into Babyl format. | |
5344 ;; Suggested by Rob Austein <sra@lcs.mit.edu> | |
5345 (goto-char (point-min)) | |
5346 (insert "\^L\n0, unseen,,\n*** EOOH ***\n") | |
5347 (while (search-forward "\n\^_" nil t) ;single char | |
5348 (replace-match "\n^_")) ;2 chars: "^" and "_" | |
5349 (goto-char (point-max)) | |
5350 (insert "\^_"))) | |
5351 | |
5352 ;;(defun gnus-convert-article-to-rmail () | |
5353 ;; "Convert article in current buffer to Rmail message format." | |
5354 ;; (let ((buffer-read-only nil)) | |
5355 ;; ;; Insert special header of Unix mail. | |
5356 ;; (goto-char (point-min)) | |
5357 ;; (insert "From " | |
5358 ;; (or (mail-strip-quoted-names (mail-fetch-field "from")) | |
5359 ;; "unknown") | |
5360 ;; " " (current-time-string) "\n") | |
5361 ;; ;; Stop quoting `From' since this seems unnecessary in most cases. | |
5362 ;; ;; ``Quote'' "\nFrom " as "\n>From " | |
5363 ;; ;;(while (search-forward "\nFrom " nil t) | |
5364 ;; ;; (forward-char -5) | |
5365 ;; ;; (insert ?>)) | |
5366 ;; ;; Convert article to babyl format. | |
5367 ;; (rmail-convert-to-babyl-format) | |
5368 ;; )) | |
5369 | |
5370 | |
5371 ;;; | |
5372 ;;; Internal functions. | |
5373 ;;; | |
5374 | |
5375 (defun gnus-start-news-server (&optional confirm) | |
5376 "Open network stream to remote NNTP server. | |
5377 If optional argument CONFIRM is non-nil, ask you host that NNTP server | |
5378 is running even if it is defined. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5379 Run gnus-open-server-hook just before opening news server." |
257 | 5380 (if (gnus-server-opened) |
5381 ;; Stream is already opened. | |
5382 nil | |
5383 ;; Open NNTP server. | |
5384 (if (or confirm | |
5385 (null gnus-nntp-server)) | |
3612
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5386 ;; If someone has set the service to nil, then this should always |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5387 ;; be the local host. |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5388 (if gnus-nntp-service |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5389 (if (and (boundp 'gnus-secondary-servers) gnus-secondary-servers) |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5390 ;; Read server name with completion. |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5391 (setq gnus-nntp-server |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5392 (completing-read "NNTP server: " |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5393 (cons (list gnus-nntp-server) |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5394 gnus-secondary-servers) |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5395 nil nil gnus-nntp-server)) |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5396 (setq gnus-nntp-server |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5397 (read-string "NNTP server: " gnus-nntp-server))) |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5398 (setq gnus-nntp-server ""))) |
257 | 5399 ;; If no server name is given, local host is assumed. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5400 (if (or (string-equal gnus-nntp-server "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5401 (string-equal gnus-nntp-server "::")) ;RMS preference. |
257 | 5402 (setq gnus-nntp-server (system-name))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5403 ;; gnus-nntp-server must be either (system-name), ':DIRECTORY', or |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5404 ;; nntp server name. I mean '::' cannot be a value of |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5405 ;; gnus-nntp-server. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5406 (cond ((and (null gnus-nntp-service) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5407 (string-equal gnus-nntp-server (system-name))) |
716
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5408 (require 'nnspool) |
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5409 (gnus-define-access-method 'nnspool) |
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5410 (message "Looking up local news spool...")) |
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5411 ((string-match ":" gnus-nntp-server) |
257 | 5412 ;; :DIRECTORY |
5413 (require 'mhspool) | |
5414 (gnus-define-access-method 'mhspool) | |
5415 (message "Looking up private directory...")) | |
5416 (t | |
5417 (gnus-define-access-method 'nntp) | |
5418 (message "Connecting to NNTP server on %s..." gnus-nntp-server))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5419 (run-hooks 'gnus-open-server-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5420 (cond ((gnus-server-opened) ;Maybe opened in gnus-open-server-hook. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5421 (message "")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5422 ((gnus-open-server gnus-nntp-server gnus-nntp-service) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5423 (message "")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5424 (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5425 (error |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5426 (gnus-nntp-message |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5427 (format "Cannot open NNTP server on %s" gnus-nntp-server))))) |
257 | 5428 )) |
5429 | |
5430 ;; Dummy functions used only once. Should return nil. | |
5431 (defun gnus-server-opened () nil) | |
5432 (defun gnus-close-server () nil) | |
5433 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5434 (defun gnus-nntp-message (&optional message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5435 "Return a message returned from NNTP server. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5436 If no message is available and optional MESSAGE is given, return it." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5437 (let ((status (gnus-status-message)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5438 (message (or message ""))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5439 (if (and (stringp status) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5440 (> (length status) 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5441 status message))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5442 |
257 | 5443 (defun gnus-define-access-method (method &optional access-methods) |
5444 "Define access functions for the access METHOD. | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
5445 Methods definition is taken from optional argument ACCESS-METHODS or |
257 | 5446 the variable gnus-access-methods." |
5447 (let ((bindings | |
5448 (cdr (assoc method (or access-methods gnus-access-methods))))) | |
5449 (if (null bindings) | |
5450 (error "Unknown access method: %s" method) | |
5451 ;; Should not use symbol-function here since overload does not work. | |
5452 (while bindings | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5453 ;; Alist syntax is different from that of 3.14.3. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5454 (fset (car (car bindings)) (car (cdr (car bindings)))) |
257 | 5455 (setq bindings (cdr bindings))) |
5456 ))) | |
5457 | |
5458 (defun gnus-select-newsgroup (group &optional show-all) | |
5459 "Select newsgroup GROUP. | |
5460 If optional argument SHOW-ALL is non-nil, all of articles in the group | |
5461 are selected." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5462 ;; Make sure a connection to NNTP server is alive. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5463 (gnus-start-news-server) |
257 | 5464 (if (gnus-request-group group) |
5465 (let ((articles nil)) | |
5466 (setq gnus-newsgroup-name group) | |
5467 (setq gnus-newsgroup-unreads | |
5468 (gnus-uncompress-sequence | |
5469 (nthcdr 2 (gnus-gethash group gnus-unread-hashtb)))) | |
5470 (cond (show-all | |
5471 ;; Select all active articles. | |
5472 (setq articles | |
5473 (gnus-uncompress-sequence | |
5474 (nthcdr 2 (gnus-gethash group gnus-active-hashtb))))) | |
5475 (t | |
5476 ;; Select unread articles only. | |
5477 (setq articles gnus-newsgroup-unreads))) | |
5478 ;; Require confirmation if selecting large newsgroup. | |
5479 (setq gnus-newsgroup-unselected nil) | |
5480 (if (not (numberp gnus-large-newsgroup)) | |
5481 nil | |
5482 (let ((selected nil) | |
5483 (number (length articles))) | |
5484 (if (> number gnus-large-newsgroup) | |
5485 (progn | |
5486 (condition-case () | |
5487 (let ((input | |
5488 (read-string | |
5489 (format | |
5490 "How many articles from %s (default %d): " | |
5491 gnus-newsgroup-name number)))) | |
5492 (setq selected | |
5493 (if (string-equal input "") | |
5494 number (string-to-int input)))) | |
5495 (quit | |
5496 (setq selected 0))) | |
5497 (cond ((and (> selected 0) | |
5498 (< selected number)) | |
5499 ;; Select last N articles. | |
5500 (setq articles (nthcdr (- number selected) articles))) | |
5501 ((and (< selected 0) | |
5502 (< (- 0 selected) number)) | |
5503 ;; Select first N articles. | |
5504 (setq selected (- 0 selected)) | |
5505 (setq articles (copy-sequence articles)) | |
5506 (setcdr (nthcdr (1- selected) articles) nil)) | |
5507 ((zerop selected) | |
5508 (setq articles nil)) | |
5509 ;; Otherwise select all. | |
5510 ) | |
5511 ;; Get unselected unread articles. | |
5512 (setq gnus-newsgroup-unselected | |
5513 (gnus-set-difference gnus-newsgroup-unreads articles)) | |
5514 )) | |
5515 )) | |
5516 ;; Get headers list. | |
5517 (setq gnus-newsgroup-headers (gnus-retrieve-headers articles)) | |
5518 ;; UNREADS may contain expired articles, so we have to remove | |
5519 ;; them from the list. | |
5520 (setq gnus-newsgroup-unreads | |
5521 (gnus-intersection gnus-newsgroup-unreads | |
5522 (mapcar | |
5523 (function | |
5524 (lambda (header) | |
5525 (nntp-header-number header))) | |
5526 gnus-newsgroup-headers))) | |
5527 ;; Marked article must be a subset of unread articles. | |
5528 (setq gnus-newsgroup-marked | |
5529 (gnus-intersection (append gnus-newsgroup-unselected | |
5530 gnus-newsgroup-unreads) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5531 (cdr |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5532 (gnus-gethash group gnus-marked-hashtb)))) |
257 | 5533 ;; First and last article in this newsgroup. |
5534 (setq gnus-newsgroup-begin | |
5535 (if gnus-newsgroup-headers | |
5536 (nntp-header-number (car gnus-newsgroup-headers)) | |
5537 0 | |
5538 )) | |
5539 (setq gnus-newsgroup-end | |
5540 (if gnus-newsgroup-headers | |
5541 (nntp-header-number | |
5542 (gnus-last-element gnus-newsgroup-headers)) | |
5543 0 | |
5544 )) | |
5545 ;; File name that an article was saved last. | |
5546 (setq gnus-newsgroup-last-rmail nil) | |
5547 (setq gnus-newsgroup-last-mail nil) | |
5548 (setq gnus-newsgroup-last-folder nil) | |
5549 (setq gnus-newsgroup-last-file nil) | |
5550 ;; Reset article pointer etc. | |
5551 (setq gnus-current-article nil) | |
5552 (setq gnus-current-headers nil) | |
5553 (setq gnus-current-history nil) | |
5554 (setq gnus-have-all-headers nil) | |
5555 (setq gnus-last-article nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5556 ;; Clear old hash tables for the variable gnus-newsgroup-headers. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5557 (gnus-clear-hashtables-for-newsgroup-headers) |
257 | 5558 ;; GROUP is successfully selected. |
5559 t | |
5560 ) | |
5561 )) | |
5562 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5563 ;; Hacking for making header search much faster. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5564 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5565 (defun gnus-get-header-by-number (number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5566 "Return a header specified by a NUMBER. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5567 If the variable gnus-newsgroup-headers is updated, the hashed table |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5568 gnus-newsgroup-headers-hashtb-by-number must be set to nil to indicate |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5569 rehash is necessary." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5570 (or gnus-newsgroup-headers-hashtb-by-number |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5571 (gnus-make-headers-hashtable-by-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5572 (gnus-gethash (int-to-string number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5573 gnus-newsgroup-headers-hashtb-by-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5574 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5575 (defun gnus-get-header-by-id (id) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5576 "Return a header specified by an ID. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5577 If the variable gnus-newsgroup-headers is updated, the hashed table |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5578 gnus-newsgroup-headers-hashtb-by-id must be set to nil to indicate |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5579 rehash is necessary." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5580 (or gnus-newsgroup-headers-hashtb-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5581 (gnus-make-headers-hashtable-by-id)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5582 (and (stringp id) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5583 (gnus-gethash id gnus-newsgroup-headers-hashtb-by-id))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5584 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5585 (defun gnus-make-headers-hashtable-by-number () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5586 "Make hashtable for the variable gnus-newsgroup-headers by number." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5587 (let ((header nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5588 (headers gnus-newsgroup-headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5589 (setq gnus-newsgroup-headers-hashtb-by-number |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5590 (gnus-make-hashtable (length headers))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5591 (while headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5592 (setq header (car headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5593 (gnus-sethash (int-to-string (nntp-header-number header)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5594 header gnus-newsgroup-headers-hashtb-by-number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5595 (setq headers (cdr headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5596 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5597 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5598 (defun gnus-make-headers-hashtable-by-id () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5599 "Make hashtable for the variable gnus-newsgroup-headers by id." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5600 (let ((header nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5601 (headers gnus-newsgroup-headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5602 (setq gnus-newsgroup-headers-hashtb-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5603 (gnus-make-hashtable (length headers))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5604 (while headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5605 (setq header (car headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5606 (gnus-sethash (nntp-header-id header) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5607 header gnus-newsgroup-headers-hashtb-by-id) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5608 (setq headers (cdr headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5609 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5610 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5611 (defun gnus-clear-hashtables-for-newsgroup-headers () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5612 "Clear hash tables created for the variable gnus-newsgroup-headers." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5613 (setq gnus-newsgroup-headers-hashtb-by-id nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5614 (setq gnus-newsgroup-headers-hashtb-by-number nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5615 |
257 | 5616 (defun gnus-more-header-backward () |
5617 "Find new header backward." | |
5618 (let ((first | |
5619 (car (nth 2 (gnus-gethash gnus-newsgroup-name gnus-active-hashtb)))) | |
5620 (artnum gnus-newsgroup-begin) | |
5621 (header nil)) | |
5622 (while (and (not header) | |
5623 (> artnum first)) | |
5624 (setq artnum (1- artnum)) | |
5625 (setq header (car (gnus-retrieve-headers (list artnum))))) | |
5626 header | |
5627 )) | |
5628 | |
5629 (defun gnus-more-header-forward () | |
5630 "Find new header forward." | |
5631 (let ((last | |
5632 (cdr (nth 2 (gnus-gethash gnus-newsgroup-name gnus-active-hashtb)))) | |
5633 (artnum gnus-newsgroup-end) | |
5634 (header nil)) | |
5635 (while (and (not header) | |
5636 (< artnum last)) | |
5637 (setq artnum (1+ artnum)) | |
5638 (setq header (car (gnus-retrieve-headers (list artnum))))) | |
5639 header | |
5640 )) | |
5641 | |
5642 (defun gnus-extend-newsgroup (header &optional backward) | |
5643 "Extend newsgroup selection with HEADER. | |
5644 Optional argument BACKWARD means extend toward backward." | |
5645 (if header | |
5646 (let ((artnum (nntp-header-number header))) | |
5647 (setq gnus-newsgroup-headers | |
5648 (if backward | |
5649 (cons header gnus-newsgroup-headers) | |
5650 (append gnus-newsgroup-headers (list header)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5651 ;; Clear current hash tables for the variable gnus-newsgroup-headers. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5652 (gnus-clear-hashtables-for-newsgroup-headers) |
257 | 5653 ;; We have to update unreads and unselected, but don't have to |
5654 ;; care about gnus-newsgroup-marked. | |
5655 (if (memq artnum gnus-newsgroup-unselected) | |
5656 (setq gnus-newsgroup-unreads | |
5657 (cons artnum gnus-newsgroup-unreads))) | |
5658 (setq gnus-newsgroup-unselected | |
5659 (delq artnum gnus-newsgroup-unselected)) | |
5660 (setq gnus-newsgroup-begin (min gnus-newsgroup-begin artnum)) | |
5661 (setq gnus-newsgroup-end (max gnus-newsgroup-end artnum)) | |
5662 ))) | |
5663 | |
5664 (defun gnus-mark-article-as-read (article) | |
5665 "Remember that ARTICLE is marked as read." | |
5666 ;; Remove from unread and marked list. | |
5667 (setq gnus-newsgroup-unreads | |
5668 (delq article gnus-newsgroup-unreads)) | |
5669 (setq gnus-newsgroup-marked | |
5670 (delq article gnus-newsgroup-marked))) | |
5671 | |
5672 (defun gnus-mark-article-as-unread (article &optional clear-mark) | |
5673 "Remember that ARTICLE is marked as unread. | |
5674 Optional argument CLEAR-MARK means ARTICLE should not be remembered | |
5675 that it was marked as read once." | |
5676 ;; Add to unread list. | |
5677 (or (memq article gnus-newsgroup-unreads) | |
5678 (setq gnus-newsgroup-unreads | |
5679 (cons article gnus-newsgroup-unreads))) | |
5680 ;; If CLEAR-MARK is non-nil, the article must be removed from marked | |
5681 ;; list. Otherwise, it must be added to the list. | |
5682 (if clear-mark | |
5683 (setq gnus-newsgroup-marked | |
5684 (delq article gnus-newsgroup-marked)) | |
5685 (or (memq article gnus-newsgroup-marked) | |
5686 (setq gnus-newsgroup-marked | |
5687 (cons article gnus-newsgroup-marked))))) | |
5688 | |
5689 (defun gnus-clear-system () | |
5690 "Clear all variables and buffer." | |
5691 ;; Clear GNUS variables. | |
5692 (let ((variables gnus-variable-list)) | |
5693 (while variables | |
5694 (set (car variables) nil) | |
5695 (setq variables (cdr variables)))) | |
5696 ;; Clear other internal variables. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5697 (setq gnus-newsrc-hashtb nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5698 (setq gnus-marked-hashtb nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5699 (setq gnus-killed-hashtb nil) |
257 | 5700 (setq gnus-active-hashtb nil) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5701 (setq gnus-octive-hashtb nil) |
257 | 5702 (setq gnus-unread-hashtb nil) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5703 (setq gnus-newsgroup-headers nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5704 (setq gnus-newsgroup-headers-hashtb-by-id nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5705 (setq gnus-newsgroup-headers-hashtb-by-number nil) |
257 | 5706 ;; Kill the startup file. |
5707 (and gnus-current-startup-file | |
5708 (get-file-buffer gnus-current-startup-file) | |
5709 (kill-buffer (get-file-buffer gnus-current-startup-file))) | |
5710 (setq gnus-current-startup-file nil) | |
5711 ;; Kill GNUS buffers. | |
5712 (let ((buffers gnus-buffer-list)) | |
5713 (while buffers | |
5714 (if (get-buffer (car buffers)) | |
5715 (kill-buffer (car buffers))) | |
5716 (setq buffers (cdr buffers)) | |
5717 ))) | |
5718 | |
5719 (defun gnus-configure-windows (action) | |
5720 "Configure GNUS windows according to the next ACTION. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5721 The ACTION is either a symbol, such as `summary', or a |
257 | 5722 configuration list such as `(1 1 2)'. If ACTION is not a list, |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5723 configuration list is got from the variable gnus-window-configuration." |
257 | 5724 (let* ((windows |
5725 (if (listp action) | |
5726 action (car (cdr (assq action gnus-window-configuration))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5727 (grpwin (get-buffer-window gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5728 (subwin (get-buffer-window gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5729 (artwin (get-buffer-window gnus-article-buffer)) |
257 | 5730 (winsum nil) |
5731 (height nil) | |
5732 (grpheight 0) | |
5733 (subheight 0) | |
5734 (artheight 0)) | |
5735 (if (or (null windows) ;No configuration is specified. | |
5736 (and (eq (null grpwin) | |
5737 (zerop (nth 0 windows))) | |
5738 (eq (null subwin) | |
5739 (zerop (nth 1 windows))) | |
5740 (eq (null artwin) | |
5741 (zerop (nth 2 windows))))) | |
5742 ;; No need to change window configuration. | |
5743 nil | |
5744 (select-window (or grpwin subwin artwin (selected-window))) | |
5745 ;; First of all, compute the height of each window. | |
5746 (cond (gnus-use-full-window | |
5747 ;; Take up the entire screen. | |
5748 (delete-other-windows) | |
5749 (setq height (window-height (selected-window)))) | |
5750 (t | |
5751 (setq height (+ (if grpwin (window-height grpwin) 0) | |
5752 (if subwin (window-height subwin) 0) | |
5753 (if artwin (window-height artwin) 0))))) | |
5754 ;; The Newsgroup buffer exits always. So, use it to extend the | |
5755 ;; Group window so as to get enough window space. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5756 (switch-to-buffer gnus-group-buffer 'norecord) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5757 (and (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5758 (delete-windows-on gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5759 (and (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5760 (delete-windows-on gnus-article-buffer)) |
257 | 5761 ;; Compute expected window height. |
5762 (setq winsum (apply (function +) windows)) | |
5763 (if (not (zerop (nth 0 windows))) | |
5764 (setq grpheight (max window-min-height | |
5765 (/ (* height (nth 0 windows)) winsum)))) | |
5766 (if (not (zerop (nth 1 windows))) | |
5767 (setq subheight (max window-min-height | |
5768 (/ (* height (nth 1 windows)) winsum)))) | |
5769 (if (not (zerop (nth 2 windows))) | |
5770 (setq artheight (max window-min-height | |
5771 (/ (* height (nth 2 windows)) winsum)))) | |
5772 (setq height (+ grpheight subheight artheight)) | |
5773 (enlarge-window (max 0 (- height (window-height (selected-window))))) | |
5774 ;; Then split the window. | |
5775 (and (not (zerop artheight)) | |
5776 (or (not (zerop grpheight)) | |
5777 (not (zerop subheight))) | |
5778 (split-window-vertically (+ grpheight subheight))) | |
5779 (and (not (zerop grpheight)) | |
5780 (not (zerop subheight)) | |
5781 (split-window-vertically grpheight)) | |
5782 ;; Then select buffers in each window. | |
5783 (and (not (zerop grpheight)) | |
5784 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5785 (switch-to-buffer gnus-group-buffer 'norecord) |
257 | 5786 (other-window 1))) |
5787 (and (not (zerop subheight)) | |
5788 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5789 (switch-to-buffer gnus-summary-buffer 'norecord) |
257 | 5790 (other-window 1))) |
5791 (and (not (zerop artheight)) | |
5792 (progn | |
5793 ;; If Article buffer does not exist, it will be created | |
5794 ;; and initialized. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5795 (gnus-article-setup-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5796 (switch-to-buffer gnus-article-buffer 'norecord))) |
257 | 5797 ) |
5798 )) | |
5799 | |
5800 (defun gnus-find-header-by-number (headers number) | |
5801 "Return a header which is a element of HEADERS and has NUMBER." | |
5802 (let ((found nil)) | |
5803 (while (and headers (not found)) | |
5804 ;; We cannot use `=' to accept non-numeric NUMBER. | |
5805 (if (eq number (nntp-header-number (car headers))) | |
5806 (setq found (car headers))) | |
5807 (setq headers (cdr headers))) | |
5808 found | |
5809 )) | |
5810 | |
5811 (defun gnus-find-header-by-id (headers id) | |
5812 "Return a header which is a element of HEADERS and has Message-ID." | |
5813 (let ((found nil)) | |
5814 (while (and headers (not found)) | |
5815 (if (string-equal id (nntp-header-id (car headers))) | |
5816 (setq found (car headers))) | |
5817 (setq headers (cdr headers))) | |
5818 found | |
5819 )) | |
5820 | |
5821 (defun gnus-version () | |
5822 "Version numbers of this version of GNUS." | |
5823 (interactive) | |
5824 (cond ((and (boundp 'mhspool-version) (boundp 'nnspool-version)) | |
5825 (message "%s; %s; %s; %s" | |
5826 gnus-version nntp-version nnspool-version mhspool-version)) | |
5827 ((boundp 'mhspool-version) | |
5828 (message "%s; %s; %s" | |
5829 gnus-version nntp-version mhspool-version)) | |
5830 ((boundp 'nnspool-version) | |
5831 (message "%s; %s; %s" | |
5832 gnus-version nntp-version nnspool-version)) | |
5833 (t | |
5834 (message "%s; %s" gnus-version nntp-version)))) | |
5835 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5836 (defun gnus-info-find-node () |
257 | 5837 "Find Info documentation of GNUS." |
5838 (interactive) | |
5839 (require 'info) | |
5840 ;; Enlarge info window if needed. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5841 (cond ((eq major-mode 'gnus-group-mode) |
257 | 5842 (gnus-configure-windows '(1 0 0)) ;Take all windows. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5843 (pop-to-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5844 ((eq major-mode 'gnus-summary-mode) |
257 | 5845 (gnus-configure-windows '(0 1 0)) ;Take all windows. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5846 (pop-to-buffer gnus-summary-buffer))) |
2845
7a48e4a67e8c
(gnus-info-directory): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
2843
diff
changeset
|
5847 (Info-goto-node (car (cdr (assq major-mode gnus-info-nodes))))) |
257 | 5848 |
5849 (defun gnus-overload-functions (&optional overloads) | |
5850 "Overload functions specified by optional argument OVERLOADS. | |
5851 If nothing is specified, use the variable gnus-overload-functions." | |
5852 (let ((defs nil) | |
5853 (overloads (or overloads gnus-overload-functions))) | |
5854 (while overloads | |
5855 (setq defs (car overloads)) | |
5856 (setq overloads (cdr overloads)) | |
5857 ;; Load file before overloading function if necessary. Make | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
5858 ;; sure we cannot use `require' always. |
257 | 5859 (and (not (fboundp (car defs))) |
5860 (car (cdr (cdr defs))) | |
5861 (load (car (cdr (cdr defs))) nil 'nomessage)) | |
5862 (fset (car defs) (car (cdr defs))) | |
5863 ))) | |
5864 | |
5865 (defun gnus-make-threads (newsgroup-headers) | |
5866 "Make conversation threads tree from NEWSGROUP-HEADERS." | |
5867 (let ((headers newsgroup-headers) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5868 (refer nil) |
257 | 5869 (h nil) |
5870 (d nil) | |
5871 (roots nil) | |
5872 (dependencies nil)) | |
5873 ;; Make message dependency alist. | |
5874 (while headers | |
5875 (setq h (car headers)) | |
5876 (setq headers (cdr headers)) | |
5877 ;; Ignore invalid headers. | |
5878 (if (vectorp h) ;Depends on nntp.el. | |
5879 (progn | |
5880 ;; Ignore broken references, e.g "<123@a.b.c". | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5881 (setq refer (nntp-header-references h)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5882 (setq d (and refer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5883 (string-match "\\(<[^<>]+>\\)[^>]*$" refer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5884 ;; (gnus-find-header-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5885 ;; newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5886 ;; (substring refer (match-beginning 1) (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5887 ;; In fact if the variable newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5888 ;; is not 'equal' to the variable |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5889 ;; gnus-newsgroup-headers, the following |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5890 ;; function call may return bogus value. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5891 (gnus-get-header-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5892 (substring refer (match-beginning 1) (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5893 )) |
257 | 5894 ;; Check subject equality. |
5895 (or gnus-thread-ignore-subject | |
5896 (null d) | |
5897 (string-equal (gnus-simplify-subject | |
5898 (nntp-header-subject h) 're) | |
5899 (gnus-simplify-subject | |
5900 (nntp-header-subject d) 're)) | |
5901 ;; H should be a thread root. | |
5902 (setq d nil)) | |
5903 ;; H depends on D. | |
5904 (setq dependencies | |
5905 (cons (cons h d) dependencies)) | |
5906 ;; H is a thread root. | |
5907 (if (null d) | |
5908 (setq roots (cons h roots))) | |
5909 )) | |
5910 ) | |
5911 ;; Make complete threads from the roots. | |
5912 ;; Note: dependencies are in reverse order, but | |
5913 ;; gnus-make-threads-1 processes it in reverse order again. So, | |
5914 ;; we don't have to worry about it. | |
5915 (mapcar | |
5916 (function | |
5917 (lambda (root) | |
5918 (gnus-make-threads-1 root dependencies))) (nreverse roots)) | |
5919 )) | |
5920 | |
5921 (defun gnus-make-threads-1 (parent dependencies) | |
5922 (let ((children nil) | |
5923 (d nil) | |
5924 (depends dependencies)) | |
5925 ;; Find children. | |
5926 (while depends | |
5927 (setq d (car depends)) | |
5928 (setq depends (cdr depends)) | |
5929 (and (cdr d) | |
5930 (eq (nntp-header-id parent) (nntp-header-id (cdr d))) | |
5931 (setq children (cons (car d) children)))) | |
5932 ;; Go down. | |
5933 (cons parent | |
5934 (mapcar | |
5935 (function | |
5936 (lambda (child) | |
5937 (gnus-make-threads-1 child dependencies))) children)) | |
5938 )) | |
5939 | |
5940 (defun gnus-narrow-to-page (&optional arg) | |
5941 "Make text outside current page invisible except for page delimiter. | |
5942 A numeric arg specifies to move forward or backward by that many pages, | |
5943 thus showing a page other than the one point was originally in." | |
5944 (interactive "P") | |
5945 (setq arg (if arg (prefix-numeric-value arg) 0)) | |
5946 (save-excursion | |
5947 (forward-page -1) ;Beginning of current page. | |
5948 (widen) | |
5949 (if (> arg 0) | |
5950 (forward-page arg) | |
5951 (if (< arg 0) | |
5952 (forward-page (1- arg)))) | |
5953 ;; Find the end of the page. | |
5954 (forward-page) | |
5955 ;; If we stopped due to end of buffer, stay there. | |
5956 ;; If we stopped after a page delimiter, put end of restriction | |
5957 ;; at the beginning of that line. | |
5958 ;; These are commented out. | |
5959 ;; (if (save-excursion (beginning-of-line) | |
5960 ;; (looking-at page-delimiter)) | |
5961 ;; (beginning-of-line)) | |
5962 (narrow-to-region (point) | |
5963 (progn | |
5964 ;; Find the top of the page. | |
5965 (forward-page -1) | |
5966 ;; If we found beginning of buffer, stay there. | |
5967 ;; If extra text follows page delimiter on same line, | |
5968 ;; include it. | |
5969 ;; Otherwise, show text starting with following line. | |
5970 (if (and (eolp) (not (bobp))) | |
5971 (forward-line 1)) | |
5972 (point))) | |
5973 )) | |
5974 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5975 ;; Create hash table for alist, such as gnus-newsrc-assoc, |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5976 ;; gnus-killed-assoc, and gnus-marked-assoc. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5977 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5978 (defun gnus-make-hashtable-from-alist (alist &optional hashsize) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5979 "Return hash table for ALIST. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5980 Optional argument HASHSIZE specifies the hashtable size. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5981 Hash key is a car of alist element, which must be a string." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5982 (let ((hashtb (gnus-make-hashtable (or hashsize (length alist))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5983 (while alist |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5984 (gnus-sethash (car (car alist)) ;Newsgroup name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5985 (car alist) ;Alist element |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5986 hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5987 (setq alist (cdr alist))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5988 hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5989 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5990 |
257 | 5991 (defun gnus-last-element (list) |
5992 "Return last element of LIST." | |
5993 (let ((last nil)) | |
5994 (while list | |
5995 (if (null (cdr list)) | |
5996 (setq last (car list))) | |
5997 (setq list (cdr list))) | |
5998 last | |
5999 )) | |
6000 | |
6001 (defun gnus-set-difference (list1 list2) | |
6002 "Return a list of elements of LIST1 that do not appear in LIST2." | |
6003 (let ((list1 (copy-sequence list1))) | |
6004 (while list2 | |
6005 (setq list1 (delq (car list2) list1)) | |
6006 (setq list2 (cdr list2))) | |
6007 list1 | |
6008 )) | |
6009 | |
6010 (defun gnus-intersection (list1 list2) | |
6011 "Return a list of elements that appear in both LIST1 and LIST2." | |
6012 (let ((result nil)) | |
6013 (while list2 | |
6014 (if (memq (car list2) list1) | |
6015 (setq result (cons (car list2) result))) | |
6016 (setq list2 (cdr list2))) | |
6017 result | |
6018 )) | |
6019 | |
6020 | |
6021 ;;; | |
6022 ;;; Get information about active articles, already read articles, and | |
6023 ;;; still unread articles. | |
6024 ;;; | |
6025 | |
6026 ;; GNUS internal format of gnus-newsrc-assoc and gnus-killed-assoc: | |
6027 ;; (("general" t (1 . 1)) | |
6028 ;; ("misc" t (1 . 10) (12 . 15)) | |
6029 ;; ("test" nil (1 . 99)) ...) | |
6030 ;; GNUS internal format of gnus-marked-assoc: | |
6031 ;; (("general" 1 2 3) | |
6032 ;; ("misc" 2) ...) | |
6033 ;; GNUS internal format of gnus-active-hashtb: | |
6034 ;; (("general" t (1 . 1)) | |
6035 ;; ("misc" t (1 . 10)) | |
6036 ;; ("test" nil (1 . 99)) ...) | |
6037 ;; GNUS internal format of gnus-unread-hashtb: | |
6038 ;; (("general" 1 (1 . 1)) | |
6039 ;; ("misc" 14 (1 . 10) (12 . 15)) | |
6040 ;; ("test" 99 (1 . 99)) ...) | |
6041 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6042 (defun gnus-setup-news (&optional rawfile) |
257 | 6043 "Setup news information. |
6044 If optional argument RAWFILE is non-nil, force to read raw startup file." | |
6045 (let ((init (not (and gnus-newsrc-assoc | |
6046 gnus-active-hashtb | |
6047 gnus-unread-hashtb | |
6048 (not rawfile) | |
6049 )))) | |
6050 ;; We have to clear some variables to re-initialize news info. | |
6051 (if init | |
6052 (setq gnus-newsrc-assoc nil | |
6053 gnus-active-hashtb nil | |
6054 gnus-unread-hashtb nil)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6055 (gnus-read-active-file) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6056 ;; Initialize only once. |
257 | 6057 (if init |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6058 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6059 ;; Get distributions only once. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6060 (gnus-read-distributions-file) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6061 ;; newsrc file must be read after reading active file since |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6062 ;; its size is used to guess the size of gnus-newsrc-hashtb. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6063 (gnus-read-newsrc-file rawfile) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6064 )) |
257 | 6065 (gnus-expire-marked-articles) |
6066 (gnus-get-unread-articles) | |
6067 ;; Check new newsgroups and subscribe them. | |
6068 (if init | |
6069 (let ((new-newsgroups (gnus-find-new-newsgroups))) | |
6070 (while new-newsgroups | |
6071 (funcall gnus-subscribe-newsgroup-method (car new-newsgroups)) | |
6072 (setq new-newsgroups (cdr new-newsgroups)) | |
6073 ))) | |
6074 )) | |
6075 | |
6076 (defun gnus-add-newsgroup (newsgroup) | |
6077 "Subscribe new NEWSGROUP safely and put it at top." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6078 (and (null (gnus-gethash newsgroup gnus-newsrc-hashtb)) ;Really new? |
257 | 6079 (gnus-gethash newsgroup gnus-active-hashtb) ;Really exist? |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6080 (gnus-insert-newsgroup (or (gnus-gethash newsgroup gnus-killed-hashtb) |
257 | 6081 (list newsgroup t)) |
6082 (car (car gnus-newsrc-assoc))))) | |
6083 | |
6084 (defun gnus-find-new-newsgroups () | |
6085 "Looking for new newsgroups and return names. | |
6086 `-n' option of options line in .newsrc file is recognized." | |
6087 (let ((group nil) | |
6088 (new-newsgroups nil)) | |
6089 (mapatoms | |
6090 (function | |
6091 (lambda (sym) | |
6092 (setq group (symbol-name sym)) | |
6093 ;; Taking account of `-n' option. | |
6094 (and (or (null gnus-newsrc-options-n-no) | |
6095 (not (string-match gnus-newsrc-options-n-no group)) | |
6096 (and gnus-newsrc-options-n-yes | |
6097 (string-match gnus-newsrc-options-n-yes group))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6098 (null (gnus-gethash group gnus-killed-hashtb)) ;Ignore killed. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6099 (null (gnus-gethash group gnus-newsrc-hashtb)) ;Really new. |
257 | 6100 ;; Find new newsgroup. |
6101 (setq new-newsgroups | |
6102 (cons group new-newsgroups))) | |
6103 )) | |
6104 gnus-active-hashtb) | |
6105 ;; Return new newsgroups. | |
6106 new-newsgroups | |
6107 )) | |
6108 | |
6109 (defun gnus-kill-newsgroup (group) | |
6110 "Kill GROUP from gnus-newsrc-assoc, .newsrc and gnus-unread-hashtb." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6111 (let ((info (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 6112 (if (null info) |
6113 nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6114 ;; Delete from gnus-newsrc-assoc and gnus-newsrc-hashtb. |
257 | 6115 (setq gnus-newsrc-assoc (delq info gnus-newsrc-assoc)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6116 (gnus-sethash group nil gnus-newsrc-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6117 ;; Add to gnus-killed-assoc and gnus-killed-hashtb. |
257 | 6118 (setq gnus-killed-assoc |
6119 (cons info | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6120 (delq (gnus-gethash group gnus-killed-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6121 gnus-killed-assoc))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6122 (gnus-sethash group info gnus-killed-hashtb) |
257 | 6123 ;; Clear unread hashtable. |
6124 ;; Thanks cwitty@csli.Stanford.EDU (Carl Witty). | |
6125 (gnus-sethash group nil gnus-unread-hashtb) | |
6126 ;; Then delete from .newsrc | |
6127 (gnus-update-newsrc-buffer group 'delete) | |
6128 ;; Return the deleted newsrc entry. | |
6129 info | |
6130 ))) | |
6131 | |
6132 (defun gnus-insert-newsgroup (info &optional next) | |
6133 "Insert newsrc INFO entry before NEXT. | |
6134 If optional argument NEXT is nil, appended to the last." | |
6135 (if (null info) | |
6136 (error "Invalid argument: %s" info)) | |
6137 (let* ((group (car info)) ;Newsgroup name. | |
6138 (range | |
6139 (gnus-difference-of-range | |
6140 (nth 2 (gnus-gethash group gnus-active-hashtb)) (nthcdr 2 info)))) | |
6141 ;; Check duplication. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6142 (if (gnus-gethash group gnus-newsrc-hashtb) |
257 | 6143 (error "Duplicated: %s" group)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6144 ;; Insert to gnus-newsrc-assoc and gnus-newsrc-hashtb. |
257 | 6145 (if (string-equal next (car (car gnus-newsrc-assoc))) |
6146 (setq gnus-newsrc-assoc | |
6147 (cons info gnus-newsrc-assoc)) | |
6148 (let ((found nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6149 (rest (cdr gnus-newsrc-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6150 (tail gnus-newsrc-assoc)) |
257 | 6151 ;; Seach insertion point. |
6152 (while (and (not found) rest) | |
6153 (if (string-equal next (car (car rest))) | |
6154 (setq found t) | |
6155 (setq rest (cdr rest)) | |
6156 (setq tail (cdr tail)) | |
6157 )) | |
6158 ;; Find it. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6159 (if (consp tail) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6160 (setcdr tail (cons info rest)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6161 ;; gnus-newsrc-assoc must be nil. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6162 (setq gnus-newsrc-assoc |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6163 (append gnus-newsrc-assoc (cons info rest)))) |
257 | 6164 )) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6165 (gnus-sethash group info gnus-newsrc-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6166 ;; Delete from gnus-killed-assoc and gnus-killed-hashtb. |
257 | 6167 (setq gnus-killed-assoc |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6168 (delq (gnus-gethash group gnus-killed-hashtb) gnus-killed-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6169 (gnus-sethash group nil gnus-killed-hashtb) |
257 | 6170 ;; Then insert to .newsrc. |
6171 (gnus-update-newsrc-buffer group nil next) | |
6172 ;; Add to gnus-unread-hashtb. | |
6173 (gnus-sethash group | |
6174 (cons group ;Newsgroup name. | |
6175 (cons (gnus-number-of-articles range) range)) | |
6176 gnus-unread-hashtb) | |
6177 )) | |
6178 | |
6179 (defun gnus-check-killed-newsgroups () | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6180 "Check consistency between gnus-newsrc-assoc and gnus-killed-assoc. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6181 gnus-killed-hashtb is also updated." |
257 | 6182 (let ((group nil) |
6183 (new-killed nil) | |
6184 (old-killed gnus-killed-assoc)) | |
6185 (while old-killed | |
6186 (setq group (car (car old-killed))) | |
6187 (and (or (null gnus-newsrc-options-n-no) | |
6188 (not (string-match gnus-newsrc-options-n-no group)) | |
6189 (and gnus-newsrc-options-n-yes | |
6190 (string-match gnus-newsrc-options-n-yes group))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6191 (null (gnus-gethash group gnus-newsrc-hashtb)) ;No duplication. |
257 | 6192 ;; Subscribed in options line and not in gnus-newsrc-assoc. |
6193 (setq new-killed | |
6194 (cons (car old-killed) new-killed))) | |
6195 (setq old-killed (cdr old-killed)) | |
6196 ) | |
6197 (setq gnus-killed-assoc (nreverse new-killed)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6198 (setq gnus-killed-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6199 (gnus-make-hashtable-from-alist gnus-killed-assoc)) |
257 | 6200 )) |
6201 | |
6202 (defun gnus-check-bogus-newsgroups (&optional confirm) | |
6203 "Delete bogus newsgroups. | |
6204 If optional argument CONFIRM is non-nil, confirm deletion of newsgroups." | |
6205 (let ((group nil) ;Newsgroup name temporary used. | |
6206 (old-newsrc gnus-newsrc-assoc) | |
6207 (new-newsrc nil) | |
6208 (bogus nil) ;List of bogus newsgroups. | |
6209 (old-killed gnus-killed-assoc) | |
6210 (new-killed nil) | |
6211 (old-marked gnus-marked-assoc) | |
6212 (new-marked nil)) | |
6213 (message "Checking bogus newsgroups...") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6214 ;; Update gnus-newsrc-assoc and gnus-newsrc-hashtb. |
257 | 6215 (while old-newsrc |
6216 (setq group (car (car old-newsrc))) | |
6217 (if (or (gnus-gethash group gnus-active-hashtb) | |
6218 (and confirm | |
6219 (not (y-or-n-p | |
6220 (format "Delete bogus newsgroup: %s " group))))) | |
6221 ;; Active newsgroup. | |
6222 (setq new-newsrc (cons (car old-newsrc) new-newsrc)) | |
6223 ;; Found a bogus newsgroup. | |
6224 (setq bogus (cons group bogus))) | |
6225 (setq old-newsrc (cdr old-newsrc)) | |
6226 ) | |
6227 (setq gnus-newsrc-assoc (nreverse new-newsrc)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6228 (setq gnus-newsrc-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6229 (gnus-make-hashtable-from-alist gnus-newsrc-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6230 ;; Update gnus-killed-assoc and gnus-killed-hashtb. |
257 | 6231 ;; The killed newsgroups are deleted without any confirmations. |
6232 (while old-killed | |
6233 (setq group (car (car old-killed))) | |
6234 (and (gnus-gethash group gnus-active-hashtb) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6235 (null (gnus-gethash group gnus-newsrc-hashtb)) |
257 | 6236 ;; Active and really killed newsgroup. |
6237 (setq new-killed (cons (car old-killed) new-killed))) | |
6238 (setq old-killed (cdr old-killed)) | |
6239 ) | |
6240 (setq gnus-killed-assoc (nreverse new-killed)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6241 (setq gnus-killed-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6242 (gnus-make-hashtable-from-alist gnus-killed-assoc)) |
257 | 6243 ;; Remove BOGUS from .newsrc file. |
6244 (while bogus | |
6245 (gnus-update-newsrc-buffer (car bogus) 'delete) | |
6246 (setq bogus (cdr bogus))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6247 ;; Update gnus-marked-assoc and gnus-marked-hashtb. |
257 | 6248 (while old-marked |
6249 (setq group (car (car old-marked))) | |
6250 (if (and (cdr (car old-marked)) ;Non-empty? | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6251 (gnus-gethash group gnus-newsrc-hashtb)) ;Not bogus? |
257 | 6252 (setq new-marked (cons (car old-marked) new-marked))) |
6253 (setq old-marked (cdr old-marked))) | |
6254 (setq gnus-marked-assoc new-marked) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6255 (setq gnus-marked-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6256 (gnus-make-hashtable-from-alist gnus-marked-assoc)) |
257 | 6257 (message "Checking bogus newsgroups... done") |
6258 )) | |
6259 | |
6260 (defun gnus-get-unread-articles () | |
6261 "Compute diffs between active and read articles." | |
6262 (let ((read gnus-newsrc-assoc) | |
6263 (group-info nil) | |
6264 (group-name nil) | |
6265 (active nil) | |
6266 (range nil)) | |
6267 (message "Checking new news...") | |
6268 (or gnus-unread-hashtb | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6269 (setq gnus-unread-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6270 (gnus-make-hashtable (length gnus-active-hashtb)))) |
257 | 6271 (while read |
6272 (setq group-info (car read)) ;About one newsgroup | |
6273 (setq group-name (car group-info)) | |
6274 (setq active (nth 2 (gnus-gethash group-name gnus-active-hashtb))) | |
6275 (if (and gnus-octive-hashtb | |
6276 ;; Is nothing changed? | |
6277 (equal active | |
6278 (nth 2 (gnus-gethash group-name gnus-octive-hashtb))) | |
6279 ;; Is this newsgroup in the unread hash table? | |
6280 (gnus-gethash group-name gnus-unread-hashtb) | |
6281 ) | |
6282 nil ;Nothing to do. | |
6283 (setq range (gnus-difference-of-range active (nthcdr 2 group-info))) | |
6284 (gnus-sethash group-name | |
6285 (cons group-name ;Group name | |
6286 (cons (gnus-number-of-articles range) | |
6287 range)) ;Range of unread articles | |
6288 gnus-unread-hashtb) | |
6289 ) | |
6290 (setq read (cdr read)) | |
6291 ) | |
6292 (message "Checking new news... done") | |
6293 )) | |
6294 | |
6295 (defun gnus-expire-marked-articles () | |
6296 "Check expired article which is marked as unread." | |
6297 (let ((marked-assoc gnus-marked-assoc) | |
6298 (updated-assoc nil) | |
6299 (marked nil) ;Current marked info. | |
6300 (articles nil) ;List of marked articles. | |
6301 (updated nil) ;List of real marked. | |
6302 (begin nil)) | |
6303 (while marked-assoc | |
6304 (setq marked (car marked-assoc)) | |
6305 (setq articles (cdr marked)) | |
6306 (setq updated nil) | |
6307 (setq begin | |
6308 (car (nth 2 (gnus-gethash (car marked) gnus-active-hashtb)))) | |
6309 (while (and begin articles) | |
6310 (if (>= (car articles) begin) | |
6311 ;; This article is still active. | |
6312 (setq updated (cons (car articles) updated))) | |
6313 (setq articles (cdr articles))) | |
6314 (if updated | |
6315 (setq updated-assoc | |
6316 (cons (cons (car marked) updated) updated-assoc))) | |
6317 (setq marked-assoc (cdr marked-assoc))) | |
6318 (setq gnus-marked-assoc updated-assoc) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6319 (setq gnus-marked-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6320 (gnus-make-hashtable-from-alist gnus-marked-assoc)) |
257 | 6321 )) |
6322 | |
6323 (defun gnus-mark-as-read-by-xref | |
6324 (group headers unreads &optional subscribed-only) | |
6325 "Mark articles as read using cross references and return updated newsgroups. | |
6326 Arguments are GROUP, HEADERS, UNREADS, and optional SUBSCRIBED-ONLY." | |
6327 (let ((xref-list nil) | |
6328 (header nil) | |
6329 (xrefs nil) ;One Xref: field info. | |
6330 (xref nil) ;(NEWSGROUP . ARTICLE) | |
6331 (gname nil) ;Newsgroup name | |
6332 (article nil)) ;Article number | |
6333 (while headers | |
6334 (setq header (car headers)) | |
6335 (if (memq (nntp-header-number header) unreads) | |
6336 ;; This article is not yet marked as read. | |
6337 nil | |
6338 (setq xrefs (gnus-parse-xref-field (nntp-header-xref header))) | |
6339 ;; For each cross reference info. in one Xref: field. | |
6340 (while xrefs | |
6341 (setq xref (car xrefs)) | |
6342 (setq gname (car xref)) ;Newsgroup name | |
6343 (setq article (cdr xref)) ;Article number | |
6344 (or (string-equal group gname) ;Ignore current newsgroup. | |
6345 ;; Ignore unsubscribed newsgroup if requested. | |
6346 (and subscribed-only | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6347 (not (nth 1 (gnus-gethash gname gnus-newsrc-hashtb)))) |
257 | 6348 ;; Ignore article marked as unread. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6349 (memq article (cdr (gnus-gethash gname gnus-marked-hashtb))) |
257 | 6350 (let ((group-xref (assoc gname xref-list))) |
6351 (if group-xref | |
6352 (if (memq article (cdr group-xref)) | |
6353 nil ;Alread marked. | |
6354 (setcdr group-xref (cons article (cdr group-xref)))) | |
6355 ;; Create new assoc entry for GROUP. | |
6356 (setq xref-list (cons (list gname article) xref-list))) | |
6357 )) | |
6358 (setq xrefs (cdr xrefs)) | |
6359 )) | |
6360 (setq headers (cdr headers))) | |
6361 ;; Mark cross referenced articles as read. | |
6362 (gnus-mark-xrefed-as-read xref-list) | |
6363 ;;(message "%s %s" (prin1-to-string unreads) (prin1-to-string xref-list)) | |
6364 ;; Return list of updated group name. | |
6365 (mapcar (function car) xref-list) | |
6366 )) | |
6367 | |
6368 (defun gnus-parse-xref-field (xref-value) | |
6369 "Parse Xref: field value, and return list of `(group . article-id)'." | |
6370 (let ((xref-list nil) | |
6371 (xref-value (or xref-value ""))) | |
6372 ;; Remove server host name. | |
6373 (if (string-match "^[ \t]*[^ \t,]+[ \t,]+\\(.*\\)$" xref-value) | |
6374 (setq xref-value (substring xref-value (match-beginning 1))) | |
6375 (setq xref-value nil)) | |
6376 ;; Process each xref info. | |
6377 (while xref-value | |
6378 (if (string-match | |
6379 "^[ \t,]*\\([^ \t,]+\\):\\([0-9]+\\)[^0-9]*" xref-value) | |
6380 (progn | |
6381 (setq xref-list | |
6382 (cons | |
6383 (cons | |
6384 ;; Group name | |
6385 (substring xref-value (match-beginning 1) (match-end 1)) | |
6386 ;; Article-ID | |
6387 (string-to-int | |
6388 (substring xref-value (match-beginning 2) (match-end 2)))) | |
6389 xref-list)) | |
6390 (setq xref-value (substring xref-value (match-end 2)))) | |
6391 (setq xref-value nil))) | |
6392 ;; Return alist. | |
6393 xref-list | |
6394 )) | |
6395 | |
6396 (defun gnus-mark-xrefed-as-read (xrefs) | |
6397 "Update unread article information using XREFS alist." | |
6398 (let ((group nil) | |
6399 (idlist nil) | |
6400 (unread nil)) | |
6401 (while xrefs | |
6402 (setq group (car (car xrefs))) | |
6403 (setq idlist (cdr (car xrefs))) | |
6404 (setq unread (gnus-uncompress-sequence | |
6405 (nthcdr 2 (gnus-gethash group gnus-unread-hashtb)))) | |
6406 (while idlist | |
6407 (setq unread (delq (car idlist) unread)) | |
6408 (setq idlist (cdr idlist))) | |
6409 (gnus-update-unread-articles group unread 'ignore) | |
6410 (setq xrefs (cdr xrefs)) | |
6411 ))) | |
6412 | |
6413 (defun gnus-update-unread-articles (group unread-list marked-list) | |
6414 "Update unread articles of GROUP using UNREAD-LIST and MARKED-LIST." | |
6415 (let ((active (nth 2 (gnus-gethash group gnus-active-hashtb))) | |
6416 (unread (gnus-gethash group gnus-unread-hashtb))) | |
6417 (if (or (null active) (null unread)) | |
6418 ;; Ignore unknown newsgroup. | |
6419 nil | |
6420 ;; Update gnus-unread-hashtb. | |
6421 (if unread-list | |
6422 (setcdr (cdr unread) | |
6423 (gnus-compress-sequence unread-list)) | |
6424 ;; All of the articles are read. | |
6425 (setcdr (cdr unread) '((0 . 0)))) | |
6426 ;; Number of unread articles. | |
6427 (setcar (cdr unread) | |
6428 (gnus-number-of-articles (nthcdr 2 unread))) | |
6429 ;; Update gnus-newsrc-assoc. | |
6430 (if (> (car active) 0) | |
6431 ;; Articles from 1 to N are not active. | |
6432 (setq active (cons 1 (cdr active)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6433 (setcdr (cdr (gnus-gethash group gnus-newsrc-hashtb)) |
257 | 6434 (gnus-difference-of-range active (nthcdr 2 unread))) |
6435 ;; Update .newsrc buffer. | |
6436 (gnus-update-newsrc-buffer group) | |
6437 ;; Update gnus-marked-assoc. | |
6438 (if (listp marked-list) ;Includes NIL. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6439 (let ((marked (gnus-gethash group gnus-marked-hashtb))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6440 (cond (marked ;There is an entry. |
257 | 6441 (setcdr marked marked-list)) |
6442 (marked-list ;Non-NIL. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6443 (let ((info (cons group marked-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6444 ;; hashtb must share the same cons cell. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6445 (setq gnus-marked-assoc |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6446 (cons info gnus-marked-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6447 (gnus-sethash group info gnus-marked-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6448 )) |
257 | 6449 ))) |
6450 ))) | |
6451 | |
6452 (defun gnus-read-active-file () | |
6453 "Get active file from NNTP server." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6454 ;; Make sure a connection to NNTP server is alive. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6455 (gnus-start-news-server) |
257 | 6456 (message "Reading active file...") |
6457 (if (gnus-request-list) ;Get active file from server | |
6458 (save-excursion | |
6459 (set-buffer nntp-server-buffer) | |
6460 (gnus-active-to-gnus-format) | |
6461 (message "Reading active file... done")) | |
6462 (error "Cannot read active file from NNTP server."))) | |
6463 | |
6464 (defun gnus-active-to-gnus-format () | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6465 "Convert active file format to internal format. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6466 Lines matching gnus-ignored-newsgroups are ignored." |
257 | 6467 ;; Delete unnecessary lines. |
6468 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6469 ;;(delete-matching-lines "^to\\..*$") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6470 (delete-matching-lines gnus-ignored-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6471 ;; Save OLD active info. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6472 (setq gnus-octive-hashtb gnus-active-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6473 ;; Make large enough hash table. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6474 (setq gnus-active-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6475 (gnus-make-hashtable (count-lines (point-min) (point-max)))) |
257 | 6476 ;; Store active file in hashtable. |
6477 (goto-char (point-min)) | |
6478 (while | |
6479 (re-search-forward | |
6480 "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([ymn]\\).*$" | |
6481 nil t) | |
6482 (gnus-sethash | |
6483 (buffer-substring (match-beginning 1) (match-end 1)) | |
6484 (list (buffer-substring (match-beginning 1) (match-end 1)) | |
6485 (string-equal | |
6486 "y" (buffer-substring (match-beginning 4) (match-end 4))) | |
6487 (cons (string-to-int | |
6488 (buffer-substring (match-beginning 3) (match-end 3))) | |
6489 (string-to-int | |
6490 (buffer-substring (match-beginning 2) (match-end 2))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6491 gnus-active-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6492 )) |
257 | 6493 |
6494 (defun gnus-read-newsrc-file (&optional rawfile) | |
6495 "Read startup FILE. | |
6496 If optional argument RAWFILE is non-nil, the raw startup file is read." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6497 (setq gnus-current-startup-file (gnus-make-newsrc-file gnus-startup-file)) |
257 | 6498 ;; Reset variables which may be included in the quick startup file. |
6499 (let ((variables gnus-variable-list)) | |
6500 (while variables | |
6501 (set (car variables) nil) | |
6502 (setq variables (cdr variables)))) | |
6503 (let* ((newsrc-file gnus-current-startup-file) | |
6504 (quick-file (concat newsrc-file ".el")) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6505 (quick-loaded nil)) |
257 | 6506 (save-excursion |
6507 ;; Prepare .newsrc buffer. | |
6508 (set-buffer (find-file-noselect newsrc-file)) | |
6509 ;; It is not so good idea turning off undo. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6510 ;;(buffer-flush-undo (current-buffer)) |
257 | 6511 ;; Load quick .newsrc to restore gnus-marked-assoc and |
6512 ;; gnus-killed-assoc even if gnus-newsrc-assoc is out of date. | |
6513 (condition-case nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6514 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6515 (setq quick-loaded (load quick-file t t t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6516 ;; Recreate hashtables. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6517 (setq gnus-killed-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6518 (gnus-make-hashtable-from-alist gnus-killed-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6519 (setq gnus-marked-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6520 (gnus-make-hashtable-from-alist gnus-marked-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6521 ) |
257 | 6522 (error nil)) |
6523 (cond ((and (not rawfile) ;Not forced to read the raw file. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6524 ;; .newsrc.el is newer than .newsrc. |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
6525 ;; Do it this way in case timestamps are identical |
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
6526 ;; (on fast machines/disks). |
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
6527 (not (file-newer-than-file-p newsrc-file quick-file)) |
257 | 6528 quick-loaded |
6529 gnus-newsrc-assoc ;Really loaded? | |
6530 ) | |
6531 ;; We don't have to read the raw startup file. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6532 ;; gnus-newsrc-assoc may be defined in the quick startup file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6533 ;; So, we have to define the hashtable here. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6534 (setq gnus-newsrc-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6535 (gnus-make-hashtable-from-alist gnus-newsrc-assoc))) |
257 | 6536 (t |
6537 ;; Since .newsrc file is newer than quick file, read it. | |
6538 (message "Reading %s..." newsrc-file) | |
6539 (gnus-newsrc-to-gnus-format) | |
6540 (gnus-check-killed-newsgroups) | |
6541 (message "Reading %s... Done" newsrc-file))) | |
6542 ))) | |
6543 | |
6544 (defun gnus-make-newsrc-file (file) | |
6545 "Make server dependent file name by catenating FILE and server host name." | |
6546 (let* ((file (expand-file-name file nil)) | |
6547 (real-file (concat file "-" gnus-nntp-server))) | |
6548 (if (file-exists-p real-file) | |
6549 real-file file) | |
6550 )) | |
6551 | |
6552 (defun gnus-newsrc-to-gnus-format () | |
6553 "Parse current buffer as .newsrc file." | |
6554 (let ((newsgroup nil) | |
6555 (subscribe nil) | |
6556 (ranges nil) | |
6557 (subrange nil) | |
6558 (read-list nil)) | |
6559 ;; We have to re-initialize these variable (except for | |
6560 ;; gnus-marked-assoc and gnus-killed-assoc) because quick startup | |
6561 ;; file may contain bogus values. | |
6562 (setq gnus-newsrc-options nil) | |
6563 (setq gnus-newsrc-options-n-yes nil) | |
6564 (setq gnus-newsrc-options-n-no nil) | |
6565 (setq gnus-newsrc-assoc nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6566 ;; Make large enough hash table. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6567 (setq gnus-newsrc-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6568 (gnus-make-hashtable |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6569 (max (length gnus-active-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6570 (count-lines (point-min) (point-max))))) |
257 | 6571 ;; Save options line to variable. |
6572 ;; Lines beginning with white spaces are treated as continuation | |
6573 ;; line. Refer man page of newsrc(5). | |
6574 (goto-char (point-min)) | |
6575 (if (re-search-forward | |
6576 "^[ \t]*options[ \t]*\\(.*\\(\n[ \t]+.*\\)*\\)[ \t]*$" nil t) | |
6577 (progn | |
6578 ;; Save entire options line. | |
6579 (setq gnus-newsrc-options | |
6580 (buffer-substring (match-beginning 1) (match-end 1))) | |
6581 ;; Compile "-n" option. | |
6582 (if (string-match "\\(^\\|[ \t\n]\\)-n" gnus-newsrc-options) | |
6583 (let ((yes-and-no | |
6584 (gnus-parse-n-options | |
6585 (substring gnus-newsrc-options (match-end 0))))) | |
6586 (setq gnus-newsrc-options-n-yes (car yes-and-no)) | |
6587 (setq gnus-newsrc-options-n-no (cdr yes-and-no)) | |
6588 )) | |
6589 )) | |
6590 ;; Parse body of .newsrc file | |
6591 ;; Options line continuation lines must be also considered here. | |
6592 ;; Before supporting continuation lines, " newsgroup ! 1-5" was | |
6593 ;; okay, but now it is invalid. It should be "newsgroup! 1-5". | |
6594 (goto-char (point-min)) | |
7793
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6595 ;; We used this regexp, but it caused overflows. |
257 | 6596 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(.*\\)$" |
3610
b0c94b723e6a
* gnus.el (gnus-newsrc-to-gnus-format): Change regexp which
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
6597 ;; Suggested by composer@bucsf.bu.edu (Jeff Kellem) |
b0c94b723e6a
* gnus.el (gnus-newsrc-to-gnus-format): Change regexp which
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
6598 ;; but no longer viable because of extensive backtracking in Emacs 19: |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6599 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(\\(...\\)*.*\\)$" |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6600 ;; but, the following causes trouble on some case: |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6601 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(\\|[^ \t\n].*\\)$" |
7793
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6602 ;; So now we don't try to match the tail of the line at all. |
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6603 ;; It's just as easy to extract it later. |
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6604 (while (re-search-forward "^\\([^:! \t\n]+\\)\\([:!]\\)" |
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6605 nil t) |
257 | 6606 (setq newsgroup (buffer-substring (match-beginning 1) (match-end 1))) |
6607 ;; Check duplications of newsgroups. | |
6608 ;; Note: Checking the duplications takes very long time. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6609 (if (gnus-gethash newsgroup gnus-newsrc-hashtb) |
257 | 6610 (message "Ignore duplicated newsgroup: %s" newsgroup) |
6611 (setq subscribe | |
6612 (string-equal | |
6613 ":" (buffer-substring (match-beginning 2) (match-end 2)))) | |
7793
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6614 (skip-chars-forward " \t") |
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6615 (setq ranges (buffer-substring (point) (save-excursion |
4a683dc76931
(gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents:
7705
diff
changeset
|
6616 (end-of-line) (point)))) |
257 | 6617 (setq read-list nil) |
6618 (while (string-match "^[, \t]*\\([0-9-]+\\)" ranges) | |
6619 (setq subrange (substring ranges (match-beginning 1) (match-end 1))) | |
6620 (setq ranges (substring ranges (match-end 1))) | |
6621 (cond ((string-match "^\\([0-9]+\\)-\\([0-9]+\\)$" subrange) | |
6622 (setq read-list | |
6623 (cons | |
6624 (cons (string-to-int | |
6625 (substring subrange | |
6626 (match-beginning 1) (match-end 1))) | |
6627 (string-to-int | |
6628 (substring subrange | |
6629 (match-beginning 2) (match-end 2)))) | |
6630 read-list))) | |
6631 ((string-match "^[0-9]+$" subrange) | |
6632 (setq read-list | |
6633 (cons (cons (string-to-int subrange) | |
6634 (string-to-int subrange)) | |
6635 read-list))) | |
6636 (t | |
6637 (ding) (message "Ignoring bogus lines of %s" newsgroup) | |
6638 (sit-for 0)) | |
6639 )) | |
6640 (setq gnus-newsrc-assoc | |
6641 (cons (cons newsgroup (cons subscribe (nreverse read-list))) | |
6642 gnus-newsrc-assoc)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6643 ;; Update gnus-newsrc-hashtb one by one. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6644 (gnus-sethash newsgroup (car gnus-newsrc-assoc) gnus-newsrc-hashtb) |
257 | 6645 )) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6646 (setq gnus-newsrc-assoc (nreverse gnus-newsrc-assoc)) |
257 | 6647 )) |
6648 | |
6649 (defun gnus-parse-n-options (options) | |
6650 "Parse -n NEWSGROUPS options and return a cons of YES and NO regexps." | |
6651 (let ((yes nil) | |
6652 (no nil) | |
6653 (yes-or-no nil) ;`!' or not. | |
6654 (newsgroup nil)) | |
6655 ;; Parse each newsgroup description such as "comp.all". Commas | |
6656 ;; and white spaces can be a newsgroup separator. | |
6657 (while | |
6309
9217f29851c2
Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents:
5911
diff
changeset
|
6658 (string-match "^[ \t\n,]*\\(!?\\)\\([^- \t\n,][^ \t\n,]*\\)" options) |
257 | 6659 (setq yes-or-no |
6660 (substring options (match-beginning 1) (match-end 1))) | |
6661 (setq newsgroup | |
6662 (regexp-quote | |
6663 (substring options | |
6664 (match-beginning 2) (match-end 2)))) | |
6665 (setq options (substring options (match-end 2))) | |
6666 ;; Rewrite "all" to ".+" not ".*". ".+" requires at least one | |
6667 ;; character. | |
6668 (while (string-match "\\(^\\|\\\\[.]\\)all\\(\\\\[.]\\|$\\)" newsgroup) | |
6669 (setq newsgroup | |
6670 (concat (substring newsgroup 0 (match-end 1)) | |
6671 ".+" | |
6672 (substring newsgroup (match-beginning 2))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6673 ;; It is yes or no. |
257 | 6674 (cond ((string-equal yes-or-no "!") |
6675 (setq no (cons newsgroup no))) | |
6676 ((string-equal newsgroup ".+")) ;Ignore `all'. | |
6677 (t | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6678 (setq yes (cons newsgroup yes)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6679 ) |
257 | 6680 ;; Make a cons of regexps from parsing result. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6681 ;; We have to append \(\.\|$\) to prevent matching substring of |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6682 ;; newsgroup. For example, "jp.net" should not match with |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6683 ;; "jp.network". |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6684 ;; Fixes for large regexp problems are from yonezu@nak.math.keio.ac.jp. |
257 | 6685 (cons (if yes |
6686 (concat "^\\(" | |
6687 (apply (function concat) | |
6688 (mapcar | |
6689 (function | |
6690 (lambda (newsgroup) | |
6691 (concat newsgroup "\\|"))) | |
6692 (cdr yes))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6693 (car yes) "\\)\\(\\.\\|$\\)")) |
257 | 6694 (if no |
6695 (concat "^\\(" | |
6696 (apply (function concat) | |
6697 (mapcar | |
6698 (function | |
6699 (lambda (newsgroup) | |
6700 (concat newsgroup "\\|"))) | |
6701 (cdr no))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6702 (car no) "\\)\\(\\.\\|$\\)"))) |
257 | 6703 )) |
6704 | |
6705 (defun gnus-save-newsrc-file () | |
6706 "Save to .newsrc FILE." | |
6707 ;; Note: We cannot save .newsrc file if all newsgroups are removed | |
6708 ;; from the variable gnus-newsrc-assoc. | |
6709 (and (or gnus-newsrc-assoc gnus-killed-assoc) | |
6710 gnus-current-startup-file | |
6711 (save-excursion | |
6712 ;; A buffer containing .newsrc file may be deleted. | |
6713 (set-buffer (find-file-noselect gnus-current-startup-file)) | |
6714 (if (not (buffer-modified-p)) | |
6715 (message "(No changes need to be saved)") | |
6716 (message "Saving %s..." gnus-current-startup-file) | |
6717 (let ((make-backup-files t) | |
6718 (version-control nil) | |
6719 (require-final-newline t)) ;Don't ask even if requested. | |
6720 ;; Make backup file of master newsrc. | |
6721 ;; You can stop or change version control of backup file. | |
6722 ;; Suggested by jason@violet.berkeley.edu. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6723 (run-hooks 'gnus-save-newsrc-hook) |
257 | 6724 (save-buffer)) |
6725 ;; Quickly loadable .newsrc. | |
6726 (set-buffer (get-buffer-create " *GNUS-newsrc*")) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6727 (buffer-flush-undo (current-buffer)) |
257 | 6728 (erase-buffer) |
6729 (gnus-gnus-to-quick-newsrc-format) | |
6730 (let ((make-backup-files nil) | |
6731 (version-control nil) | |
6732 (require-final-newline t)) ;Don't ask even if requested. | |
6733 (write-file (concat gnus-current-startup-file ".el"))) | |
6734 (kill-buffer (current-buffer)) | |
6735 (message "Saving %s... Done" gnus-current-startup-file) | |
6736 )) | |
6737 )) | |
6738 | |
6739 (defun gnus-update-newsrc-buffer (group &optional delete next) | |
6740 "Incrementally update .newsrc buffer about GROUP. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6741 If optional 1st argument DELETE is non-nil, delete the group. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6742 If optional 2nd argument NEXT is non-nil, inserted before it." |
257 | 6743 (save-excursion |
6744 ;; Taking account of the killed startup file. | |
6745 ;; Suggested by tale@pawl.rpi.edu. | |
6746 (set-buffer (or (get-file-buffer gnus-current-startup-file) | |
6747 (find-file-noselect gnus-current-startup-file))) | |
6748 ;; Options line continuation lines must be also considered here. | |
6749 ;; Before supporting continuation lines, " newsgroup ! 1-5" was | |
6750 ;; okay, but now it is invalid. It should be "newsgroup! 1-5". | |
6751 (let ((deleted nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6752 (case-fold-search nil) ;Should NOT ignore case. |
257 | 6753 (buffer-read-only nil)) ;May be not modifiable. |
6754 ;; Delete ALL entries which match for GROUP. | |
6755 (goto-char (point-min)) | |
6756 (while (re-search-forward | |
6757 (concat "^" (regexp-quote group) "[:!]") nil t) | |
6758 (beginning-of-line) | |
6759 (delete-region (point) (progn (forward-line 1) (point))) | |
6760 (setq deleted t) ;Old entry is deleted. | |
6761 ) | |
6762 (if delete | |
6763 nil | |
6764 ;; Insert group entry. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6765 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 6766 (if (null newsrc) |
6767 nil | |
6768 ;; Find insertion point. | |
6769 (cond (deleted nil) ;Insert here. | |
6770 ((and (stringp next) | |
6771 (progn | |
6772 (goto-char (point-min)) | |
6773 (re-search-forward | |
6774 (concat "^" (regexp-quote next) "[:!]") nil t))) | |
6775 (beginning-of-line)) | |
6776 (t | |
6777 (goto-char (point-max)) | |
6778 (or (bolp) | |
6779 (insert "\n")))) | |
6780 ;; Insert after options line. | |
6781 (if (looking-at "^[ \t]*options\\([ \t]\\|$\\)") | |
6782 (progn | |
6783 (forward-line 1) | |
6784 ;; Skip continuation lines. | |
6785 (while (and (not (eobp)) | |
6786 (looking-at "^[ \t]+")) | |
6787 (forward-line 1)))) | |
6788 (insert group ;Group name | |
6789 (if (nth 1 newsrc) ": " "! ")) ;Subscribed? | |
6790 (gnus-ranges-to-newsrc-format (nthcdr 2 newsrc)) ;Read articles | |
6791 (insert "\n") | |
6792 ))) | |
6793 ))) | |
6794 | |
6795 (defun gnus-gnus-to-quick-newsrc-format () | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6796 "Insert GNUS variables such as gnus-newsrc-assoc in lisp format." |
257 | 6797 (insert ";; GNUS internal format of .newsrc.\n") |
6798 (insert ";; Touch .newsrc instead if you think to remove this file.\n") | |
6799 (let ((variable nil) | |
6800 (variables gnus-variable-list) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6801 ;; Temporary rebind to make changes |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6802 ;; gnus-check-killed-newsgroups in invisible. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6803 (gnus-killed-assoc gnus-killed-assoc) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6804 (gnus-killed-hashtb gnus-killed-hashtb)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6805 ;; Remove duplicated or unsubscribed newsgroups in |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6806 ;; gnus-killed-assoc (and gnus-killed-hashtb). |
257 | 6807 (gnus-check-killed-newsgroups) |
6808 ;; Then, insert lisp expressions. | |
6809 (while variables | |
6810 (setq variable (car variables)) | |
6811 (and (boundp variable) | |
6812 (symbol-value variable) | |
6813 (insert "(setq " (symbol-name variable) " '" | |
6814 (prin1-to-string (symbol-value variable)) | |
6815 ")\n")) | |
6816 (setq variables (cdr variables))) | |
6817 )) | |
6818 | |
6819 (defun gnus-ranges-to-newsrc-format (ranges) | |
6820 "Insert ranges of read articles." | |
6821 (let ((range nil)) ;Range is a pair of BEGIN and END. | |
6822 (while ranges | |
6823 (setq range (car ranges)) | |
6824 (setq ranges (cdr ranges)) | |
6825 (cond ((= (car range) (cdr range)) | |
6826 (if (= (car range) 0) | |
6827 (setq ranges nil) ;No unread articles. | |
6828 (insert (int-to-string (car range))) | |
6829 (if ranges (insert ",")) | |
6830 )) | |
6831 (t | |
6832 (insert (int-to-string (car range)) | |
6833 "-" | |
6834 (int-to-string (cdr range))) | |
6835 (if ranges (insert ",")) | |
6836 )) | |
6837 ))) | |
6838 | |
6839 (defun gnus-compress-sequence (numbers) | |
6840 "Convert list of sorted numbers to ranges." | |
6841 (let* ((numbers (sort (copy-sequence numbers) (function <))) | |
6842 (first (car numbers)) | |
6843 (last (car numbers)) | |
6844 (result nil)) | |
6845 (while numbers | |
6846 (cond ((= last (car numbers)) nil) ;Omit duplicated number | |
6847 ((= (1+ last) (car numbers)) ;Still in sequence | |
6848 (setq last (car numbers))) | |
6849 (t ;End of one sequence | |
6850 (setq result (cons (cons first last) result)) | |
6851 (setq first (car numbers)) | |
6852 (setq last (car numbers))) | |
6853 ) | |
6854 (setq numbers (cdr numbers)) | |
6855 ) | |
6856 (nreverse (cons (cons first last) result)) | |
6857 )) | |
6858 | |
6859 (defun gnus-uncompress-sequence (ranges) | |
6860 "Expand compressed format of sequence." | |
6861 (let ((first nil) | |
6862 (last nil) | |
6863 (result nil)) | |
6864 (while ranges | |
6865 (setq first (car (car ranges))) | |
6866 (setq last (cdr (car ranges))) | |
6867 (while (< first last) | |
6868 (setq result (cons first result)) | |
6869 (setq first (1+ first))) | |
6870 (setq result (cons first result)) | |
6871 (setq ranges (cdr ranges)) | |
6872 ) | |
6873 (nreverse result) | |
6874 )) | |
6875 | |
6876 (defun gnus-number-of-articles (range) | |
6877 "Compute number of articles from RANGE `((beg1 . end1) (beg2 . end2) ...)'." | |
6878 (let ((count 0)) | |
6879 (while range | |
6880 (if (/= (cdr (car range)) 0) | |
6881 ;; If end1 is 0, it must be skipped. Usually no articles in | |
6882 ;; this group. | |
6883 (setq count (+ count 1 (- (cdr (car range)) (car (car range)))))) | |
6884 (setq range (cdr range)) | |
6885 ) | |
6886 count ;Result | |
6887 )) | |
6888 | |
6889 (defun gnus-difference-of-range (src obj) | |
6890 "Compute (SRC - OBJ) on range. | |
6891 Range of SRC is expressed as `(beg . end)'. | |
6892 Range of OBJ is expressed as `((beg1 . end1) (beg2 . end2) ...)." | |
6893 (let ((beg (car src)) | |
6894 (end (cdr src)) | |
6895 (range nil)) ;This is result. | |
6896 ;; Src may be nil. | |
6897 (while (and src obj) | |
6898 (let ((beg1 (car (car obj))) | |
6899 (end1 (cdr (car obj)))) | |
6900 (cond ((> beg end) | |
6901 (setq obj nil)) ;Terminate loop | |
6902 ((< beg beg1) | |
6903 (setq range (cons (cons beg (min (1- beg1) end)) range)) | |
6904 (setq beg (1+ end1))) | |
6905 ((>= beg beg1) | |
6906 (setq beg (max beg (1+ end1)))) | |
6907 ) | |
6908 (setq obj (cdr obj)) ;Next OBJ | |
6909 )) | |
6910 ;; Src may be nil. | |
6911 (if (and src (<= beg end)) | |
6912 (setq range (cons (cons beg end) range))) | |
6913 ;; Result | |
6914 (if range | |
6915 (nreverse range) | |
6916 (list (cons 0 0))) | |
6917 )) | |
6918 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6919 (defun gnus-read-distributions-file () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6920 "Get distributions file from NNTP server (NNTP2 functionality)." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6921 ;; Make sure a connection to NNTP server is alive. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6922 (gnus-start-news-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6923 (message "Reading distributions file...") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6924 (setq gnus-distribution-list nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6925 (if (gnus-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6926 (save-excursion |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6927 (set-buffer nntp-server-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6928 (gnus-distributions-to-gnus-format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6929 (message "Reading distributions file... done")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6930 ;; It's not a fatal error. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6931 ;;(error "Cannot read distributions file from NNTP server.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6932 ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6933 ;; Merge with user supplied default distributions. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6934 (let ((defaults (reverse gnus-local-distributions)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6935 (dist nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6936 (while defaults |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6937 (setq dist (assoc (car defaults) gnus-distribution-list)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6938 (if dist |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6939 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6940 (delq dist gnus-distribution-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6941 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6942 (cons (list (car defaults)) gnus-distribution-list)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6943 (setq defaults (cdr defaults)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6944 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6945 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6946 (defun gnus-distributions-to-gnus-format () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6947 "Convert distributions file format to internal format." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6948 (setq gnus-distribution-list nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6949 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6950 (while (re-search-forward "^\\([^ \t\n]+\\).*$" nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6951 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6952 (cons (list (buffer-substring (match-beginning 1) (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6953 gnus-distribution-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6954 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6955 (nreverse gnus-distribution-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6956 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6957 ;; Some older version of GNU Emacs does not support function |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6958 ;; `file-newer-than-file-p'. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6959 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6960 (or (fboundp 'file-newer-than-file-p) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6961 (defun file-newer-than-file-p (file1 file2) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6962 "Return t if file FILE1 is newer than file FILE2. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6963 If FILE1 does not exist, the answer is nil; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6964 otherwise, if FILE2 does not exist, the answer is t." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6965 (let ((mod1 (nth 5 (file-attributes file1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6966 (mod2 (nth 5 (file-attributes file2)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6967 (cond ((not (file-exists-p file1)) nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6968 ((not (file-exists-p file2)) t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6969 ((and mod2 mod1) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6970 (or (< (car mod2) (car mod1)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6971 (and (= (car mod2) (car mod1)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6972 (<= (nth 1 mod2) (nth 1 mod1))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6973 )))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6974 |
257 | 6975 |
6976 ;;Local variables: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6977 ;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1) |
257 | 6978 ;;end: |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6979 |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6980 ;;; gnus.el ends here |