Mercurial > emacs
annotate lisp/=gnus.el @ 5336:4521917cdd6e
(unload-feature): Ignore conses in the feature-symbols.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 24 Dec 1993 07:29:39 +0000 |
parents | 3189e46001fd |
children | d3e04700d190 |
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 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2 ;; Copyright (C) 1987, 1988, 1989, 1990, 1993 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> |
5313
3189e46001fd
(gnus-capitalize-newsgroup): Modify a new temporary
Richard M. Stallman <rms@gnu.org>
parents:
5057
diff
changeset
|
5 ;; Version: $Header: /home/fsf/rms/e19/lisp/RCS/gnus.el,v 1.30 1993/11/17 13:41:50 rms Exp $ |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6 ;; Keywords: news |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
716
diff
changeset
|
7 |
257 | 8 ;; This file is part of GNU Emacs. |
9 | |
711
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
10 ;; 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
|
11 ;; 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
|
12 ;; 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
|
13 ;; any later version. |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
14 |
257 | 15 ;; 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
|
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
18 ;; GNU General Public License for more details. |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
19 |
22b98190b7ef
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
660
diff
changeset
|
20 ;; 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
|
21 ;; 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
|
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
257 | 23 |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
716
diff
changeset
|
24 ;;; Commentary: |
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
716
diff
changeset
|
25 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
26 ;; How to Install GNUS: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
27 ;; (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
|
28 ;; nntp.elc). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
29 ;; (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
|
30 ;; nntp.el. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
31 ;; (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
|
32 ;; 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
|
33 ;; byte-compile-file nnspool.el, too. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
34 ;; (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
|
35 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
36 ;; setenv NNTPSERVER flab |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
37 ;; setenv DOMAINNAME "stars.flab.Fujitsu.CO.JP" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
38 ;; setenv ORGANIZATION "Fujitsu Laboratories Ltd., Kawasaki, Japan." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
39 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
40 ;; 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
|
41 ;; or default.el as follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
42 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
43 ;; (setq gnus-nntp-server "flab") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
44 ;; (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
|
45 ;; (setq gnus-local-organization "Fujitsu Laboratories Ltd., ...") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
46 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
47 ;; 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
|
48 ;; you don't have to define the domain. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
49 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
50 ;; (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
|
51 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
52 ;; (setq gnus-nntp-service 119) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
53 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
54 ;; 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
|
55 ;; 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
|
56 ;; follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
57 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
58 ;; (setq gnus-nntp-service nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
59 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
60 ;; (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
|
61 ;; define the variable as follows: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
62 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
63 ;; (setq gnus-use-generic-from t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
64 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
65 ;; (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
|
66 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
67 ;; (autoload 'gnus "gnus" "Read network news." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
68 ;; (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
|
69 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
70 ;; (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
|
71 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
72 ;; (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
|
73 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
74 ;; 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
|
75 ;; private directory using GNUS. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
76 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
77 ;; 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
|
78 ;; 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
|
79 ;; communicating with NNTP server inside Emacs. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
80 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
81 ;; (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
|
82 ;; |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
83 ;; 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
|
84 ;; 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
|
85 ;; variable gnus-info-directory to that directory. |
257 | 86 ;; |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
87 ;; 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
|
88 ;; gnu.emacs.gnus. |
257 | 89 |
90 ;; TO DO: | |
91 ;; (1) Incremental update of active info. | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
92 ;; (2) Asynchronous transmission of large messages. |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
93 |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
94 ;;; Code: |
257 | 95 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
96 (provide 'gnus) |
257 | 97 (require 'nntp) |
98 (require 'mail-utils) | |
99 | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
100 (defvar gnus-default-nntp-server nil |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
101 "*Specify default NNTP server. |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
102 This variable should be defined in paths.el.") |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
103 |
3331
3ab36486eede
(gnus-nntp-server): Use gnus-default-nntp-server.
Richard M. Stallman <rms@gnu.org>
parents:
2845
diff
changeset
|
104 (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
|
105 "*The name of the host running NNTP server. |
257 | 106 If it is a string such as `:DIRECTORY', the user's private DIRECTORY |
107 is used as a news spool. | |
108 Initialized from the NNTPSERVER environment variable.") | |
109 | |
716
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
110 (defvar gnus-nntp-service "nntp" |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
111 "*NNTP service name (\"nntp\" or 119). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
112 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
|
113 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
114 (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
|
115 "*Your `.newsrc' file. Use `.newsrc-SERVER' instead if exists.") |
716
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
116 |
257 | 117 (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
|
118 "*Your `.signature' file. Use `.signature-DISTRIBUTION' instead if exists.") |
257 | 119 |
120 (defvar gnus-use-cross-reference t | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
121 "*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
|
122 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
|
123 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
|
124 read in all newsgroups.") |
257 | 125 |
126 (defvar gnus-use-followup-to t | |
127 "*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
|
128 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
|
129 `poster'. Otherwise, if not nil nor t, always use its value.") |
257 | 130 |
131 (defvar gnus-large-newsgroup 50 | |
132 "*The number of articles which indicates a large newsgroup. | |
133 If the number of articles in a newsgroup is greater than the value, | |
134 confirmation is required for selecting the newsgroup.") | |
135 | |
136 (defvar gnus-author-copy (getenv "AUTHORCOPY") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
137 "*File name saving a copy of an article posted using FCC: field. |
257 | 138 Initialized from the AUTHORCOPY environment variable. |
139 | |
140 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
|
141 `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
|
142 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
|
143 contents of the article is piped out to the named program. It is |
257 | 144 possible to save an article in an MH folder as follows: |
145 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
146 (setq gnus-author-copy \"|/usr/local/lib/mh/rcvstore +Article\")") |
257 | 147 |
148 (defvar gnus-author-copy-saver (function rmail-output) | |
149 "*A function called with a file name to save an author copy to. | |
150 The default function is `rmail-output' which saves in Unix mailbox format.") | |
151 | |
152 (defvar gnus-use-long-file-name | |
153 (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
|
154 "*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
|
155 to save articles to. If it's nil, the directory form of a newsgroup is |
257 | 156 used instead.") |
157 | |
158 (defvar gnus-article-save-directory (getenv "SAVEDIR") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
159 "*A directory name to save articles to (default to ~/News). |
257 | 160 Initialized from the SAVEDIR environment variable.") |
161 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
162 (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
|
163 "*A function to save articles in your favorite format. |
257 | 164 The function must be interactively callable (in other words, it must |
165 be an Emacs command). | |
166 | |
167 GNUS provides the following functions: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
168 gnus-summary-save-in-rmail (in Rmail format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
169 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
|
170 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
|
171 gnus-summary-save-in-file (in article format).") |
257 | 172 |
173 (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
|
174 "*A function generating a file name to save articles in Rmail format. |
257 | 175 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.") |
176 | |
177 (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
|
178 "*A function generating a file name to save articles in Unix mail format. |
257 | 179 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.") |
180 | |
181 (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
|
182 "*A function generating a file name to save articles in MH folder. |
257 | 183 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER.") |
184 | |
185 (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
|
186 "*A function generating a file name to save articles in article format. |
257 | 187 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.") |
188 | |
189 (defvar gnus-kill-file-name "KILL" | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
190 "*File name of a KILL file.") |
257 | 191 |
192 (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
|
193 "*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
|
194 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
|
195 or your confirmations may be required.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
196 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
197 (defvar gnus-interactive-catchup t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
198 "*Require your confirmation when catching up a newsgroup if non-nil.") |
257 | 199 |
200 (defvar gnus-interactive-post t | |
201 "*Newsgroup, subject, and distribution will be asked for if non-nil.") | |
202 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
203 (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
|
204 "*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
|
205 |
257 | 206 (defvar gnus-user-login-name nil |
207 "*The login name of the user. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
208 Got from the USER and LOGNAME environment variable if undefined.") |
257 | 209 |
210 (defvar gnus-user-full-name nil | |
211 "*The full name of the user. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
212 Got from the NAME environment variable if undefined.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
213 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
214 (defvar gnus-show-mime nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
215 "*Show MIME message if non-nil.") |
257 | 216 |
217 (defvar gnus-show-threads t | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
218 "*Show conversation threads in Summary Mode if non-nil.") |
257 | 219 |
220 (defvar gnus-thread-hide-subject t | |
221 "*Non-nil means hide subjects for thread subtrees.") | |
222 | |
223 (defvar gnus-thread-hide-subtree nil | |
224 "*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
|
225 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
|
226 hand or by using `gnus-select-article-hook' to show hidden threads.") |
257 | 227 |
228 (defvar gnus-thread-hide-killed t | |
229 "*Non-nil means hide killed thread subtrees automatically.") | |
230 | |
231 (defvar gnus-thread-ignore-subject nil | |
232 "*Don't take care of subject differences, but only references if non-nil. | |
233 If it is non-nil, some commands work with subjects do not work properly.") | |
234 | |
235 (defvar gnus-thread-indent-level 4 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
236 "*Indentation of thread subtrees.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
237 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
238 (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
|
239 "*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
|
240 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
|
241 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
|
242 thus making them effectively invisible.") |
257 | 243 |
244 (defvar gnus-ignored-headers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
245 "^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
|
246 "*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
|
247 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
248 (defvar gnus-required-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
249 '(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
|
250 "*All required fields for articles you post. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
251 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
|
252 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
|
253 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
|
254 variable.") |
257 | 255 |
256 (defvar gnus-show-all-headers nil | |
257 "*Show all headers of an article if non-nil.") | |
258 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
259 (defvar gnus-save-all-headers t |
257 | 260 "*Save all headers of an article if non-nil.") |
261 | |
262 (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
|
263 "*A function generating a optional string displayed in GNUS Summary |
257 | 264 mode buffer. The function is called with an article HEADER. The |
265 result must be a string excluding `[' and `]'.") | |
266 | |
267 (defvar gnus-auto-extend-newsgroup t | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
268 "*Extend visible articles to forward and backward if non-nil.") |
257 | 269 |
270 (defvar gnus-auto-select-first t | |
271 "*Select the first unread article automagically if non-nil. | |
272 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
|
273 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
|
274 or `gnus-apply-kill-hook'.") |
257 | 275 |
276 (defvar gnus-auto-select-next t | |
277 "*Select the next newsgroup automagically if non-nil. | |
278 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
|
279 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
|
280 nor t, GNUS will select the following unread newsgroup. Especially, if |
257 | 281 the value is the symbol `quietly', the next unread newsgroup will be |
282 selected without any confirmations.") | |
283 | |
284 (defvar gnus-auto-select-same nil | |
285 "*Select the next article with the same subject automagically if non-nil.") | |
286 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
287 (defvar gnus-auto-center-summary t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
288 "*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
|
289 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
290 (defvar gnus-auto-mail-to-author nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
291 "*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
|
292 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
|
293 `gnus-mail-send-method'.") |
257 | 294 |
295 (defvar gnus-break-pages t | |
296 "*Break an article into pages if non-nil. | |
297 Page delimiter is specified by the variable `gnus-page-delimiter'.") | |
298 | |
299 (defvar gnus-page-delimiter "^\^L" | |
300 "*Regexp describing line-beginnings that separate pages of news article.") | |
301 | |
302 (defvar gnus-digest-show-summary t | |
303 "*Show a summary of undigestified messages if non-nil.") | |
304 | |
305 (defvar gnus-digest-separator "^Subject:[ \t]" | |
306 "*Regexp that separates messages in a digest article.") | |
307 | |
308 (defvar gnus-use-full-window t | |
309 "*Non-nil means to take up the entire screen of Emacs.") | |
310 | |
311 (defvar gnus-window-configuration | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
312 '((summary (0 1 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
313 (newsgroups (1 0 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
314 (article (0 3 10))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
315 "*Specify window configurations for each action. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
316 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
|
317 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
|
318 respectively. ACTION is `summary', `newsgroups', or `article'.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
319 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
320 (defvar gnus-show-mime-method (function metamail-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
321 "*Function to process a MIME message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
322 The function is expected to process current buffer as a MIME message.") |
257 | 323 |
324 (defvar gnus-mail-reply-method | |
325 (function gnus-mail-reply-using-mail) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
326 "*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
|
327 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
|
328 program. The function `gnus-mail-reply-using-mhe' uses the MH-E mail |
257 | 329 program. You can use yet another program by customizing this variable.") |
330 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
331 (defvar gnus-mail-forward-method |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
332 (function gnus-mail-forward-using-mail) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
333 "*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
|
334 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
|
335 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
|
336 |
257 | 337 (defvar gnus-mail-other-window-method |
338 (function gnus-mail-other-window-using-mail) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
339 "*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
|
340 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
|
341 mail program. The function `gnus-mail-other-window-using-mhe' uses the MH-E |
257 | 342 mail program. You can use yet another program by customizing this variable.") |
343 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
344 (defvar gnus-mail-send-method send-mail-function |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
345 "*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
|
346 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
|
347 the variable `send-mail-function'.") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
348 |
257 | 349 (defvar gnus-subscribe-newsgroup-method |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
350 (function gnus-subscribe-alphabetically) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
351 "*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
|
352 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
|
353 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
|
354 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
|
355 `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
|
356 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
|
357 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
358 (defvar gnus-group-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
359 "*A hook for GNUS Group Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
360 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
361 (defvar gnus-summary-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
362 "*A hook for GNUS Summary Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
363 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
364 (defvar gnus-article-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
365 "*A hook for GNUS Article Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
366 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
367 (defvar gnus-kill-file-mode-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
368 "*A hook for GNUS KILL File Mode.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
369 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
370 (defvar gnus-open-server-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
371 "*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
|
372 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
373 (defvar gnus-startup-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
374 "*A hook called at start up time. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
375 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
|
376 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
|
377 NNTP server.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
378 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
379 (defvar gnus-group-prepare-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
380 "*A hook called after newsgroup list is created in the Newsgroup buffer. |
257 | 381 If you want to modify the Newsgroup buffer, you can use this hook.") |
382 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
383 (defvar gnus-summary-prepare-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
384 "*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
|
385 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
|
386 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
387 (defvar gnus-article-prepare-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
388 "*A hook called after an article is prepared in the Article buffer. |
257 | 389 If you want to run a special decoding program like nkf, use this hook.") |
390 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
391 (defvar gnus-select-group-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
392 "*A hook called when a newsgroup is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
393 If you want to sort Summary buffer by date and then by subject, you |
257 | 394 can use the following hook: |
395 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
396 \(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
|
397 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
398 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
399 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
400 ;; 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
|
401 (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
|
402 (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
|
403 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
404 (lambda (a) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
405 (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
|
406 ;; 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
|
407 ;; 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
|
408 (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
|
409 (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
|
410 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
411 (lambda (a) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
412 (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
|
413 (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
|
414 (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
|
415 )))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
416 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
417 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
|
418 `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
|
419 following hook: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
420 |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
421 \(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
|
422 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
423 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
424 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
425 (mapcar (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
426 (lambda (header) |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
427 (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
|
428 header |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
429 (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
|
430 (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
|
431 gnus-newsgroup-headers))))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
432 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
433 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
|
434 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
|
435 |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
436 \(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
|
437 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
438 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
439 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
440 (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
|
441 (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
|
442 (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
|
443 (t |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
444 (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
|
445 (function gnus-optional-lines-and-from))))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
446 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
447 (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
|
448 '(gnus-summary-show-thread) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
449 "*A hook called when an article is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
450 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
|
451 article automatically using `gnus-summary-show-thread'. |
257 | 452 |
453 If you'd like to run RMAIL on a digest article automagically, you can | |
454 use the following hook: | |
455 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
456 \(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
|
457 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
458 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
459 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
460 (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
|
461 (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
|
462 (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
|
463 ((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
|
464 (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
|
465 (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
|
466 (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
|
467 ))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
468 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
469 (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
|
470 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
471 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
472 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
473 ;; 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
|
474 (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
|
475 (progn |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
476 (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
|
477 (insert (gnus-fetch-field "From"))))))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
478 "*A hook called when reading digest messages using Rmail. |
257 | 479 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
|
480 \(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
|
481 |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
482 \(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
|
483 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
484 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
485 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
486 ;; 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
|
487 (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
|
488 (progn |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
489 (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
|
490 (insert (gnus-fetch-field \"From\"))))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
491 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
492 (defvar gnus-rmail-digest-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
493 "*A hook called when reading digest messages using Rmail. |
257 | 494 This hook is intended to customize Rmail mode for reading digest articles.") |
495 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
496 (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
|
497 "*A hook called when a newsgroup is selected and summary list is prepared. |
257 | 498 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
|
499 The function `gnus-apply-kill-file' is called by default. |
257 | 500 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
501 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
|
502 newsgroups, I recommend you to use a lighter hook function. For |
257 | 503 example, if you'd like to apply a KILL file to articles which contains |
504 a string `rmgroup' in subject in newsgroup `control', you can use the | |
505 following hook: | |
506 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
507 \(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
|
508 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
509 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
510 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
511 (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
|
512 (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
|
513 (gnus-expunge \"X\")))))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
514 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
515 (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
|
516 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
517 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
518 (lambda () |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
519 (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
|
520 (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
|
521 (gnus-summary-set-current-mark "+")))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
522 "*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
|
523 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
|
524 automatically when it is selected. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
525 |
257 | 526 If you'd like to mark as unread (-) instead, use the following hook: |
527 | |
4321
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
528 \(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
|
529 (list |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
530 (function |
2eb6fe350374
(gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents:
4317
diff
changeset
|
531 (lambda () |
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-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
|
533 (gnus-summary-set-current-mark \"+\")))))") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
534 |
3474
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
535 (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
|
536 "*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
|
537 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
|
538 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
|
539 |
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
540 (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
|
541 "*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
|
542 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
|
543 to a file).") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
544 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
545 (defvar gnus-exit-group-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
546 "*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
|
547 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
|
548 long time, set the variable `gnus-use-cross-reference' to nil. This |
257 | 549 inhibits marking articles as read using cross-reference information.") |
550 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
551 (defvar gnus-suspend-gnus-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
552 "*A hook called when suspending (not exiting) GNUS.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
553 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
554 (defvar gnus-exit-gnus-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
555 "*A hook called when exiting (not suspending) GNUS.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
556 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
557 (defvar gnus-save-newsrc-hook nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
558 "*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
|
559 This hook is called before saving the `.newsrc' file.") |
257 | 560 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
561 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
562 ;; 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
|
563 ;; site-init.el, default.el or your .emacs. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
564 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
565 (defvar gnus-local-timezone nil |
3496
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
566 "*Local time zone. |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
567 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
|
568 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
|
569 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
|
570 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
|
571 |
509112098ff1
(gnus-local-timezone): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents:
3474
diff
changeset
|
572 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
|
573 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
|
574 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
575 (defvar gnus-local-domain nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
576 "*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
|
577 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
|
578 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
|
579 need to define the name.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
580 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
581 (defvar gnus-local-organization nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
582 "*Local organization like: \"Fujitsu Laboratories Ltd., Kawasaki, Japan.\" |
257 | 583 The `ORGANIZATION' environment variable is used instead if defined.") |
584 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
585 (defvar gnus-local-distributions '("local" "world") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
586 "*List of distributions. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
587 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
|
588 file is available, its content is also used.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
589 |
257 | 590 (defvar gnus-use-generic-from nil |
591 "*If nil, prepend local host name to the defined domain in the From: | |
592 field; if stringp, use this; if non-nil, strip of the local host name.") | |
593 | |
594 (defvar gnus-use-generic-path nil | |
595 "*If nil, use the NNTP server name in the Path: field; if stringp, | |
596 use this; if non-nil, use no host name (user name only)") | |
597 | |
598 ;; Internal variables. | |
599 | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
600 (defconst gnus-version "GNUS 4.1" |
257 | 601 "Version numbers of this version of GNUS.") |
602 | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
603 (defconst gnus-emacs-version |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
604 (progn |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
605 (string-match "[0-9]*" emacs-version) |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
606 (string-to-int (substring emacs-version |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
607 (match-beginning 0) (match-end 0)))) |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
608 "Major version number of this emacs.") |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
609 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
610 (defvar gnus-info-nodes |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
611 '((gnus-group-mode "(gnus)Newsgroup Commands") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
612 (gnus-summary-mode "(gnus)Summary Commands") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
613 (gnus-article-mode "(gnus)Article Commands") |
4118
4248276b1113
(gnus-info-nodes): Update node names.
Richard M. Stallman <rms@gnu.org>
parents:
3922
diff
changeset
|
614 (gnus-kill-file-mode "(gnus)Kill File") |
4248276b1113
(gnus-info-nodes): Update node names.
Richard M. Stallman <rms@gnu.org>
parents:
3922
diff
changeset
|
615 (gnus-browse-killed-mode "(gnus)Maintaining Subscriptions")) |
257 | 616 "Assoc list of major modes and related Info nodes.") |
617 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
618 ;; Alist syntax is different from that of 3.14.3. |
257 | 619 (defvar gnus-access-methods |
620 '((nntp | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
621 (gnus-retrieve-headers nntp-retrieve-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
622 (gnus-open-server nntp-open-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
623 (gnus-close-server nntp-close-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
624 (gnus-server-opened nntp-server-opened) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
625 (gnus-status-message nntp-status-message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
626 (gnus-request-article nntp-request-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
627 (gnus-request-group nntp-request-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
628 (gnus-request-list nntp-request-list) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
629 (gnus-request-list-newsgroups nntp-request-list-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
630 (gnus-request-list-distributions nntp-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
631 (gnus-request-post nntp-request-post)) |
257 | 632 (nnspool |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
633 (gnus-retrieve-headers nnspool-retrieve-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
634 (gnus-open-server nnspool-open-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
635 (gnus-close-server nnspool-close-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
636 (gnus-server-opened nnspool-server-opened) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
637 (gnus-status-message nnspool-status-message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
638 (gnus-request-article nnspool-request-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
639 (gnus-request-group nnspool-request-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
640 (gnus-request-list nnspool-request-list) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
641 (gnus-request-list-newsgroups nnspool-request-list-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
642 (gnus-request-list-distributions nnspool-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
643 (gnus-request-post nnspool-request-post)) |
257 | 644 (mhspool |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
645 (gnus-retrieve-headers mhspool-retrieve-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
646 (gnus-open-server mhspool-open-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
647 (gnus-close-server mhspool-close-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
648 (gnus-server-opened mhspool-server-opened) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
649 (gnus-status-message mhspool-status-message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
650 (gnus-request-article mhspool-request-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
651 (gnus-request-group mhspool-request-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
652 (gnus-request-list mhspool-request-list) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
653 (gnus-request-list-newsgroups mhspool-request-list-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
654 (gnus-request-list-distributions mhspool-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
655 (gnus-request-post mhspool-request-post))) |
257 | 656 "Access method for NNTP, nnspool, and mhspool.") |
657 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
658 (defvar gnus-group-buffer "*Newsgroup*") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
659 (defvar gnus-summary-buffer "*Summary*") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
660 (defvar gnus-article-buffer "*Article*") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
661 (defvar gnus-digest-buffer "GNUS Digest") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
662 (defvar gnus-digest-summary-buffer "GNUS Digest-summary") |
257 | 663 |
664 (defvar gnus-buffer-list | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
665 (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
|
666 gnus-digest-buffer gnus-digest-summary-buffer) |
257 | 667 "GNUS buffer names which should be killed when exiting.") |
668 | |
669 (defvar gnus-variable-list | |
670 '(gnus-newsrc-options | |
671 gnus-newsrc-options-n-yes gnus-newsrc-options-n-no | |
672 gnus-newsrc-assoc gnus-killed-assoc gnus-marked-assoc) | |
673 "GNUS variables saved in the quick startup file.") | |
674 | |
675 (defvar gnus-overload-functions | |
676 '((news-inews gnus-inews-news "rnewspost") | |
677 (caesar-region gnus-caesar-region "rnews")) | |
678 "Functions overloaded by gnus. | |
679 It is a list of `(original overload &optional file)'.") | |
680 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
681 (defvar gnus-distribution-list nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
682 |
257 | 683 (defvar gnus-newsrc-options nil |
684 "Options line in the .newsrc file.") | |
685 | |
686 (defvar gnus-newsrc-options-n-yes nil | |
687 "Regexp representing subscribed newsgroups.") | |
688 | |
689 (defvar gnus-newsrc-options-n-no nil | |
690 "Regexp representing unsubscribed newsgroups.") | |
691 | |
692 (defvar gnus-newsrc-assoc nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
693 "Assoc list of read articles. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
694 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
|
695 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
696 (defvar gnus-newsrc-hashtb nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
697 "Hashtable of gnus-newsrc-assoc.") |
257 | 698 |
699 (defvar gnus-killed-assoc nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
700 "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
|
701 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
|
702 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
703 (defvar gnus-killed-hashtb nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
704 "Hashtable of gnus-killed-assoc.") |
257 | 705 |
706 (defvar gnus-marked-assoc nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
707 "Assoc list of articles marked as unread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
708 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
|
709 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
710 (defvar gnus-marked-hashtb nil |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
711 "Hashtable of gnus-marked-assoc.") |
257 | 712 |
713 (defvar gnus-unread-hashtb nil | |
714 "Hashtable of unread articles.") | |
715 | |
716 (defvar gnus-active-hashtb nil | |
717 "Hashtable of active articles.") | |
718 | |
719 (defvar gnus-octive-hashtb nil | |
720 "Hashtable of OLD active articles.") | |
721 | |
722 (defvar gnus-current-startup-file nil | |
723 "Startup file for the current host.") | |
724 | |
725 (defvar gnus-last-search-regexp nil | |
726 "Default regexp for article search command.") | |
727 | |
728 (defvar gnus-last-shell-command nil | |
729 "Default shell command on article.") | |
730 | |
731 (defvar gnus-have-all-newsgroups nil) | |
732 | |
733 (defvar gnus-newsgroup-name nil) | |
734 (defvar gnus-newsgroup-begin nil) | |
735 (defvar gnus-newsgroup-end nil) | |
736 (defvar gnus-newsgroup-last-rmail nil) | |
737 (defvar gnus-newsgroup-last-mail nil) | |
738 (defvar gnus-newsgroup-last-folder nil) | |
739 (defvar gnus-newsgroup-last-file nil) | |
740 | |
741 (defvar gnus-newsgroup-unreads nil | |
742 "List of unread articles in the current newsgroup.") | |
743 | |
744 (defvar gnus-newsgroup-unselected nil | |
745 "List of unselected unread articles in the current newsgroup.") | |
746 | |
747 (defvar gnus-newsgroup-marked nil | |
748 "List of marked articles in the current newsgroup (a subset of unread art).") | |
749 | |
750 (defvar gnus-newsgroup-headers nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
751 "List of article headers in the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
752 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
|
753 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
|
754 the hash tables.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
755 (defvar gnus-newsgroup-headers-hashtb-by-id nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
756 (defvar gnus-newsgroup-headers-hashtb-by-number nil) |
257 | 757 |
758 (defvar gnus-current-article nil) | |
759 (defvar gnus-current-headers nil) | |
760 (defvar gnus-current-history nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
761 (defvar gnus-have-all-headers nil "Must be either T or NIL.") |
257 | 762 (defvar gnus-last-article nil) |
763 (defvar gnus-current-kill-article nil) | |
764 | |
765 ;; Save window configuration. | |
766 (defvar gnus-winconf-kill-file nil) | |
767 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
768 (defvar gnus-group-mode-map nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
769 (defvar gnus-summary-mode-map nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
770 (defvar gnus-article-mode-map nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
771 (defvar gnus-kill-file-mode-map nil) |
257 | 772 |
773 (defvar rmail-last-file (expand-file-name "~/XMBOX")) | |
774 (defvar rmail-last-rmail-file (expand-file-name "~/XNEWS")) | |
775 | |
776 ;; Define GNUS Subsystems. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
777 (autoload 'gnus-group-post-news "gnuspost" |
257 | 778 "Post an article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
779 (autoload 'gnus-summary-post-news "gnuspost" |
257 | 780 "Post an article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
781 (autoload 'gnus-summary-followup "gnuspost" |
257 | 782 "Post a reply article." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
783 (autoload 'gnus-summary-followup-with-original "gnuspost" |
257 | 784 "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
|
785 (autoload 'gnus-summary-cancel-article "gnuspost" |
257 | 786 "Cancel an article you posted." t) |
787 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
788 (autoload 'gnus-summary-reply "gnusmail" |
257 | 789 "Reply mail to news author." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
790 (autoload 'gnus-summary-reply-with-original "gnusmail" |
257 | 791 "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
|
792 (autoload 'gnus-summary-mail-forward "gnusmail" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
793 "Forward the current message to another user." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
794 (autoload 'gnus-summary-mail-other-window "gnusmail" |
257 | 795 "Compose mail in other window." t) |
796 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
797 (autoload 'gnus-group-kill-group "gnusmisc" |
257 | 798 "Kill newsgroup on current line." t) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
799 (autoload 'gnus-group-yank-group "gnusmisc" |
257 | 800 "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
|
801 (autoload 'gnus-group-kill-region "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
802 "Kill newsgroups in current region." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
803 (autoload 'gnus-group-transpose-groups "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
804 "Exchange current newsgroup and previous newsgroup." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
805 (autoload 'gnus-list-killed-groups "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
806 "List the killed newsgroups." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
807 (autoload 'gnus-gmt-to-local "gnusmisc" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
808 "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
|
809 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
810 (autoload 'metamail-buffer "metamail" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
811 "Process current buffer through 'metamail'." t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
812 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
813 (autoload 'timezone-make-sortable-date "timezone") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
814 (autoload 'timezone-parse-date "timezone") |
257 | 815 |
816 (autoload 'rmail-output "rmailout" | |
817 "Append this message to Unix mail file named FILE-NAME." t) | |
818 (autoload 'mail-position-on-field "sendmail") | |
819 (autoload 'mh-find-path "mh-e") | |
820 (autoload 'mh-prompt-for-folder "mh-e") | |
821 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
822 (put 'gnus-group-mode 'mode-class 'special) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
823 (put 'gnus-summary-mode 'mode-class 'special) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
824 (put 'gnus-article-mode 'mode-class 'special) |
257 | 825 |
826 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
827 ;;(put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1) |
257 | 828 |
829 (defmacro gnus-eval-in-buffer-window (buffer &rest forms) | |
830 "Pop to BUFFER, evaluate FORMS, and then returns to original window." | |
831 (` (let ((GNUSStartBufferWindow (selected-window))) | |
832 (unwind-protect | |
833 (progn | |
834 (pop-to-buffer (, buffer)) | |
835 (,@ forms)) | |
836 (select-window GNUSStartBufferWindow))))) | |
837 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
838 (defmacro gnus-make-hashtable (&optional hashsize) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
839 "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
|
840 Optional argument HASHSIZE specifies the table size." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
841 (` (make-vector (, (if hashsize (` (max (, hashsize) 200)) 200)) 0))) |
257 | 842 |
843 (defmacro gnus-gethash (string hashtable) | |
844 "Get hash value of STRING in HASHTABLE." | |
845 ;;(` (symbol-value (abbrev-symbol (, string) (, hashtable)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
846 ;;(` (abbrev-expansion (, string) (, hashtable))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
847 (` (symbol-value (intern-soft (, string) (, hashtable))))) |
257 | 848 |
849 (defmacro gnus-sethash (string value hashtable) | |
850 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE." | |
851 ;; We cannot use define-abbrev since it only accepts string as value. | |
852 (` (set (intern (, string) (, hashtable)) (, value)))) | |
853 | |
854 ;; Note: Macros defined here are also defined in nntp.el. I don't like | |
855 ;; to put them here, but many users got troubled with the old | |
856 ;; definitions in nntp.elc. These codes are NNTP 3.10 version. | |
857 | |
858 (defmacro nntp-header-number (header) | |
859 "Return article number in HEADER." | |
860 (` (aref (, header) 0))) | |
861 | |
862 (defmacro nntp-set-header-number (header number) | |
863 "Set article number of HEADER to NUMBER." | |
864 (` (aset (, header) 0 (, number)))) | |
865 | |
866 (defmacro nntp-header-subject (header) | |
867 "Return subject string in HEADER." | |
868 (` (aref (, header) 1))) | |
869 | |
870 (defmacro nntp-set-header-subject (header subject) | |
871 "Set article subject of HEADER to SUBJECT." | |
872 (` (aset (, header) 1 (, subject)))) | |
873 | |
874 (defmacro nntp-header-from (header) | |
875 "Return author string in HEADER." | |
876 (` (aref (, header) 2))) | |
877 | |
878 (defmacro nntp-set-header-from (header from) | |
879 "Set article author of HEADER to FROM." | |
880 (` (aset (, header) 2 (, from)))) | |
881 | |
882 (defmacro nntp-header-xref (header) | |
883 "Return xref string in HEADER." | |
884 (` (aref (, header) 3))) | |
885 | |
886 (defmacro nntp-set-header-xref (header xref) | |
887 "Set article xref of HEADER to xref." | |
888 (` (aset (, header) 3 (, xref)))) | |
889 | |
890 (defmacro nntp-header-lines (header) | |
891 "Return lines in HEADER." | |
892 (` (aref (, header) 4))) | |
893 | |
894 (defmacro nntp-set-header-lines (header lines) | |
895 "Set article lines of HEADER to LINES." | |
896 (` (aset (, header) 4 (, lines)))) | |
897 | |
898 (defmacro nntp-header-date (header) | |
899 "Return date in HEADER." | |
900 (` (aref (, header) 5))) | |
901 | |
902 (defmacro nntp-set-header-date (header date) | |
903 "Set article date of HEADER to DATE." | |
904 (` (aset (, header) 5 (, date)))) | |
905 | |
906 (defmacro nntp-header-id (header) | |
907 "Return Id in HEADER." | |
908 (` (aref (, header) 6))) | |
909 | |
910 (defmacro nntp-set-header-id (header id) | |
911 "Set article Id of HEADER to ID." | |
912 (` (aset (, header) 6 (, id)))) | |
913 | |
914 (defmacro nntp-header-references (header) | |
915 "Return references in HEADER." | |
916 (` (aref (, header) 7))) | |
917 | |
918 (defmacro nntp-set-header-references (header ref) | |
919 "Set article references of HEADER to REF." | |
920 (` (aset (, header) 7 (, ref)))) | |
921 | |
922 | |
923 ;;; | |
924 ;;; GNUS Group Mode | |
925 ;;; | |
926 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
927 (if gnus-group-mode-map |
257 | 928 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
929 (setq gnus-group-mode-map (make-keymap)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
930 (suppress-keymap gnus-group-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
931 (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
|
932 (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
|
933 (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
|
934 (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
|
935 (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
|
936 (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
|
937 (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
|
938 (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
|
939 (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
|
940 (define-key gnus-group-mode-map "\C-p" 'gnus-group-prev-group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
941 (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
|
942 ;;(define-key gnus-group-mode-map "/" 'isearch-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
943 (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
|
944 (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
|
945 (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
|
946 (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
|
947 (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
|
948 (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
|
949 (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
|
950 (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
|
951 (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
|
952 (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
|
953 (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
|
954 (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
|
955 (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
|
956 (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
|
957 (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
|
958 (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
|
959 (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
|
960 (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
|
961 (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
|
962 (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
|
963 (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
|
964 ;;(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
|
965 (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
|
966 (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
|
967 (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
|
968 (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
|
969 (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
|
970 (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
|
971 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
972 (defun gnus-group-mode () |
257 | 973 "Major mode for reading network news. |
974 All normal editing commands are turned off. | |
975 Instead, these commands are available: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
976 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
977 SPC Read articles in this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
978 = Select this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
979 j Move to the specified newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
980 n Move to the next unread newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
981 p Move to the previous unread newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
982 C-n Move to the next newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
983 C-p Move to the previous newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
984 < Move point to the beginning of this buffer. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
985 > Move point to the end of this buffer. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
986 u Unsubscribe from (subscribe to) this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
987 U Unsubscribe from (subscribe to) the specified newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
988 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
|
989 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
|
990 l Revert this buffer. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
991 L List all newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
992 g Get new news. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
993 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
|
994 b Check bogus newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
995 r Restrict visible newsgroups to the current region. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
996 a Post a new article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
997 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
|
998 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
|
999 C-k Kill this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1000 C-y Yank killed newsgroup here. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1001 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
|
1002 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
|
1003 C-c C-l list killed newsgroups. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1004 s Save .newsrc file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1005 z Suspend reading news. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1006 q Quit reading news. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1007 Q Quit reading news without saving .newsrc file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1008 V Show the version number of this GNUS. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1009 ? Describe Group Mode commands briefly. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1010 C-h m Describe Group Mode. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1011 C-c C-i Read Info about Group Mode. |
257 | 1012 |
1013 The name of the host running NNTP server is asked for if no default | |
1014 host is specified. It is also possible to choose another NNTP server | |
1015 even when the default server is defined by giving a prefix argument to | |
1016 the command `\\[gnus]'. | |
1017 | |
1018 If an NNTP server is preceded by a colon such as `:Mail', the user's | |
1019 private directory `~/Mail' is used as a news spool. This makes it | |
1020 possible to read mail stored in MH folders or articles saved by GNUS. | |
1021 File names of mail or articles must consist of only numeric | |
1022 characters. Otherwise, they are ignored. | |
1023 | |
1024 If there is a file named `~/.newsrc-SERVER', it is used as the | |
1025 startup file instead of standard one when talking to SERVER. It is | |
1026 possible to talk to many hosts by using different startup files for | |
1027 each. | |
1028 | |
1029 Option `-n' of the options line in the startup file is recognized | |
1030 properly the same as the Bnews system. For example, if the options | |
1031 line is `options -n !talk talk.rumors', newsgroups under the `talk' | |
1032 hierarchy except for `talk.rumors' are ignored while checking new | |
1033 newsgroups. | |
1034 | |
1035 If there is a file named `~/.signature-DISTRIBUTION', it is used as | |
1036 signature file instead of standard one when posting a news in | |
1037 DISTRIBUTION. | |
1038 | |
1039 If an Info file generated from `gnus.texinfo' is installed, you can | |
1040 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
|
1041 current major mode of GNUS by \\[gnus-info-find-node]. |
257 | 1042 |
1043 The variable `gnus-version', `nntp-version', `nnspool-version', and | |
1044 `mhspool-version' have the version numbers of this version of gnus.el, | |
1045 nntp.el, nnspool.el, and mhspoo.el, respectively. | |
1046 | |
1047 User customizable variables: | |
1048 gnus-nntp-server | |
1049 Specifies the name of the host running the NNTP server. If its | |
1050 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
|
1051 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
|
1052 from the NNTPSERVER environment variable. |
257 | 1053 |
1054 gnus-nntp-service | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1055 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
|
1056 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
|
1057 `gnus-nntp-server' is set to the local host name. |
257 | 1058 |
1059 gnus-startup-file | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1060 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
|
1061 `.newsrc-SERVER', it's used instead when talking to SERVER. I |
257 | 1062 recommend you to use the server specific file, if you'd like to |
1063 talk to many servers. Especially if you'd like to read your | |
1064 private directory, the name of the file must be | |
1065 `.newsrc-:DIRECTORY'. | |
1066 | |
1067 gnus-signature-file | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1068 Specifies a signature file (.signature). If there is a file named |
257 | 1069 `.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
|
1070 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
|
1071 appending the file automatically. If you use an NNTP inews which |
257 | 1072 comes with the NNTP package, you may have to set the variable to |
1073 nil. | |
1074 | |
1075 gnus-use-cross-reference | |
1076 Specifies what to do with cross references (Xref: field). If it | |
1077 is nil, cross references are ignored. If it is t, articles in | |
1078 subscribed newsgroups are only marked as read. Otherwise, if it | |
1079 is not nil nor t, articles in all newsgroups are marked as read. | |
1080 | |
1081 gnus-use-followup-to | |
1082 Specifies what to do with followup-to: field. If it is nil, its | |
1083 value is ignored. If it is non-nil, its value is used as followup | |
1084 newsgroups. Especially, if it is t and field value is `poster', | |
1085 your confirmation is required. | |
1086 | |
1087 gnus-author-copy | |
1088 Specifies a file name to save a copy of article you posted using | |
1089 FCC: field. If the first character of the value is `|', the | |
1090 contents of the article is piped out to a program specified by the | |
1091 rest of the value. The variable is initialized from the | |
1092 AUTHORCOPY environment variable. | |
1093 | |
1094 gnus-author-copy-saver | |
1095 Specifies a function to save an author copy. The function is | |
1096 called with a file name. The default function `rmail-output' | |
1097 saves in Unix mail format. | |
1098 | |
1099 gnus-kill-file-name | |
1100 Use specified file name as a KILL file (default to `KILL'). | |
1101 | |
1102 gnus-novice-user | |
1103 Non-nil means that you are a novice to USENET. If non-nil, | |
1104 verbose messages may be displayed or your confirmations may be | |
1105 required. | |
1106 | |
1107 gnus-interactive-post | |
1108 Non-nil means that newsgroup, subject and distribution are asked | |
1109 for interactively when posting a new article. | |
1110 | |
1111 gnus-use-full-window | |
1112 Non-nil means to take up the entire screen of Emacs. | |
1113 | |
1114 gnus-window-configuration | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1115 Specifies the configuration of Group, Summary, and Article |
257 | 1116 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
|
1117 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
|
1118 respectively. ACTION is `summary', `newsgroups', or `article'. |
257 | 1119 |
1120 gnus-subscribe-newsgroup-method | |
1121 Specifies a function called with a newsgroup name when new | |
1122 newsgroup is found. The default definition adds new newsgroup at | |
1123 the beginning of other newsgroups. | |
1124 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1125 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
|
1126 |
257 | 1127 Various hooks for customization: |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1128 gnus-group-mode-hook |
257 | 1129 Entry to this mode calls the value with no arguments, if that |
1130 value is non-nil. This hook is called before GNUS is connected to | |
1131 the NNTP server. So, you can change or define the NNTP server in | |
1132 this hook. | |
1133 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1134 gnus-startup-hook |
257 | 1135 Called with no arguments after the NNTP server is selected. It is |
1136 possible to change the behavior of GNUS or initialize the | |
1137 variables according to the selected NNTP server. | |
1138 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1139 gnus-group-prepare-hook |
257 | 1140 Called with no arguments after a newsgroup list is created in the |
1141 Newsgroup buffer, if that value is non-nil. | |
1142 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1143 gnus-save-newsrc-hook |
257 | 1144 Called with no arguments when saving newsrc file if that value is |
1145 non-nil. | |
1146 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1147 gnus-prepare-article-hook |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1148 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
|
1149 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
|
1150 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
|
1151 inserts a signature file. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1152 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1153 gnus-inews-article-hook |
257 | 1154 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
|
1155 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
|
1156 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
|
1157 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1158 gnus-suspend-gnus-hook |
257 | 1159 Called with no arguments when suspending (not exiting) GNUS, if |
1160 that value is non-nil. | |
1161 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1162 gnus-exit-gnus-hook |
257 | 1163 Called with no arguments when exiting (not suspending) GNUS, if |
1164 that value is non-nil." | |
1165 (interactive) | |
1166 (kill-all-local-variables) | |
1167 ;; Gee. Why don't you upgrade? | |
1168 (cond ((boundp 'mode-line-modified) | |
1169 (setq mode-line-modified "--- ")) | |
1170 ((listp (default-value 'mode-line-format)) | |
1171 (setq mode-line-format | |
1172 (cons "--- " (cdr (default-value 'mode-line-format))))) | |
1173 (t | |
1174 (setq mode-line-format | |
1175 "--- GNUS: List of Newsgroups %[(%m)%]----%3p-%-"))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1176 (setq major-mode 'gnus-group-mode) |
257 | 1177 (setq mode-name "Newsgroup") |
1178 (setq mode-line-buffer-identification "GNUS: List of Newsgroups") | |
1179 (setq mode-line-process nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1180 (use-local-map gnus-group-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1181 (buffer-flush-undo (current-buffer)) |
257 | 1182 (setq buffer-read-only t) ;Disable modification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1183 (run-hooks 'gnus-group-mode-hook)) |
257 | 1184 |
1185 ;;;###autoload | |
1186 (defun gnus (&optional confirm) | |
1187 "Read network news. | |
1188 If optional argument CONFIRM is non-nil, ask NNTP server." | |
1189 (interactive "P") | |
1190 (unwind-protect | |
1191 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1192 (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
|
1193 (gnus-group-mode) |
257 | 1194 (gnus-start-news-server confirm)) |
1195 (if (not (gnus-server-opened)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1196 (gnus-group-quit) |
257 | 1197 ;; NNTP server is successfully open. |
1198 (setq mode-line-process (format " {%s}" gnus-nntp-server)) | |
1199 (let ((buffer-read-only nil)) | |
1200 (erase-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1201 (gnus-group-startup-message) |
257 | 1202 (sit-for 0)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1203 (run-hooks 'gnus-startup-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1204 (gnus-setup-news) |
257 | 1205 (if gnus-novice-user |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1206 (gnus-group-describe-briefly)) ;Show brief help message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1207 (gnus-group-list-groups nil) |
257 | 1208 ))) |
1209 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1210 (defun gnus-group-startup-message () |
257 | 1211 "Insert startup message in current buffer." |
1212 ;; Insert the message. | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1213 (insert |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1214 (format " |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1215 %s |
257 | 1216 |
1217 NNTP-based News Reader for GNU Emacs | |
1218 | |
1219 | |
1220 If you have any trouble with this software, please let me | |
1221 know. I will fix your problems in the next release. | |
1222 | |
1223 Comments, suggestions, and bug fixes are welcome. | |
1224 | |
1225 Masanobu UMEDA | |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
1226 umerin@mse.kyutech.ac.jp" gnus-version)) |
257 | 1227 ;; And then hack it. |
1228 ;; 57 is the longest line. | |
1229 (indent-rigidly (point-min) (point-max) (/ (max (- (window-width) 57) 0) 2)) | |
1230 (goto-char (point-min)) | |
1231 ;; +4 is fuzzy factor. | |
1232 (insert-char ?\n (/ (max (- (window-height) 18) 0) 2))) | |
1233 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1234 (defun gnus-group-list-groups (show-all) |
257 | 1235 "List newsgroups in the Newsgroup buffer. |
1236 If argument SHOW-ALL is non-nil, unsubscribed groups are also listed." | |
1237 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1238 (let ((case-fold-search nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1239 (last-group ;Current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1240 (gnus-group-group-name)) |
257 | 1241 (next-group ;Next possible newsgroup. |
1242 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1243 (gnus-group-search-forward nil nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1244 (gnus-group-group-name))) |
257 | 1245 (prev-group ;Previous possible newsgroup. |
1246 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1247 (gnus-group-search-forward t nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1248 (gnus-group-group-name)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1249 (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
|
1250 (gnus-group-prepare show-all) |
257 | 1251 (if (zerop (buffer-size)) |
1252 (message "No news is good news") | |
1253 ;; Go to last newsgroup if possible. If cannot, try next and | |
1254 ;; previous. If all fail, go to first unread newsgroup. | |
1255 (goto-char (point-min)) | |
1256 (or (and last-group | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1257 (re-search-forward (gnus-group-make-regexp last-group) nil t)) |
257 | 1258 (and next-group |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1259 (re-search-forward (gnus-group-make-regexp next-group) nil t)) |
257 | 1260 (and prev-group |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1261 (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
|
1262 (gnus-group-search-forward nil nil t)) |
257 | 1263 ;; Adjust cursor point. |
1264 (beginning-of-line) | |
1265 (search-forward ":" nil t) | |
1266 ))) | |
1267 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1268 (defun gnus-group-prepare (&optional all) |
257 | 1269 "Prepare list of newsgroups in current buffer. |
1270 If optional argument ALL is non-nil, unsubscribed groups are also listed." | |
1271 (let ((buffer-read-only nil) | |
1272 (newsrc gnus-newsrc-assoc) | |
1273 (group-info nil) | |
1274 (group-name nil) | |
1275 (unread-count 0) | |
1276 ;; This specifies the format of Group buffer. | |
1277 (cntl "%s%s%5d: %s\n")) | |
1278 (erase-buffer) | |
1279 ;; List newsgroups. | |
1280 (while newsrc | |
1281 (setq group-info (car newsrc)) | |
1282 (setq group-name (car group-info)) | |
1283 (setq unread-count (nth 1 (gnus-gethash group-name gnus-unread-hashtb))) | |
1284 (if (or all | |
1285 (and (nth 1 group-info) ;Subscribed. | |
1286 (> unread-count 0))) ;There are unread articles. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1287 ;; Yes, I can use gnus-group-prepare-line, but this is faster. |
257 | 1288 (insert |
1289 (format cntl | |
1290 ;; Subscribed or not. | |
1291 (if (nth 1 group-info) " " "U") | |
1292 ;; Has new news? | |
1293 (if (and (> unread-count 0) | |
1294 (>= 0 | |
1295 (- unread-count | |
1296 (length | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1297 (cdr (gnus-gethash group-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1298 gnus-marked-hashtb)))))) |
257 | 1299 "*" " ") |
1300 ;; Number of unread articles. | |
1301 unread-count | |
1302 ;; Newsgroup name. | |
1303 group-name)) | |
1304 ) | |
1305 (setq newsrc (cdr newsrc)) | |
1306 ) | |
1307 (setq gnus-have-all-newsgroups all) | |
1308 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1309 (run-hooks 'gnus-group-prepare-hook) |
257 | 1310 )) |
1311 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1312 (defun gnus-group-prepare-line (info) |
257 | 1313 "Return a string for the Newsgroup buffer from INFO. |
1314 INFO is an element of gnus-newsrc-assoc or gnus-killed-assoc." | |
1315 (let* ((group-name (car info)) | |
1316 (unread-count | |
1317 (or (nth 1 (gnus-gethash group-name gnus-unread-hashtb)) | |
1318 ;; Not in hash table, so compute it now. | |
1319 (gnus-number-of-articles | |
1320 (gnus-difference-of-range | |
1321 (nth 2 (gnus-gethash group-name gnus-active-hashtb)) | |
1322 (nthcdr 2 info))))) | |
1323 ;; This specifies the format of Group buffer. | |
1324 (cntl "%s%s%5d: %s\n")) | |
1325 (format cntl | |
1326 ;; Subscribed or not. | |
1327 (if (nth 1 info) " " "U") | |
1328 ;; Has new news? | |
1329 (if (and (> unread-count 0) | |
1330 (>= 0 | |
1331 (- unread-count | |
1332 (length | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1333 (cdr (gnus-gethash group-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1334 gnus-marked-hashtb)))))) |
257 | 1335 "*" " ") |
1336 ;; Number of unread articles. | |
1337 unread-count | |
1338 ;; Newsgroup name. | |
1339 group-name | |
1340 ))) | |
1341 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1342 (defun gnus-group-update-group (group &optional visible-only) |
257 | 1343 "Update newsgroup info of GROUP. |
1344 If optional argument VISIBLE-ONLY is non-nil, non displayed group is ignored." | |
1345 (let ((buffer-read-only nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1346 (case-fold-search nil) ;appleIIgs vs. appleiigs |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1347 (regexp (gnus-group-make-regexp group)) |
257 | 1348 (visible nil)) |
1349 ;; Buffer may be narrowed. | |
1350 (save-restriction | |
1351 (widen) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1352 ;; 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
|
1353 ;; 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
|
1354 ;; 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
|
1355 ;; 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
|
1356 ;; the beginning. Otherwise, search from the end. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1357 (if (cond ((progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1358 (beginning-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1359 (looking-at regexp))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1360 ((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
|
1361 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1362 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1363 (re-search-forward regexp nil t)))) |
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-max)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1366 (re-search-backward regexp nil t)))) |
257 | 1367 ;; GROUP is listed in current buffer. So, delete old line. |
1368 (progn | |
1369 (setq visible t) | |
1370 (beginning-of-line) | |
1371 (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
|
1372 ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1373 ;; 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
|
1374 (goto-char (point-min))) |
257 | 1375 (if (or visible (not visible-only)) |
1376 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1377 (insert (gnus-group-prepare-line |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1378 (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 1379 (forward-line -1) ;Move point on that line. |
1380 )) | |
1381 ))) | |
1382 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1383 (defun gnus-group-group-name () |
257 | 1384 "Get newsgroup name around point." |
1385 (save-excursion | |
1386 (beginning-of-line) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1387 (if (looking-at "^.+:[ \t]+\\([^ \t\n]+\\)\\([ \t].*\\|$\\)") |
257 | 1388 (buffer-substring (match-beginning 1) (match-end 1)) |
1389 ))) | |
1390 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1391 (defun gnus-group-make-regexp (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1392 "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
|
1393 (concat "^.+: " (regexp-quote newsgroup) "\\([ \t].*\\|$\\)")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1394 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1395 (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
|
1396 "Search for the next (or previous) newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1397 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
|
1398 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
|
1399 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
|
1400 (let ((case-fold-search nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1401 (func |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1402 (if backward |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1403 (function re-search-backward) (function re-search-forward))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1404 (regexp |
257 | 1405 (format "^%s[ \t]*\\(%s\\):" |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1406 (if norest ".." " [ \t]") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1407 (if norest "[0-9]+" "[1-9][0-9]*"))) |
257 | 1408 (found nil)) |
1409 (if backward | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1410 (if heretoo |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1411 (end-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1412 (beginning-of-line)) |
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 (beginning-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1415 (end-of-line))) |
257 | 1416 (setq found (funcall func regexp nil t)) |
1417 ;; Adjust cursor point. | |
1418 (beginning-of-line) | |
1419 (search-forward ":" nil t) | |
1420 ;; Return T if found. | |
1421 found | |
1422 )) | |
1423 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1424 ;; GNUS Group mode command |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1425 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1426 (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
|
1427 "Read news in this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1428 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
|
1429 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
|
1430 (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1431 (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
|
1432 (if group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1433 (gnus-summary-read-group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1434 group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1435 (or all |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1436 ;;(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
|
1437 (zerop |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1438 (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
|
1439 no-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1440 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1441 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1442 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1443 (defun gnus-group-select-group (all) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1444 "Select this newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1445 No article is selected automatically. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1446 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
|
1447 (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1448 (gnus-group-read-group all t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1449 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1450 (defun gnus-group-jump-to-group (group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1451 "Jump to newsgroup GROUP." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1452 (interactive |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1453 (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
|
1454 (let ((case-fold-search nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1455 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1456 (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
|
1457 (if (gnus-gethash group gnus-newsrc-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1458 ;; Add GROUP entry, then seach again. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1459 (gnus-group-update-group group))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1460 ;; Adjust cursor point. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1461 (beginning-of-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1462 (search-forward ":" nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1463 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1464 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1465 (defun gnus-group-next-group (n) |
257 | 1466 "Go to next N'th newsgroup." |
1467 (interactive "p") | |
1468 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1469 (gnus-group-search-forward nil t)) |
257 | 1470 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1471 (or (gnus-group-search-forward nil t) |
257 | 1472 (message "No more newsgroups"))) |
1473 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1474 (defun gnus-group-next-unread-group (n) |
257 | 1475 "Go to next N'th unread newsgroup." |
1476 (interactive "p") | |
1477 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1478 (gnus-group-search-forward nil nil)) |
257 | 1479 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1480 (or (gnus-group-search-forward nil nil) |
257 | 1481 (message "No more unread newsgroups"))) |
1482 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1483 (defun gnus-group-prev-group (n) |
257 | 1484 "Go to previous N'th newsgroup." |
1485 (interactive "p") | |
1486 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1487 (gnus-group-search-forward t t)) |
257 | 1488 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1489 (or (gnus-group-search-forward t t) |
257 | 1490 (message "No more newsgroups"))) |
1491 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1492 (defun gnus-group-prev-unread-group (n) |
257 | 1493 "Go to previous N'th unread newsgroup." |
1494 (interactive "p") | |
1495 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1496 (gnus-group-search-forward t nil)) |
257 | 1497 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1498 (or (gnus-group-search-forward t nil) |
257 | 1499 (message "No more unread newsgroups"))) |
1500 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1501 (defun gnus-group-catchup (all) |
257 | 1502 "Mark all articles not marked as unread in current newsgroup as read. |
1503 If prefix argument ALL is non-nil, all articles are marked as read. | |
1504 Cross references (Xref: field) of articles are ignored." | |
1505 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1506 (let* ((group (gnus-group-group-name)) |
257 | 1507 (marked (if (not all) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1508 (cdr (gnus-gethash group gnus-marked-hashtb))))) |
257 | 1509 (and group |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1510 (or (not gnus-interactive-catchup) ;Without confirmation? |
257 | 1511 (y-or-n-p |
1512 (if all | |
1513 "Do you really want to mark everything as read? " | |
1514 "Delete all articles not marked as read? "))) | |
1515 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1516 (message "") ;Clear "Yes or No" question. |
257 | 1517 ;; Any marked articles will be preserved. |
1518 (gnus-update-unread-articles group marked marked) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1519 (gnus-group-update-group group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1520 (gnus-group-next-group 1))) |
257 | 1521 )) |
1522 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1523 (defun gnus-group-catchup-all () |
257 | 1524 "Mark all articles in current newsgroup as read. |
1525 Cross references (Xref: field) of articles are ignored." | |
1526 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1527 (gnus-group-catchup t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1528 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1529 (defun gnus-group-unsubscribe-current-group () |
257 | 1530 "Toggle subscribe from/to unsubscribe current group." |
1531 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1532 (gnus-group-unsubscribe-group (gnus-group-group-name)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1533 (gnus-group-next-group 1)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1534 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1535 (defun gnus-group-unsubscribe-group (group) |
257 | 1536 "Toggle subscribe from/to unsubscribe GROUP. |
1537 New newsgroup is added to .newsrc automatically." | |
1538 (interactive | |
1539 (list (completing-read "Newsgroup: " | |
1540 gnus-active-hashtb nil 'require-match))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1541 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 1542 (cond ((not (null newsrc)) |
1543 ;; Toggle subscription flag. | |
1544 (setcar (nthcdr 1 newsrc) (not (nth 1 newsrc))) | |
1545 (gnus-update-newsrc-buffer group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1546 (gnus-group-update-group group) |
257 | 1547 ;; Adjust cursor point. |
1548 (beginning-of-line) | |
1549 (search-forward ":" nil t)) | |
1550 ((and (stringp group) | |
1551 (gnus-gethash group gnus-active-hashtb)) | |
1552 ;; Add new newsgroup. | |
1553 (gnus-add-newsgroup group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1554 (gnus-group-update-group group) |
257 | 1555 ;; Adjust cursor point. |
1556 (beginning-of-line) | |
1557 (search-forward ":" nil t)) | |
1558 (t (error "No such newsgroup: %s" group))) | |
1559 )) | |
1560 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1561 (defun gnus-group-list-all-groups () |
257 | 1562 "List all of newsgroups in the Newsgroup buffer." |
1563 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1564 (gnus-group-list-groups t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1565 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1566 (defun gnus-group-get-new-news () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1567 "Get newly arrived articles. In fact, read the active file again." |
257 | 1568 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1569 (gnus-setup-news) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1570 (gnus-group-list-groups gnus-have-all-newsgroups)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1571 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1572 (defun gnus-group-restart () |
257 | 1573 "Force GNUS to read the raw startup file." |
1574 (interactive) | |
1575 (gnus-save-newsrc-file) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1576 (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
|
1577 (gnus-group-list-groups gnus-have-all-newsgroups)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1578 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1579 (defun gnus-group-check-bogus-groups () |
257 | 1580 "Check bogus newsgroups." |
1581 (interactive) | |
1582 (gnus-check-bogus-newsgroups t) ;Require confirmation. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1583 (gnus-group-list-groups gnus-have-all-newsgroups)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1584 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1585 (defun gnus-group-restrict-groups (start end) |
257 | 1586 "Restrict visible newsgroups to the current region (START and END). |
1587 Type \\[widen] to remove restriction." | |
1588 (interactive "r") | |
1589 (save-excursion | |
1590 (narrow-to-region (progn | |
1591 (goto-char start) | |
1592 (beginning-of-line) | |
1593 (point)) | |
1594 (progn | |
1595 (goto-char end) | |
1596 (forward-line 1) | |
1597 (point)))) | |
1598 (message (substitute-command-keys "Type \\[widen] to remove restriction"))) | |
1599 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1600 (defun gnus-group-edit-global-kill () |
257 | 1601 "Edit a global KILL file." |
1602 (interactive) | |
1603 (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
|
1604 (gnus-kill-file-edit-file nil) ;Nil stands for global KILL file. |
257 | 1605 (message |
1606 (substitute-command-keys | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1607 "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
|
1608 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1609 (defun gnus-group-edit-local-kill () |
257 | 1610 "Edit a local 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 (gnus-group-group-name)) |
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 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
|
1617 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1618 (defun gnus-group-force-update () |
257 | 1619 "Update .newsrc file." |
1620 (interactive) | |
1621 (gnus-save-newsrc-file)) | |
1622 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1623 (defun gnus-group-suspend () |
257 | 1624 "Suspend the current GNUS session. |
1625 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
|
1626 The hook gnus-suspend-gnus-hook is called before actually suspending." |
257 | 1627 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1628 (run-hooks 'gnus-suspend-gnus-hook) |
257 | 1629 ;; Kill GNUS buffers except for Group Mode buffer. |
1630 (let ((buffers gnus-buffer-list)) | |
1631 (while buffers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1632 (and (not (eq (car buffers) gnus-group-buffer)) |
257 | 1633 (get-buffer (car buffers)) |
1634 (kill-buffer (car buffers))) | |
1635 (setq buffers (cdr buffers)) | |
1636 )) | |
1637 (bury-buffer)) | |
1638 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1639 (defun gnus-group-exit () |
257 | 1640 "Quit reading news after updating .newsrc. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1641 The hook gnus-exit-gnus-hook is called before actually quitting." |
257 | 1642 (interactive) |
1643 (if (or noninteractive ;For gnus-batch-kill | |
1644 (zerop (buffer-size)) ;No news is good news. | |
1645 (not (gnus-server-opened)) ;NNTP connection closed. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1646 (not gnus-interactive-exit) ;Without confirmation |
257 | 1647 (y-or-n-p "Are you sure you want to quit reading news? ")) |
1648 (progn | |
1649 (message "") ;Erase "Yes or No" question. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1650 (run-hooks 'gnus-exit-gnus-hook) |
257 | 1651 (gnus-save-newsrc-file) |
1652 (gnus-clear-system) | |
1653 (gnus-close-server)) | |
1654 )) | |
1655 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1656 (defun gnus-group-quit () |
257 | 1657 "Quit reading news without updating .newsrc. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1658 The hook gnus-exit-gnus-hook is called before actually quitting." |
257 | 1659 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1660 (if (or noninteractive ;For gnus-batch-kill |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1661 (zerop (buffer-size)) |
257 | 1662 (not (gnus-server-opened)) |
1663 (yes-or-no-p | |
1664 (format "Quit reading news without saving %s? " | |
1665 (file-name-nondirectory gnus-current-startup-file)))) | |
1666 (progn | |
1667 (message "") ;Erase "Yes or No" question. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1668 (run-hooks 'gnus-exit-gnus-hook) |
257 | 1669 (gnus-clear-system) |
1670 (gnus-close-server)) | |
1671 )) | |
1672 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1673 (defun gnus-group-describe-briefly () |
257 | 1674 "Describe Group mode commands briefly." |
1675 (interactive) | |
1676 (message | |
1677 (concat | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1678 (substitute-command-keys "\\[gnus-group-read-group]:Select ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1679 (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
|
1680 (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
|
1681 (substitute-command-keys "\\[gnus-group-exit]:Exit ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1682 (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
|
1683 (substitute-command-keys "\\[gnus-group-describe-briefly]:This help") |
257 | 1684 ))) |
1685 | |
1686 | |
1687 ;;; | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1688 ;;; GNUS Summary Mode |
257 | 1689 ;;; |
1690 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1691 (if gnus-summary-mode-map |
257 | 1692 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1693 (setq gnus-summary-mode-map (make-keymap)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1694 (suppress-keymap gnus-summary-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1695 (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
|
1696 (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
|
1697 (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
|
1698 (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
|
1699 (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
|
1700 (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
|
1701 (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
|
1702 (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
|
1703 (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
|
1704 ;;(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
|
1705 ;;(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
|
1706 (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
|
1707 (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
|
1708 (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
|
1709 (define-key gnus-summary-mode-map "\C-p" 'gnus-summary-prev-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1710 (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
|
1711 (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
|
1712 ;;(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
|
1713 ;;(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
|
1714 (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
|
1715 ;;(define-key gnus-summary-mode-map "/" 'isearch-forward) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1716 (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
|
1717 (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
|
1718 ;;(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
|
1719 (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
|
1720 (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
|
1721 (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
|
1722 (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
|
1723 ;;(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
|
1724 (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
|
1725 (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
|
1726 ;;(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
|
1727 (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
|
1728 (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
|
1729 (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
|
1730 (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
|
1731 (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
|
1732 (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
|
1733 (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
|
1734 (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
|
1735 (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
|
1736 (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
|
1737 (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
|
1738 (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
|
1739 (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
|
1740 (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
|
1741 (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
|
1742 (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
|
1743 (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
|
1744 (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
|
1745 ;;(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
|
1746 ;;(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
|
1747 (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
|
1748 ;;(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
|
1749 (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
|
1750 (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
|
1751 (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
|
1752 (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
|
1753 (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
|
1754 (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
|
1755 (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
|
1756 (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
|
1757 (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
|
1758 (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
|
1759 (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
|
1760 (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
|
1761 ;;(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
|
1762 (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
|
1763 (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
|
1764 (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
|
1765 (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
|
1766 (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
|
1767 ;;(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
|
1768 (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
|
1769 (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
|
1770 (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
|
1771 (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
|
1772 (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
|
1773 (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
|
1774 (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
|
1775 (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
|
1776 (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
|
1777 (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
|
1778 (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
|
1779 (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
|
1780 (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
|
1781 (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
|
1782 (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
|
1783 (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
|
1784 (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
|
1785 (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
|
1786 (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
|
1787 (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
|
1788 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1789 (defun gnus-summary-mode () |
257 | 1790 "Major mode for reading articles in this newsgroup. |
1791 All normal editing commands are turned off. | |
1792 Instead, these commands are available: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1793 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1794 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
|
1795 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
|
1796 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
|
1797 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
|
1798 n Move to the next unread article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1799 p Move to the previous unread article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1800 N Move to the next article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1801 P Move to the previous article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1802 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
|
1803 current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1804 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
|
1805 current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1806 \\[gnus-summary-next-unread-same-subject] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1807 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
|
1808 current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1809 \\[gnus-summary-prev-unread-same-subject] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1810 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
|
1811 the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1812 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
|
1813 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
|
1814 C-n Move to the next subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1815 C-p Move to the previous subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1816 ESC n Move to the next unread subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1817 ESC p Move to the previous unread subject. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1818 \\[gnus-summary-next-group] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1819 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
|
1820 \\[gnus-summary-prev-group] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1821 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
|
1822 . 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
|
1823 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
|
1824 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
|
1825 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
|
1826 < 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
|
1827 > 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
|
1828 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
|
1829 l Jump to the article you read last. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1830 ^ Refer to parent of the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1831 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
|
1832 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
|
1833 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
|
1834 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
|
1835 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
|
1836 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
|
1837 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
|
1838 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
|
1839 read, and then select the next unread article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1840 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
|
1841 read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1842 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
|
1843 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
|
1844 ESC C-t Toggle showing conversation threads. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1845 ESC C-s Show thread subtrees. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1846 ESC C-h Hide thread subtrees. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1847 \\[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
|
1848 \\[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
|
1849 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
|
1850 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
|
1851 ESC C-d Go downward current thread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1852 ESC C-u Go upward current thread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1853 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
|
1854 & Execute a command for each article conditionally. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1855 \\[gnus-summary-catchup] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1856 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
|
1857 articles marked as unread. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1858 \\[gnus-summary-catchup-all] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1859 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
|
1860 \\[gnus-summary-catchup-and-exit] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1861 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
|
1862 current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1863 \\[gnus-summary-catchup-all-and-exit] |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1864 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
|
1865 C-t Toggle truncations of subject lines. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1866 x Delete subject lines marked as read. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1867 X Delete subject lines with the specific marks. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1868 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
|
1869 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
|
1870 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
|
1871 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
|
1872 = Expand Summary window to show headers full window. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1873 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
|
1874 w Stop page breaking by linefeed. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1875 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
|
1876 g Force to show the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1877 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
|
1878 vice versa. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1879 ESC-t Toggle MIME processing. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1880 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
|
1881 a Post a new article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1882 f Post a reply article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1883 F Post a reply article with original article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1884 C Cancel the current article. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1885 r Mail a message to the author. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1886 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
|
1887 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
|
1888 m Mail a message in other window. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1889 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
|
1890 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
|
1891 | 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
|
1892 q Quit reading news in the current newsgroup. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1893 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
|
1894 V Show the version number of this GNUS. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1895 ? Describe Summary mode commands briefly. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1896 C-h m Describe Summary mode. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1897 C-c C-i Read Info about Summary mode. |
257 | 1898 |
1899 User customizable variables: | |
1900 gnus-large-newsgroup | |
1901 The number of articles which indicates a large newsgroup. If the | |
1902 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
|
1903 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
|
1904 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
|
1905 the first N articles are selected. An empty string means to select |
257 | 1906 all articles. |
1907 | |
1908 gnus-use-long-file-name | |
1909 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
|
1910 to save articles to. If it's nil, the directory form of a |
257 | 1911 newsgroup is used instead. |
1912 | |
1913 gnus-default-article-saver | |
1914 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
|
1915 funcallable. Following functions are available: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1916 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1917 gnus-summary-save-in-rmail (in Rmail format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1918 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
|
1919 gnus-summary-save-in-folder (in MH folder) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1920 gnus-summary-save-in-file (in article format). |
257 | 1921 |
1922 gnus-rmail-save-name | |
1923 gnus-mail-save-name | |
1924 gnus-folder-save-name | |
1925 gnus-file-save-name | |
1926 Specifies a function generating a file name to save articles in | |
1927 specified format. The function is called with NEWSGROUP, HEADERS, | |
1928 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
|
1929 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
|
1930 gnus-header-FIELD. |
257 | 1931 |
1932 gnus-article-save-directory | |
1933 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
|
1934 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
|
1935 gnus-summary-save-in-file. The variable is initialized from the |
257 | 1936 SAVEDIR environment variable. |
1937 | |
1938 gnus-show-all-headers | |
1939 Non-nil means that all headers of an article are shown. | |
1940 | |
1941 gnus-save-all-headers | |
1942 Non-nil means that all headers of an article are saved in a file. | |
1943 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1944 gnus-show-mime |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1945 Non-nil means that show a MIME message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1946 |
257 | 1947 gnus-show-threads |
1948 Non-nil means that conversation threads are shown in tree structure. | |
1949 | |
1950 gnus-thread-hide-subject | |
1951 Non-nil means that subjects for thread subtrees are hidden. | |
1952 | |
1953 gnus-thread-hide-subtree | |
1954 Non-nil means that thread subtrees are hidden initially. | |
1955 | |
1956 gnus-thread-hide-killed | |
1957 Non-nil means that killed thread subtrees are hidden automatically. | |
1958 | |
1959 gnus-thread-ignore-subject | |
1960 Non-nil means that subject differences are ignored in constructing | |
1961 thread trees. | |
1962 | |
1963 gnus-thread-indent-level | |
1964 Indentation of thread subtrees. | |
1965 | |
1966 gnus-optional-headers | |
1967 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
|
1968 in the Summary buffer. The function is called with an article |
257 | 1969 HEADERS. The result must be a string excluding `[' and `]'. The |
1970 default function returns a string like NNN:AUTHOR, where NNN is | |
1971 the number of lines in an article and AUTHOR is the name of the | |
1972 author. | |
1973 | |
1974 gnus-auto-extend-newsgroup | |
1975 Non-nil means visible articles are extended to forward and | |
1976 backward automatically if possible. | |
1977 | |
1978 gnus-auto-select-first | |
1979 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
|
1980 when a newsgroup is selected normally (by gnus-group-read-group). |
257 | 1981 If you'd like to prevent automatic selection of the first unread |
1982 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
|
1983 gnus-select-group-hook or gnus-apply-kill-hook. |
257 | 1984 |
1985 gnus-auto-select-next | |
1986 Non-nil means the next newsgroup is selected automagically at the | |
1987 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
|
1988 empty (no unread articles), GNUS will exit Summary mode and go |
257 | 1989 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
|
1990 exit Summary mode but select the following unread newsgroup. |
257 | 1991 Especially, if the value is the symbol `quietly', the next unread |
1992 newsgroup will be selected without any confirmations. | |
1993 | |
1994 gnus-auto-select-same | |
1995 Non-nil means an article with the same subject as the current | |
1996 article is selected automagically like `rn -S'. | |
1997 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1998 gnus-auto-center-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
1999 Non-nil means the point of Summary Mode window is always kept |
257 | 2000 centered. |
2001 | |
2002 gnus-break-pages | |
2003 Non-nil means an article is broken into pages at page delimiters. | |
2004 This may not work with some versions of GNU Emacs earlier than | |
2005 version 18.50. | |
2006 | |
2007 gnus-page-delimiter | |
2008 Specifies a regexp describing line-beginnings that separate pages | |
2009 of news article. | |
2010 | |
2011 [gnus-more-message is obsolete. overlay-arrow-string interfares | |
2012 with other subsystems, such as dbx mode.] | |
2013 | |
2014 gnus-digest-show-summary | |
2015 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
|
2016 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
|
2017 command. |
257 | 2018 |
2019 gnus-digest-separator | |
2020 Specifies a regexp separating messages in a digest article. | |
2021 | |
2022 gnus-mail-reply-method | |
2023 gnus-mail-other-window-method | |
2024 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
|
2025 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
|
2026 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
|
2027 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
|
2028 functions gnus-mail-other-window-using-mail and |
257 | 2029 gnus-mail-other-window-using-mhe are available for the value of |
2030 gnus-mail-other-window-method. | |
2031 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2032 gnus-mail-send-method |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2033 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
|
2034 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
|
2035 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
|
2036 uses sendmail mail program. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2037 |
257 | 2038 Various hooks for customization: |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2039 gnus-summary-mode-hook |
257 | 2040 Entry to this mode calls the value with no arguments, if that |
2041 value is non-nil. | |
2042 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2043 gnus-select-group-hook |
257 | 2044 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
|
2045 is non-nil. It is possible to sort subjects in this hook. See the |
257 | 2046 documentation of this variable for more information. |
2047 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2048 gnus-summary-prepare-hook |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2049 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
|
2050 Summary buffer, if that value is non-nil. If you'd like to modify |
257 | 2051 the buffer, you can use this hook. |
2052 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2053 gnus-select-article-hook |
257 | 2054 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
|
2055 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
|
2056 information. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2057 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2058 gnus-select-digest-hook |
257 | 2059 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
|
2060 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
|
2061 article so that Rmail can work with it. See the documentation of |
257 | 2062 the variable for more information. |
2063 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2064 gnus-rmail-digest-hook |
257 | 2065 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
|
2066 if that value is non-nil. This hook is intended to customize Rmail |
257 | 2067 mode. |
2068 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2069 gnus-apply-kill-hook |
257 | 2070 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
|
2071 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
|
2072 file to the selected newsgroup. The format of KILL file is |
257 | 2073 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
|
2074 them in the new format. See the documentation of Kill file mode |
257 | 2075 for more information. |
2076 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2077 gnus-mark-article-hook |
257 | 2078 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
|
2079 time. The hook is intended to mark an article as read (or unread) |
257 | 2080 automatically when it is selected. See the documentation of the |
2081 variable for more information. | |
2082 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2083 gnus-exit-group-hook |
257 | 2084 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
|
2085 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
|
2086 from Summary mode takes very long time, inhibit marking articles |
257 | 2087 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
|
2088 gnus-use-cross-reference to nil in this hook." |
257 | 2089 (interactive) |
2090 (kill-all-local-variables) | |
2091 ;; Gee. Why don't you upgrade? | |
2092 (cond ((boundp 'mode-line-modified) | |
2093 (setq mode-line-modified "--- ")) | |
2094 ((listp (default-value 'mode-line-format)) | |
2095 (setq mode-line-format | |
2096 (cons "--- " (cdr (default-value 'mode-line-format)))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2097 ;; To disable display-time facility. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2098 ;;(make-local-variable 'global-mode-string) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2099 ;;(setq global-mode-string nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2100 (setq major-mode 'gnus-summary-mode) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2101 (setq mode-name "Summary") |
257 | 2102 ;;(setq mode-line-process '(" " gnus-newsgroup-name)) |
2103 (make-local-variable 'minor-mode-alist) | |
2104 (or (assq 'gnus-show-threads minor-mode-alist) | |
2105 (setq minor-mode-alist | |
2106 (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
|
2107 (gnus-summary-set-mode-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2108 (use-local-map gnus-summary-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2109 (buffer-flush-undo (current-buffer)) |
257 | 2110 (setq buffer-read-only t) ;Disable modification |
2111 (setq truncate-lines t) ;Stop line folding | |
2112 (setq selective-display t) | |
2113 (setq selective-display-ellipses t) ;Display `...' | |
2114 ;;(setq case-fold-search t) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2115 (run-hooks 'gnus-summary-mode-hook)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2116 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2117 (defun gnus-summary-setup-buffer () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2118 "Initialize Summary buffer." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2119 (if (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2120 (set-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2121 (set-buffer (get-buffer-create gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2122 (gnus-summary-mode) |
257 | 2123 )) |
2124 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2125 (defun gnus-summary-read-group (group &optional show-all no-article) |
257 | 2126 "Start reading news in newsgroup GROUP. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2127 If optional 1st argument SHOW-ALL is non-nil, already read articles are |
257 | 2128 also listed. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2129 If optional 2nd argument NO-ARTICLE is non-nil, no article is selected |
257 | 2130 initially." |
2131 (message "Retrieving newsgroup: %s..." group) | |
2132 (if (gnus-select-newsgroup group show-all) | |
2133 (progn | |
2134 ;; Don't switch-to-buffer to prevent displaying old contents | |
2135 ;; of the buffer until new subjects list is created. | |
2136 ;; Suggested by Juha Heinanen <jh@tut.fi> | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2137 (gnus-summary-setup-buffer) |
257 | 2138 ;; 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
|
2139 (run-hooks 'gnus-select-group-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2140 (gnus-summary-prepare) |
257 | 2141 ;; 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
|
2142 (run-hooks 'gnus-apply-kill-hook) |
257 | 2143 (if (zerop (buffer-size)) |
2144 ;; This newsgroup is empty. | |
2145 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2146 (gnus-summary-catchup-and-exit nil t) ;Without confirmations. |
257 | 2147 (message "No unread news")) |
2148 ;; 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
|
2149 ;; gnus-summary-prepare-hook since kill processing may not |
257 | 2150 ;; work with hidden articles. |
2151 (and gnus-show-threads | |
2152 gnus-thread-hide-subtree | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2153 (gnus-summary-hide-all-threads)) |
257 | 2154 ;; Show first unread article if requested. |
2155 (goto-char (point-min)) | |
2156 (if (and (not no-article) | |
2157 gnus-auto-select-first | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2158 (gnus-summary-first-unread-article)) |
257 | 2159 ;; Window is configured automatically. |
2160 ;; 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
|
2161 ;; evaluation, especially by gnus-summary-rmail-digest |
257 | 2162 ;; 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
|
2163 (if (eq (current-buffer) (get-buffer gnus-summary-buffer)) |
257 | 2164 (progn |
2165 ;; Adjust cursor point. | |
2166 (beginning-of-line) | |
2167 (search-forward ":" nil t))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2168 (gnus-configure-windows 'summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2169 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2170 (gnus-summary-set-mode-line) |
257 | 2171 ;; 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
|
2172 (if (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2173 (if (get-buffer-window gnus-article-buffer) |
257 | 2174 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2175 (set-buffer gnus-article-buffer) |
257 | 2176 (let ((buffer-read-only nil)) |
2177 (erase-buffer))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2178 (kill-buffer gnus-article-buffer))) |
257 | 2179 ;; Adjust cursor point. |
2180 (beginning-of-line) | |
2181 (search-forward ":" nil t)) | |
2182 )) | |
2183 ;; Cannot select newsgroup GROUP. | |
2184 (if (gnus-gethash group gnus-active-hashtb) | |
2185 (progn | |
2186 ;; If NNTP is used, nntp_access file may not be installed | |
2187 ;; properly. Otherwise, may be active file problem. | |
2188 (ding) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2189 (message |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2190 (gnus-nntp-message |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2191 (format "Cannot select %s. May be security or active file problem." group))) |
257 | 2192 (sit-for 0)) |
2193 ;; Check bogus newsgroups. | |
2194 ;; We must be in Group Mode buffer. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2195 (gnus-group-check-bogus-groups)) |
257 | 2196 )) |
2197 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2198 (defun gnus-summary-prepare () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2199 "Prepare summary list of current newsgroup in Summary buffer." |
257 | 2200 (let ((buffer-read-only nil)) |
2201 ;; 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
|
2202 ;; want it can define them in gnus-select-group-hook. |
257 | 2203 ;; Print verbose messages if too many articles are selected. |
2204 ;; (and (numberp gnus-large-newsgroup) | |
2205 ;; (> (length gnus-newsgroup-headers) gnus-large-newsgroup) | |
2206 ;; (message "Preparing headers...")) | |
2207 (erase-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2208 (gnus-summary-prepare-threads |
257 | 2209 (if gnus-show-threads |
2210 (gnus-make-threads gnus-newsgroup-headers) | |
2211 gnus-newsgroup-headers) 0) | |
2212 ;; Erase header retrieval message. | |
2213 (message "") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2214 ;; Call hooks for modifying Summary buffer. |
257 | 2215 ;; Suggested by sven@tde.LTH.Se (Sven Mattisson). |
2216 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2217 (run-hooks 'gnus-summary-prepare-hook) |
257 | 2218 )) |
2219 | |
2220 ;; 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
|
2221 ;; 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
|
2222 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2223 (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
|
2224 "Prepare Summary buffer from THREADS and indentation LEVEL. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2225 THREADS is a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...]).' |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2226 Optional PARENT-SUBJECT specifies the subject of the parent." |
257 | 2227 (let ((thread nil) |
2228 (header nil) | |
2229 (number nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2230 (subject nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2231 (child-subject nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2232 (parent-subject (or parent-subject "")) |
257 | 2233 ;; `M Indent NUM: [OPT] SUBJECT' |
2234 (cntl (format "%%s %%s%%%dd: [%%s] %%s\n" | |
2235 (length (prin1-to-string gnus-newsgroup-end))))) | |
2236 (while threads | |
2237 (setq thread (car threads)) | |
2238 (setq threads (cdr threads)) | |
2239 ;; If thread is a cons, hierarchical threads is given. | |
2240 ;; Otherwise, thread itself is header. | |
2241 (if (consp thread) | |
2242 (setq header (car thread)) | |
2243 (setq header thread)) | |
2244 ;; Print valid header only. | |
2245 (if (vectorp header) ;Depends on nntp.el. | |
2246 (progn | |
2247 (setq number (nntp-header-number header)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2248 (setq subject (nntp-header-subject header)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2249 (setq child-subject (gnus-simplify-subject subject 're-only)) |
257 | 2250 (insert |
2251 (format cntl | |
2252 ;; Read or not. | |
2253 (cond ((memq number gnus-newsgroup-marked) "-") | |
2254 ((memq number gnus-newsgroup-unreads) " ") | |
2255 (t "D")) | |
2256 ;; Thread level. | |
2257 (make-string (* level gnus-thread-indent-level) ? ) | |
2258 ;; Article number. | |
2259 number | |
2260 ;; Optional headers. | |
2261 (or (and gnus-optional-headers | |
2262 (funcall gnus-optional-headers header)) "") | |
2263 ;; Its subject string. | |
2264 (concat (if (or (zerop level) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2265 (not gnus-thread-hide-subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2266 ;; Subject is different from the parent. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2267 (not (string-equal |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2268 parent-subject child-subject))) |
257 | 2269 nil |
2270 (make-string (window-width) ? )) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2271 subject) |
257 | 2272 )) |
2273 )) | |
2274 ;; Print subthreads. | |
2275 (and (consp thread) | |
2276 (cdr thread) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2277 (gnus-summary-prepare-threads |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2278 (cdr thread) (1+ level) child-subject)) |
257 | 2279 ))) |
2280 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2281 ;;(defun gnus-summary-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2282 ;; "Set Summary mode line string." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2283 ;; ;; 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
|
2284 ;; (let ((subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2285 ;; (if gnus-current-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2286 ;; (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
|
2287 ;; (setq mode-line-buffer-identification |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2288 ;; (concat "GNUS: " |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2289 ;; subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2290 ;; ;; Enough spaces to pad subject to 17 positions. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2291 ;; (make-string (max 0 (- 17 (length subject))) ? )))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2292 ;; (set-buffer-modified-p t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2293 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2294 ;; New implementation in gnus 3.14.3 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2295 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2296 (defun gnus-summary-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2297 "Set Summary mode line string. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2298 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
|
2299 (let ((unmarked |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2300 (- (length gnus-newsgroup-unreads) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2301 (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2302 gnus-newsgroup-unreads gnus-newsgroup-marked)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2303 (unselected |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2304 (- (length gnus-newsgroup-unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2305 (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2306 gnus-newsgroup-unselected gnus-newsgroup-marked))))) |
257 | 2307 (setq mode-line-buffer-identification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2308 (list 17 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2309 (format "GNUS: %s%s %s" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2310 gnus-newsgroup-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2311 (if gnus-current-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2312 (format "/%d" gnus-current-article) "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2313 ;; Basic ideas by tale@pawl.rpi.edu. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2314 (cond ((and (zerop unmarked) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2315 (zerop unselected)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2316 "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2317 ((zerop unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2318 (format "{%d more}" unmarked)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2319 (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2320 (format "{%d(+%d) more}" unmarked unselected))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2321 )))) |
257 | 2322 (set-buffer-modified-p t)) |
2323 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2324 ;; GNUS Summary mode command. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2325 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2326 (defun gnus-summary-search-group (&optional backward) |
257 | 2327 "Search for next unread newsgroup. |
2328 If optional argument BACKWARD is non-nil, search backward instead." | |
2329 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2330 (set-buffer gnus-group-buffer) |
257 | 2331 (save-excursion |
2332 ;; 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
|
2333 (if (gnus-group-search-forward backward nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2334 (gnus-group-group-name)) |
257 | 2335 ))) |
2336 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2337 (defun gnus-summary-search-subject (backward unread subject) |
257 | 2338 "Search for article forward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2339 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
|
2340 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
|
2341 If 3rd argument SUBJECT is non-nil, the article which has |
257 | 2342 the same subject will be searched for." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2343 (let ((func |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2344 (if backward |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2345 (function re-search-backward) (function re-search-forward))) |
257 | 2346 (article nil) |
2347 ;; We have to take care of hidden lines. | |
2348 (regexp | |
2349 (format "^%s[ \t]+\\([0-9]+\\):.\\[[^]\r\n]*\\][ \t]+%s" | |
2350 ;;(if unread " " ".") | |
2351 (cond ((eq unread t) " ") (unread "[ ---]") (t ".")) | |
2352 (if subject | |
2353 (concat "\\([Rr][Ee]:[ \t]+\\)*" | |
2354 (regexp-quote (gnus-simplify-subject subject)) | |
2355 ;; Ignore words in parentheses. | |
2356 "\\([ \t]*([^\r\n]*)\\)*[ \t]*\\(\r\\|$\\)") | |
2357 "") | |
2358 ))) | |
2359 (if backward | |
2360 (beginning-of-line) | |
2361 (end-of-line)) | |
2362 (if (funcall func regexp nil t) | |
2363 (setq article | |
2364 (string-to-int | |
2365 (buffer-substring (match-beginning 1) (match-end 1))))) | |
2366 ;; Adjust cursor point. | |
2367 (beginning-of-line) | |
2368 (search-forward ":" nil t) | |
2369 ;; This is the result. | |
2370 article | |
2371 )) | |
2372 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2373 (defun gnus-summary-search-forward (&optional unread subject) |
257 | 2374 "Search for article forward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2375 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
|
2376 If 2nd optional argument SUBJECT is non-nil, the article which has |
257 | 2377 the same subject will be searched for." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2378 (gnus-summary-search-subject nil unread subject)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2379 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2380 (defun gnus-summary-search-backward (&optional unread subject) |
257 | 2381 "Search for article backward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2382 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
|
2383 If 2nd optional argument SUBJECT is non-nil, the article which has |
257 | 2384 the same subject will be searched for." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2385 (gnus-summary-search-subject t unread subject)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2386 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2387 (defun gnus-summary-article-number () |
257 | 2388 "Article number around point. If nothing, return current number." |
2389 (save-excursion | |
2390 (beginning-of-line) | |
2391 (if (looking-at ".[ \t]+\\([0-9]+\\):") | |
2392 (string-to-int | |
2393 (buffer-substring (match-beginning 1) (match-end 1))) | |
2394 ;; If search fail, return current article number. | |
2395 gnus-current-article | |
2396 ))) | |
2397 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2398 (defun gnus-summary-subject-string () |
257 | 2399 "Return current subject string or nil if nothing." |
2400 (save-excursion | |
2401 ;; 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
|
2402 ;; `gnus-summary-article-number' and `gnus-newsgroup-headers'. |
257 | 2403 (beginning-of-line) |
2404 ;; We have to take care of hidden lines. | |
2405 (if (looking-at ".[ \t]+[0-9]+:.\\[[^]\r\n]*\\][ \t]+\\([^\r\n]*\\)[\r\n]") | |
2406 (buffer-substring (match-beginning 1) (match-end 1))) | |
2407 )) | |
2408 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2409 (defun gnus-summary-goto-subject (article) |
257 | 2410 "Move point to ARTICLE's subject." |
2411 (interactive | |
2412 (list | |
2413 (string-to-int | |
2414 (completing-read "Article number: " | |
2415 (mapcar | |
2416 (function | |
2417 (lambda (headers) | |
2418 (list | |
2419 (int-to-string (nntp-header-number headers))))) | |
2420 gnus-newsgroup-headers) | |
2421 nil 'require-match)))) | |
2422 (let ((current (point))) | |
2423 (goto-char (point-min)) | |
2424 (or (and article (re-search-forward (format "^.[ \t]+%d:" article) nil t)) | |
2425 (progn (goto-char current) nil)) | |
2426 )) | |
2427 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2428 (defun gnus-summary-recenter () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2429 "Center point in Summary window." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2430 ;; Scroll window so as to cursor comes center of Summary window |
257 | 2431 ;; only when article is displayed. |
2432 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). | |
2433 ;; Recenter only when requested. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2434 ;; Subbested by popovich@park.cs.columbia.edu |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2435 (and gnus-auto-center-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2436 (get-buffer-window gnus-article-buffer) |
257 | 2437 (< (/ (- (window-height) 1) 2) |
2438 (count-lines (point) (point-max))) | |
2439 (recenter (/ (- (window-height) 2) 2)))) | |
2440 | |
2441 ;; Walking around Group mode buffer. | |
2442 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2443 (defun gnus-summary-jump-to-group (newsgroup) |
257 | 2444 "Move point to NEWSGROUP in Group mode buffer." |
2445 ;; Keep update point of Group mode buffer if visible. | |
2446 (if (eq (current-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2447 (get-buffer gnus-group-buffer)) |
257 | 2448 (save-window-excursion |
2449 ;; Take care of tree window mode. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2450 (if (get-buffer-window gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2451 (pop-to-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2452 (gnus-group-jump-to-group newsgroup)) |
257 | 2453 (save-excursion |
2454 ;; Take care of tree window mode. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2455 (if (get-buffer-window gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2456 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2457 (set-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2458 (gnus-group-jump-to-group newsgroup)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2459 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2460 (defun gnus-summary-next-group (no-article) |
257 | 2461 "Exit current newsgroup and then select next unread newsgroup. |
2462 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
2463 (interactive "P") | |
2464 ;; 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
|
2465 (gnus-summary-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2466 (let ((group (gnus-summary-search-group))) |
257 | 2467 (if (null group) |
2468 (progn | |
2469 (message "Exiting %s..." gnus-newsgroup-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2470 (gnus-summary-exit) |
257 | 2471 (message "")) |
2472 (message "Selecting %s..." group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2473 (gnus-summary-exit t) ;Exit Summary mode temporary. |
257 | 2474 ;; We are now in Group mode buffer. |
2475 ;; 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
|
2476 (gnus-summary-jump-to-group group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2477 (gnus-summary-read-group group nil no-article) |
257 | 2478 (or (eq (current-buffer) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2479 (get-buffer gnus-summary-buffer)) |
257 | 2480 (eq gnus-auto-select-next t) |
2481 ;; Expected newsgroup has nothing to read since the articles | |
2482 ;; are marked as read by cross-referencing. So, try next | |
2483 ;; newsgroup. (Make sure we are in Group mode buffer now.) | |
2484 (and (eq (current-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2485 (get-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2486 (gnus-group-group-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2487 (gnus-summary-read-group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2488 (gnus-group-group-name) nil no-article)) |
257 | 2489 ) |
2490 ))) | |
2491 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2492 (defun gnus-summary-prev-group (no-article) |
257 | 2493 "Exit current newsgroup and then select previous unread newsgroup. |
2494 If prefix argument NO-ARTICLE is non-nil, no article is selected initially." | |
2495 (interactive "P") | |
2496 ;; 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
|
2497 (gnus-summary-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2498 (let ((group (gnus-summary-search-group t))) |
257 | 2499 (if (null group) |
2500 (progn | |
2501 (message "Exiting %s..." gnus-newsgroup-name) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2502 (gnus-summary-exit) |
257 | 2503 (message "")) |
2504 (message "Selecting %s..." group) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2505 (gnus-summary-exit t) ;Exit Summary mode temporary. |
257 | 2506 ;; We are now in Group mode buffer. |
2507 ;; We have to adjust point of Group mode buffer because current | |
2508 ;; 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
|
2509 (gnus-summary-jump-to-group group) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2510 (gnus-summary-read-group group nil no-article) |
257 | 2511 (or (eq (current-buffer) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2512 (get-buffer gnus-summary-buffer)) |
257 | 2513 (eq gnus-auto-select-next t) |
2514 ;; Expected newsgroup has nothing to read since the articles | |
2515 ;; are marked as read by cross-referencing. So, try next | |
2516 ;; newsgroup. (Make sure we are in Group mode buffer now.) | |
2517 (and (eq (current-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2518 (get-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2519 (gnus-summary-search-group t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2520 (gnus-summary-read-group |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2521 (gnus-summary-search-group t) nil no-article)) |
257 | 2522 ) |
2523 ))) | |
2524 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2525 ;; Walking around summary lines. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2526 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2527 (defun gnus-summary-next-subject (n &optional unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2528 "Go to next N'th summary line. |
257 | 2529 If optional argument UNREAD is non-nil, only unread article is selected." |
2530 (interactive "p") | |
2531 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2532 (gnus-summary-search-forward unread)) |
257 | 2533 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2534 (cond ((gnus-summary-search-forward unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2535 (gnus-summary-recenter)) |
257 | 2536 (unread |
2537 (message "No more unread articles")) | |
2538 (t | |
2539 (message "No more articles")) | |
2540 )) | |
2541 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2542 (defun gnus-summary-next-unread-subject (n) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2543 "Go to next N'th unread summary line." |
257 | 2544 (interactive "p") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2545 (gnus-summary-next-subject n t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2546 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2547 (defun gnus-summary-prev-subject (n &optional unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2548 "Go to previous N'th summary line. |
257 | 2549 If optional argument UNREAD is non-nil, only unread article is selected." |
2550 (interactive "p") | |
2551 (while (and (> n 1) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2552 (gnus-summary-search-backward unread)) |
257 | 2553 (setq n (1- n))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2554 (cond ((gnus-summary-search-backward unread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2555 (gnus-summary-recenter)) |
257 | 2556 (unread |
2557 (message "No more unread articles")) | |
2558 (t | |
2559 (message "No more articles")) | |
2560 )) | |
2561 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2562 (defun gnus-summary-prev-unread-subject (n) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2563 "Go to previous N'th unread summary line." |
257 | 2564 (interactive "p") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2565 (gnus-summary-prev-subject n t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2566 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2567 ;; Walking around summary lines with displaying articles. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2568 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2569 (defun gnus-summary-expand-window () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2570 "Expand Summary window to show headers full window." |
257 | 2571 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2572 (gnus-configure-windows 'summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2573 (pop-to-buffer gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2574 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2575 (defun gnus-summary-display-article (article &optional all-header) |
257 | 2576 "Display ARTICLE in Article buffer." |
2577 (if (null article) | |
2578 nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2579 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2580 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2581 (gnus-article-prepare article all-header) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2582 (gnus-summary-recenter) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2583 (gnus-summary-set-mode-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2584 (run-hooks 'gnus-select-article-hook) |
257 | 2585 ;; Successfully display article. |
2586 t | |
2587 )) | |
2588 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2589 (defun gnus-summary-select-article (&optional all-headers force) |
257 | 2590 "Select the current article. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2591 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
|
2592 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
|
2593 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
|
2594 (let ((article (gnus-summary-article-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2595 (all-headers (not (not all-headers)))) ;Must be T or NIL. |
257 | 2596 (if (or (null gnus-current-article) |
2597 (/= article gnus-current-article) | |
2598 (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
|
2599 ;; 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
|
2600 (gnus-summary-display-article article all-headers) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2601 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2602 (pop-to-buffer gnus-summary-buffer)) |
257 | 2603 )) |
2604 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2605 (defun gnus-summary-set-current-mark (&optional current-mark) |
257 | 2606 "Put `+' at the current article. |
2607 Optional argument specifies CURRENT-MARK instead of `+'." | |
2608 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2609 (set-buffer gnus-summary-buffer) |
257 | 2610 (let ((buffer-read-only nil)) |
2611 (goto-char (point-min)) | |
2612 ;; First of all clear mark at last article. | |
2613 (if (re-search-forward "^.[ \t]+[0-9]+:[^ \t]" nil t) | |
2614 (progn | |
2615 (delete-char -1) | |
2616 (insert " ") | |
2617 (goto-char (point-min)))) | |
2618 (if (re-search-forward (format "^.[ \t]+%d:" gnus-current-article) nil t) | |
2619 (progn | |
2620 (delete-char 1) | |
2621 (insert (or current-mark "+")))) | |
2622 ))) | |
2623 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2624 ;;(defun gnus-summary-next-article (unread &optional subject) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2625 ;; "Select article after current one. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2626 ;;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
|
2627 ;; (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2628 ;; (cond ((gnus-summary-display-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2629 ;; (gnus-summary-search-forward unread subject))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2630 ;; (unread |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2631 ;; (message "No more unread articles")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2632 ;; (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2633 ;; (message "No more articles")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2634 ;; )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2635 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2636 (defun gnus-summary-next-article (unread &optional subject) |
257 | 2637 "Select article after current one. |
2638 If argument UNREAD is non-nil, only unread article is selected." | |
2639 (interactive "P") | |
2640 (let ((header nil)) | |
2843
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))) |
257 | 2643 ((and subject |
2644 gnus-auto-select-same | |
2645 (gnus-set-difference gnus-newsgroup-unreads | |
2646 gnus-newsgroup-marked) | |
2647 (memq this-command | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2648 '(gnus-summary-next-unread-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2649 gnus-summary-next-page |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2650 gnus-summary-kill-same-subject-and-select |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2651 ;;gnus-summary-next-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2652 ;;gnus-summary-next-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2653 ;;gnus-summary-next-unread-same-subject |
257 | 2654 ))) |
2655 ;; 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
|
2656 ;; Hook function, such as gnus-summary-rmail-digest, may |
257 | 2657 ;; change current buffer, so need check. |
2658 (let ((buffer (current-buffer)) | |
2659 (last-point (point))) | |
2660 ;; No more articles with same subject, so jump to the first | |
2661 ;; unread article. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2662 (gnus-summary-first-unread-article) |
257 | 2663 ;;(and (eq buffer (current-buffer)) |
2664 ;; (= (point) last-point) | |
2665 ;; ;; Ignore given SUBJECT, and try again. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2666 ;; (gnus-summary-next-article unread nil)) |
257 | 2667 (and (eq buffer (current-buffer)) |
2668 (< (point) last-point) | |
2669 (message "Wrapped")) | |
2670 )) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2671 ((and gnus-auto-extend-newsgroup |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2672 (not unread) ;Not unread only |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2673 (not subject) ;Only if subject is not specified. |
257 | 2674 (setq header (gnus-more-header-forward))) |
2675 ;; Extend to next article if possible. | |
2676 ;; Basic ideas by himacdonald@watdragon.waterloo.edu | |
2677 (gnus-extend-newsgroup header nil) | |
2678 ;; Threads feature must be turned off. | |
2679 (let ((buffer-read-only nil)) | |
2680 (goto-char (point-max)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2681 (gnus-summary-prepare-threads (list header) 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2682 (gnus-summary-goto-article gnus-newsgroup-end)) |
257 | 2683 (t |
2684 ;; Select next newsgroup automatically if requested. | |
2685 (let ((cmd (string-to-char (this-command-keys))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2686 (group (gnus-summary-search-group)) |
257 | 2687 (auto-select |
2688 (and gnus-auto-select-next | |
2689 ;;(null (gnus-set-difference gnus-newsgroup-unreads | |
2690 ;; gnus-newsgroup-marked)) | |
2691 (memq this-command | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2692 '(gnus-summary-next-unread-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2693 gnus-summary-next-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2694 gnus-summary-next-page |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2695 gnus-summary-next-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2696 gnus-summary-next-unread-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2697 gnus-summary-kill-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2698 gnus-summary-kill-same-subject-and-select |
257 | 2699 )) |
2700 ;; Ignore characters typed ahead. | |
2701 (not (input-pending-p)) | |
2702 ))) | |
2703 (message "No more%s articles%s" | |
2704 (if unread " unread" "") | |
2705 (if (and auto-select | |
2706 (not (eq gnus-auto-select-next 'quietly))) | |
2707 (if group | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2708 (format " (Type %s for %s [%d])" |
257 | 2709 (key-description (char-to-string cmd)) |
2710 group | |
2711 (nth 1 (gnus-gethash group | |
2712 gnus-unread-hashtb))) | |
2713 (format " (Type %s to exit %s)" | |
2714 (key-description (char-to-string cmd)) | |
2715 gnus-newsgroup-name | |
2716 )) | |
2717 "")) | |
2718 ;; Select next unread newsgroup automagically. | |
2719 (cond ((and auto-select | |
2720 (eq gnus-auto-select-next 'quietly)) | |
2721 ;; Select quietly. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2722 (gnus-summary-next-group nil)) |
257 | 2723 (auto-select |
2724 ;; Confirm auto selection. | |
2725 (let ((char (read-char))) | |
2726 (if (= char cmd) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2727 (gnus-summary-next-group nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2728 (setq unread-command-char char)))) |
257 | 2729 ) |
2730 )) | |
2731 ))) | |
2732 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2733 (defun gnus-summary-next-unread-article () |
257 | 2734 "Select unread article after current one." |
2735 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2736 (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
|
2737 (gnus-summary-subject-string)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2738 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2739 (defun gnus-summary-prev-article (unread &optional subject) |
257 | 2740 "Select article before current one. |
2741 If argument UNREAD is non-nil, only unread article is selected." | |
2742 (interactive "P") | |
2743 (let ((header nil)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2744 (cond ((gnus-summary-display-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2745 (gnus-summary-search-backward unread subject))) |
257 | 2746 ((and subject |
2747 gnus-auto-select-same | |
2748 (gnus-set-difference gnus-newsgroup-unreads | |
2749 gnus-newsgroup-marked) | |
2750 (memq this-command | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2751 '(gnus-summary-prev-unread-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2752 ;;gnus-summary-prev-page |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2753 ;;gnus-summary-prev-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2754 ;;gnus-summary-prev-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2755 ;;gnus-summary-prev-unread-same-subject |
257 | 2756 ))) |
2757 ;; Ignore given SUBJECT, and try again. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2758 (gnus-summary-prev-article unread nil)) |
257 | 2759 (unread |
2760 (message "No more unread articles")) | |
2761 ((and gnus-auto-extend-newsgroup | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2762 (not subject) ;Only if subject is not specified. |
257 | 2763 (setq header (gnus-more-header-backward))) |
2764 ;; Extend to previous article if possible. | |
2765 ;; Basic ideas by himacdonald@watdragon.waterloo.edu | |
2766 (gnus-extend-newsgroup header t) | |
2767 (let ((buffer-read-only nil)) | |
2768 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2769 (gnus-summary-prepare-threads (list header) 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2770 (gnus-summary-goto-article gnus-newsgroup-begin)) |
257 | 2771 (t |
2772 (message "No more articles")) | |
2773 ))) | |
2774 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2775 (defun gnus-summary-prev-unread-article () |
257 | 2776 "Select unred article before current one." |
2777 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2778 (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
|
2779 (gnus-summary-subject-string)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2780 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2781 (defun gnus-summary-next-page (lines) |
257 | 2782 "Show next page of selected article. |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
2783 If end of article, select next article. |
257 | 2784 Argument LINES specifies lines to be scrolled up." |
2785 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2786 (let ((article (gnus-summary-article-number)) |
257 | 2787 (endp nil)) |
2788 (if (or (null gnus-current-article) | |
2789 (/= article gnus-current-article)) | |
2790 ;; 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
|
2791 (gnus-summary-display-article article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2792 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2793 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2794 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2795 (setq endp (gnus-article-next-page lines))) |
257 | 2796 (cond ((and endp lines) |
2797 (message "End of message")) | |
2798 ((and endp (null lines)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2799 (gnus-summary-next-unread-article))) |
257 | 2800 ))) |
2801 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2802 (defun gnus-summary-prev-page (lines) |
257 | 2803 "Show previous page of selected article. |
2804 Argument LINES specifies lines to be scrolled down." | |
2805 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2806 (let ((article (gnus-summary-article-number))) |
257 | 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 (gnus-article-prev-page lines)) |
257 | 2815 ))) |
2816 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2817 (defun gnus-summary-scroll-up (lines) |
257 | 2818 "Scroll up (or down) one line current article. |
2819 Argument LINES specifies lines to be scrolled up (or down if negative)." | |
2820 (interactive "p") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2821 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2822 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2823 (cond ((> lines 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2824 (if (gnus-article-next-page lines) |
257 | 2825 (message "End of message"))) |
2826 ((< lines 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2827 (gnus-article-prev-page (- 0 lines)))) |
257 | 2828 )) |
2829 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2830 (defun gnus-summary-next-same-subject () |
257 | 2831 "Select next article which has the same subject as current one." |
2832 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2833 (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
|
2834 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2835 (defun gnus-summary-prev-same-subject () |
257 | 2836 "Select previous article which has the same subject as current one." |
2837 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2838 (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
|
2839 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2840 (defun gnus-summary-next-unread-same-subject () |
257 | 2841 "Select next unread article which has the same subject as current one." |
2842 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2843 (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
|
2844 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2845 (defun gnus-summary-prev-unread-same-subject () |
257 | 2846 "Select previous unread article which has the same subject as current one." |
2847 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2848 (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
|
2849 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2850 (defun gnus-summary-refer-parent-article (child) |
257 | 2851 "Refer parent article of current article. |
2852 If a prefix argument CHILD is non-nil, go back to the child article | |
2853 using internally maintained articles history. | |
2854 NOTE: This command may not work with nnspool.el." | |
2855 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2856 (gnus-summary-select-article t t) ;Request all headers. |
257 | 2857 (let ((referenced-id nil)) ;Message-id of parent or child article. |
2858 (if child | |
2859 ;; Go back to child article using history. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2860 (gnus-summary-refer-article nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2861 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2862 ;; Look for parent Message-ID. |
2863 ;; 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
|
2864 ;; because we may be looking at parent or referred article. |
257 | 2865 (let ((references (gnus-fetch-field "References"))) |
2866 ;; Get the last message-id in the references. | |
2867 (and references | |
2868 (string-match "\\(<[^<>]+>\\)[^>]*\\'" references) | |
2869 (setq referenced-id | |
2870 (substring references | |
2871 (match-beginning 1) (match-end 1)))) | |
2872 )) | |
2873 (if (stringp referenced-id) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2874 (gnus-summary-refer-article referenced-id) |
257 | 2875 (error "No more parents")) |
2876 ))) | |
2877 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2878 (defun gnus-summary-refer-article (message-id) |
257 | 2879 "Refer article specified by MESSAGE-ID. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2880 If the MESSAGE-ID is nil or an empty string, Message-ID is poped from |
257 | 2881 internally maintained articles history. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2882 NOTE: This command may not work with nnspool.el nor mhspool.el." |
257 | 2883 (interactive "sMessage-ID: ") |
2884 ;; Make sure that this command depends on the fact that article | |
2885 ;; related information is not updated when an article is retrieved | |
2886 ;; by Message-ID. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2887 (gnus-summary-select-article t t) ;Request all headers. |
257 | 2888 (if (and (stringp message-id) |
2889 (> (length message-id) 0)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2890 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2891 ;; Construct the correct Message-ID if necessary. |
2892 ;; Suggested by tale@pawl.rpi.edu. | |
2893 (or (string-match "^<" message-id) | |
2894 (setq message-id (concat "<" message-id))) | |
2895 (or (string-match ">$" message-id) | |
2896 (setq message-id (concat message-id ">"))) | |
2897 ;; Push current message-id on history. | |
2898 ;; 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
|
2899 ;; message-id because we may be looking at parent or referred |
257 | 2900 ;; article. |
2901 (let ((current (gnus-fetch-field "Message-ID"))) | |
2902 (or (equal current message-id) ;Nothing to do. | |
2903 (equal current (car gnus-current-history)) | |
2904 (setq gnus-current-history | |
2905 (cons current gnus-current-history))) | |
2906 )) | |
2907 ;; Pop message-id from history. | |
2908 (setq message-id (car gnus-current-history)) | |
2909 (setq gnus-current-history (cdr gnus-current-history))) | |
2910 (if (stringp message-id) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2911 ;; 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
|
2912 ;; nnspool nor mhspool. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2913 (gnus-article-prepare message-id t) |
257 | 2914 (error "No such references")) |
2915 ) | |
2916 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2917 (defun gnus-summary-next-digest (nth) |
257 | 2918 "Move to head of NTH next digested message." |
2919 (interactive "p") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2920 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2921 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2922 (gnus-article-next-digest (or nth 1)) |
257 | 2923 )) |
2924 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2925 (defun gnus-summary-prev-digest (nth) |
257 | 2926 "Move to head of NTH previous digested message." |
2927 (interactive "p") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2928 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2929 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2930 (gnus-article-prev-digest (or nth 1)) |
257 | 2931 )) |
2932 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2933 (defun gnus-summary-first-unread-article () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2934 "Select first unread article. Return non-nil if successfully selected." |
257 | 2935 (interactive) |
2936 (let ((begin (point))) | |
2937 (goto-char (point-min)) | |
2938 (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
|
2939 (gnus-summary-display-article (gnus-summary-article-number)) |
257 | 2940 ;; If there is no unread articles, stay there. |
2941 (goto-char begin) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2942 ;;(gnus-summary-display-article (gnus-summary-article-number)) |
257 | 2943 (message "No more unread articles") |
2944 nil | |
2945 ) | |
2946 )) | |
2947 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2948 (defun gnus-summary-isearch-article () |
257 | 2949 "Do incremental search forward on current article." |
2950 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2951 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2952 (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
|
2953 (isearch-forward))) |
257 | 2954 |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2955 (defun gnus-summary-search-article-forward (regexp) |
257 | 2956 "Search for an article containing REGEXP forward. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2957 gnus-select-article-hook is not called during the search." |
257 | 2958 (interactive |
2959 (list (read-string | |
2960 (concat "Search forward (regexp): " | |
2961 (if gnus-last-search-regexp | |
2962 (concat "(default " gnus-last-search-regexp ") ")))))) | |
2963 (if (string-equal regexp "") | |
2964 (setq regexp (or gnus-last-search-regexp "")) | |
2965 (setq gnus-last-search-regexp regexp)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2966 (if (gnus-summary-search-article regexp nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2967 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 2968 (recenter 0) |
2969 ;;(sit-for 1) | |
2970 ) | |
2971 (error "Search failed: \"%s\"" regexp) | |
2972 )) | |
2973 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2974 (defun gnus-summary-search-article-backward (regexp) |
257 | 2975 "Search for an article containing REGEXP backward. |
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 backward (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 t) |
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 (regexp &optional backward) |
257 | 2994 "Search for an article containing REGEXP. |
2995 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
|
2996 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
|
2997 (let ((gnus-select-article-hook nil) ;Disable hook. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
2998 (gnus-mark-article-hook nil) ;Inhibit marking as read. |
257 | 2999 (re-search |
3000 (if backward | |
3001 (function re-search-backward) (function re-search-forward))) | |
3002 (found nil) | |
3003 (last nil)) | |
3004 ;; 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
|
3005 (gnus-summary-show-all-threads) |
257 | 3006 ;; First of all, search current article. |
3007 ;; We don't want to read article again from NNTP server nor reset | |
3008 ;; current point. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3009 (gnus-summary-select-article) |
257 | 3010 (message "Searching article: %d..." gnus-current-article) |
3011 (setq last gnus-current-article) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3012 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3013 (save-restriction |
3014 (widen) | |
3015 ;; Begin search from current point. | |
3016 (setq found (funcall re-search regexp nil t)))) | |
3017 ;; Then search next articles. | |
3018 (while (and (not found) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3019 (gnus-summary-display-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3020 (gnus-summary-search-subject backward nil nil))) |
257 | 3021 (message "Searching article: %d..." gnus-current-article) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3022 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3023 (save-restriction |
3024 (widen) | |
3025 (goto-char (if backward (point-max) (point-min))) | |
3026 (setq found (funcall re-search regexp nil t))) | |
3027 )) | |
3028 (message "") | |
3029 ;; Adjust article pointer. | |
3030 (or (eq last gnus-current-article) | |
3031 (setq gnus-last-article last)) | |
3032 ;; Return T if found such article. | |
3033 found | |
3034 )) | |
3035 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3036 (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
|
3037 "If FIELD of article header matches REGEXP, execute a COMMAND string. |
257 | 3038 If FIELD is an empty string (or nil), entire article body is searched for. |
3039 If optional (prefix) argument BACKWARD is non-nil, do backward instead." | |
3040 (interactive | |
3041 (list (let ((completion-ignore-case t)) | |
3042 (completing-read "Field name: " | |
3043 '(("Number")("Subject")("From") | |
3044 ("Lines")("Date")("Id") | |
3045 ("Xref")("References")) | |
3046 nil 'require-match)) | |
3047 (read-string "Regexp: ") | |
3048 (read-key-sequence "Command: ") | |
3049 current-prefix-arg)) | |
3050 ;; 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
|
3051 (gnus-summary-show-all-threads) |
257 | 3052 ;; We don't want to change current point nor window configuration. |
3053 (save-excursion | |
3054 (save-window-excursion | |
3055 (message "Executing %s..." (key-description command)) | |
3056 ;; We'd like to execute COMMAND interactively so as to give arguments. | |
3057 (gnus-execute field regexp | |
3058 (` (lambda () | |
3059 (call-interactively '(, (key-binding command))))) | |
3060 backward) | |
3061 (message "Executing %s... done" (key-description command))))) | |
3062 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3063 (defun gnus-summary-beginning-of-article () |
257 | 3064 "Go to beginning of article body" |
3065 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3066 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3067 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3068 (widen) |
3069 (beginning-of-buffer) | |
3070 (if gnus-break-pages | |
3071 (gnus-narrow-to-page)) | |
3072 )) | |
3073 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3074 (defun gnus-summary-end-of-article () |
257 | 3075 "Go to end of article body" |
3076 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3077 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3078 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3079 (widen) |
3080 (end-of-buffer) | |
3081 (if gnus-break-pages | |
3082 (gnus-narrow-to-page)) | |
3083 )) | |
3084 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3085 (defun gnus-summary-goto-article (article &optional all-headers) |
257 | 3086 "Read ARTICLE if exists. |
3087 Optional argument ALL-HEADERS means all headers are shown." | |
3088 (interactive | |
3089 (list | |
3090 (string-to-int | |
3091 (completing-read "Article number: " | |
3092 (mapcar | |
3093 (function | |
3094 (lambda (headers) | |
3095 (list | |
3096 (int-to-string (nntp-header-number headers))))) | |
3097 gnus-newsgroup-headers) | |
3098 nil 'require-match)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3099 (if (gnus-summary-goto-subject article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3100 (gnus-summary-display-article article all-headers))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3101 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3102 (defun gnus-summary-goto-last-article () |
257 | 3103 "Go to last subject line." |
3104 (interactive) | |
3105 (if gnus-last-article | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3106 (gnus-summary-goto-article gnus-last-article))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3107 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3108 (defun gnus-summary-show-article () |
257 | 3109 "Force to show current article." |
3110 (interactive) | |
3111 ;; The following is a trick to force to read the current article again. | |
3112 (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
|
3113 (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
|
3114 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3115 (defun gnus-summary-toggle-header (arg) |
257 | 3116 "Show original header if pruned header currently shown, or vice versa. |
3117 With arg, show original header iff arg is positive." | |
3118 (interactive "P") | |
3119 ;; Variable gnus-show-all-headers must be NIL to toggle really. | |
3120 (let ((gnus-show-all-headers nil) | |
3121 (all-headers | |
3122 (if (null arg) (not gnus-have-all-headers) | |
3123 (> (prefix-numeric-value arg) 0)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3124 (gnus-summary-select-article all-headers t))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3125 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3126 (defun gnus-summary-show-all-headers () |
257 | 3127 "Show original article header." |
3128 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3129 (gnus-summary-select-article t t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3130 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3131 (defun gnus-summary-toggle-mime (arg) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3132 "Toggle MIME processing. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3133 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
|
3134 (interactive "P") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3135 (setq gnus-show-mime |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3136 (if (null arg) (not gnus-show-mime) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3137 (> (prefix-numeric-value arg) 0))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3138 ;; 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
|
3139 (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
|
3140 (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
|
3141 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3142 (defun gnus-summary-stop-page-breaking () |
257 | 3143 "Stop page breaking by linefeed temporary (Widen article buffer)." |
3144 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3145 (gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3146 (gnus-eval-in-buffer-window gnus-article-buffer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3147 (widen) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3148 )) |
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-kill-same-subject-and-select (unmark) |
257 | 3151 "Mark articles which has the same subject as read, and then select next. |
3152 If argument UNMARK is positive, remove any kinds of marks. | |
3153 If argument UNMARK is negative, mark articles as unread instead." | |
3154 (interactive "P") | |
3155 (if unmark | |
3156 (setq unmark (prefix-numeric-value unmark))) | |
3157 (let ((count | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3158 (gnus-summary-mark-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3159 (gnus-summary-subject-string) unmark))) |
257 | 3160 ;; Select next unread article. If auto-select-same mode, should |
3161 ;; select the first unread article. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3162 (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
|
3163 (gnus-summary-subject-string))) |
257 | 3164 (message "%d articles are marked as %s" |
3165 count (if unmark "unread" "read")) | |
3166 )) | |
3167 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3168 (defun gnus-summary-kill-same-subject (unmark) |
257 | 3169 "Mark articles which has the same subject as read. |
3170 If argument UNMARK is positive, remove any kinds of marks. | |
3171 If argument UNMARK is negative, mark articles as unread instead." | |
3172 (interactive "P") | |
3173 (if unmark | |
3174 (setq unmark (prefix-numeric-value unmark))) | |
3175 (let ((count | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3176 (gnus-summary-mark-same-subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3177 (gnus-summary-subject-string) unmark))) |
257 | 3178 ;; If marked as read, go to next unread subject. |
3179 (if (null unmark) | |
3180 ;; Go to next unread subject. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3181 (gnus-summary-next-subject 1 t)) |
257 | 3182 (message "%d articles are marked as %s" |
3183 count (if unmark "unread" "read")) | |
3184 )) | |
3185 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3186 (defun gnus-summary-mark-same-subject (subject &optional unmark) |
257 | 3187 "Mark articles with same SUBJECT as read, and return marked number. |
3188 If optional argument UNMARK is positive, remove any kinds of marks. | |
3189 If optional argument UNMARK is negative, mark articles as unread instead." | |
3190 (let ((count 1)) | |
3191 (save-excursion | |
3192 (cond ((null unmark) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3193 (gnus-summary-mark-as-read nil "K")) |
257 | 3194 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3195 (gnus-summary-mark-as-unread nil t)) |
257 | 3196 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3197 (gnus-summary-mark-as-unread))) |
257 | 3198 (while (and subject |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3199 (gnus-summary-search-forward nil subject)) |
257 | 3200 (cond ((null unmark) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3201 (gnus-summary-mark-as-read nil "K")) |
257 | 3202 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3203 (gnus-summary-mark-as-unread nil t)) |
257 | 3204 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3205 (gnus-summary-mark-as-unread))) |
257 | 3206 (setq count (1+ count)) |
3207 )) | |
3208 ;; Hide killed thread subtrees. Does not work properly always. | |
3209 ;;(and (null unmark) | |
3210 ;; gnus-thread-hide-killed | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3211 ;; (gnus-summary-hide-thread)) |
257 | 3212 ;; Return number of articles marked as read. |
3213 count | |
3214 )) | |
3215 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3216 (defun gnus-summary-mark-as-unread-forward (count) |
257 | 3217 "Mark current article as unread, and then go forward. |
3218 Argument COUNT specifies number of articles marked as unread." | |
3219 (interactive "p") | |
3220 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3221 (gnus-summary-mark-as-unread nil nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3222 (gnus-summary-next-subject 1 nil) |
257 | 3223 (setq count (1- count)))) |
3224 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3225 (defun gnus-summary-mark-as-unread-backward (count) |
257 | 3226 "Mark current article as unread, and then go backward. |
3227 Argument COUNT specifies number of articles marked as unread." | |
3228 (interactive "p") | |
3229 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3230 (gnus-summary-mark-as-unread nil nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3231 (gnus-summary-prev-subject 1 nil) |
257 | 3232 (setq count (1- count)))) |
3233 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3234 (defun gnus-summary-mark-as-unread (&optional article clear-mark) |
257 | 3235 "Mark current article as unread. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3236 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
|
3237 Optional 2nd argument CLEAR-MARK remove any kinds of mark." |
257 | 3238 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3239 (set-buffer gnus-summary-buffer) |
257 | 3240 ;; First of all, show hidden thread subtrees. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3241 (gnus-summary-show-thread) |
257 | 3242 (let* ((buffer-read-only nil) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3243 (current (gnus-summary-article-number)) |
257 | 3244 (article (or article current))) |
3245 (gnus-mark-article-as-unread article clear-mark) | |
3246 (if (or (eq article current) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3247 (gnus-summary-goto-subject article)) |
257 | 3248 (progn |
3249 (beginning-of-line) | |
3250 (delete-char 1) | |
3251 (insert (if clear-mark " " "-")))) | |
3252 ))) | |
3253 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3254 (defun gnus-summary-mark-as-read-forward (count) |
257 | 3255 "Mark current article as read, and then go forward. |
3256 Argument COUNT specifies number of articles marked as read" | |
3257 (interactive "p") | |
3258 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3259 (gnus-summary-mark-as-read) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3260 (gnus-summary-next-subject 1 'unread-only) |
257 | 3261 (setq count (1- count)))) |
3262 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3263 (defun gnus-summary-mark-as-read-backward (count) |
257 | 3264 "Mark current article as read, and then go backward. |
3265 Argument COUNT specifies number of articles marked as read" | |
3266 (interactive "p") | |
3267 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3268 (gnus-summary-mark-as-read) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3269 (gnus-summary-prev-subject 1 'unread-only) |
257 | 3270 (setq count (1- count)))) |
3271 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3272 (defun gnus-summary-mark-as-read (&optional article mark) |
257 | 3273 "Mark current article as read. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3274 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
|
3275 Optional 2nd argument MARK specifies a string inserted at beginning of line. |
257 | 3276 Any kind of string (length 1) except for a space and `-' is ok." |
3277 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3278 (set-buffer gnus-summary-buffer) |
257 | 3279 ;; First of all, show hidden thread subtrees. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3280 (gnus-summary-show-thread) |
257 | 3281 (let* ((buffer-read-only nil) |
3282 (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
|
3283 (current (gnus-summary-article-number)) |
257 | 3284 (article (or article current))) |
3285 (gnus-mark-article-as-read article) | |
3286 (if (or (eq article current) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3287 (gnus-summary-goto-subject article)) |
257 | 3288 (progn |
3289 (beginning-of-line) | |
3290 (delete-char 1) | |
3291 (insert mark))) | |
3292 ))) | |
3293 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3294 (defun gnus-summary-clear-mark-forward (count) |
257 | 3295 "Remove current article's mark, and go forward. |
3296 Argument COUNT specifies number of articles unmarked" | |
3297 (interactive "p") | |
3298 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3299 (gnus-summary-mark-as-unread nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3300 (gnus-summary-next-subject 1 nil) |
257 | 3301 (setq count (1- count)))) |
3302 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3303 (defun gnus-summary-clear-mark-backward (count) |
257 | 3304 "Remove current article's mark, and go backward. |
3305 Argument COUNT specifies number of articles unmarked" | |
3306 (interactive "p") | |
3307 (while (> count 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3308 (gnus-summary-mark-as-unread nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3309 (gnus-summary-prev-subject 1 nil) |
257 | 3310 (setq count (1- count)))) |
3311 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3312 (defun gnus-summary-delete-marked-as-read () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3313 "Delete lines which is marked as read." |
257 | 3314 (interactive) |
3315 (if gnus-newsgroup-unreads | |
3316 (let ((buffer-read-only nil)) | |
3317 (save-excursion | |
3318 (goto-char (point-min)) | |
3319 (delete-non-matching-lines "^[ ---]")) | |
3320 ;; Adjust point. | |
3321 (if (eobp) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3322 (gnus-summary-prev-subject 1) |
257 | 3323 (beginning-of-line) |
3324 (search-forward ":" nil t))) | |
3325 ;; It is not so good idea to make the buffer empty. | |
3326 (message "All articles are marked as read") | |
3327 )) | |
3328 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3329 (defun gnus-summary-delete-marked-with (marks) |
257 | 3330 "Delete lines which are marked with MARKS (e.g. \"DK\")." |
3331 (interactive "sMarks: ") | |
3332 (let ((buffer-read-only nil)) | |
3333 (save-excursion | |
3334 (goto-char (point-min)) | |
3335 (delete-matching-lines (concat "^[" marks "]"))) | |
3336 ;; Adjust point. | |
3337 (or (zerop (buffer-size)) | |
3338 (if (eobp) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3339 (gnus-summary-prev-subject 1) |
257 | 3340 (beginning-of-line) |
3341 (search-forward ":" nil t))) | |
3342 )) | |
3343 | |
3344 ;; Thread-based commands. | |
3345 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3346 (defun gnus-summary-toggle-threads (arg) |
257 | 3347 "Toggle showing conversation threads. |
3348 With arg, turn showing conversation threads on iff arg is positive." | |
3349 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3350 (let ((current (gnus-summary-article-number))) |
257 | 3351 (setq gnus-show-threads |
3352 (if (null arg) (not gnus-show-threads) | |
3353 (> (prefix-numeric-value arg) 0))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3354 (gnus-summary-prepare) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3355 (gnus-summary-goto-subject current) |
257 | 3356 )) |
3357 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3358 (defun gnus-summary-show-all-threads () |
257 | 3359 "Show all thread subtrees." |
3360 (interactive) | |
3361 (if gnus-show-threads | |
3362 (save-excursion | |
3363 (let ((buffer-read-only nil)) | |
3364 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t) | |
3365 )))) | |
3366 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3367 (defun gnus-summary-show-thread () |
257 | 3368 "Show thread subtrees." |
3369 (interactive) | |
3370 (if gnus-show-threads | |
3371 (save-excursion | |
3372 (let ((buffer-read-only nil)) | |
3373 (subst-char-in-region (progn | |
3374 (beginning-of-line) (point)) | |
3375 (progn | |
3376 (end-of-line) (point)) | |
3377 ?\^M ?\n t) | |
3378 )))) | |
3379 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3380 (defun gnus-summary-hide-all-threads () |
257 | 3381 "Hide all thread subtrees." |
3382 (interactive) | |
3383 (if gnus-show-threads | |
3384 (save-excursion | |
3385 ;; Adjust cursor point. | |
3386 (goto-char (point-min)) | |
3387 (search-forward ":" nil t) | |
3388 (let ((level (current-column))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3389 (gnus-summary-hide-thread) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3390 (while (gnus-summary-search-forward) |
257 | 3391 (and (>= level (current-column)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3392 (gnus-summary-hide-thread))) |
257 | 3393 )))) |
3394 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3395 (defun gnus-summary-hide-thread () |
257 | 3396 "Hide thread subtrees." |
3397 (interactive) | |
3398 (if gnus-show-threads | |
3399 (save-excursion | |
3400 ;; Adjust cursor point. | |
3401 (beginning-of-line) | |
3402 (search-forward ":" nil t) | |
3403 (let ((buffer-read-only nil) | |
3404 (init (point)) | |
3405 (last (point)) | |
3406 (level (current-column))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3407 (while (and (gnus-summary-search-forward) |
257 | 3408 (< level (current-column))) |
3409 ;; Interested in lower levels. | |
3410 (if (< level (current-column)) | |
3411 (progn | |
3412 (setq last (point)) | |
3413 )) | |
3414 ) | |
3415 (subst-char-in-region init last ?\n ?\^M t) | |
3416 )))) | |
3417 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3418 (defun gnus-summary-next-thread (n) |
257 | 3419 "Go to the same level next thread. |
3420 Argument N specifies the number of threads." | |
3421 (interactive "p") | |
3422 ;; Adjust cursor point. | |
3423 (beginning-of-line) | |
3424 (search-forward ":" nil t) | |
3425 (let ((init (point)) | |
3426 (last (point)) | |
3427 (level (current-column))) | |
3428 (while (and (> n 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3429 (gnus-summary-search-forward) |
257 | 3430 (<= level (current-column))) |
3431 ;; We have to skip lower levels. | |
3432 (if (= level (current-column)) | |
3433 (progn | |
3434 (setq last (point)) | |
3435 (setq n (1- n)) | |
3436 )) | |
3437 ) | |
3438 ;; Return non-nil if successfully move to the next. | |
3439 (prog1 (not (= init last)) | |
3440 (goto-char last)) | |
3441 )) | |
3442 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3443 (defun gnus-summary-prev-thread (n) |
257 | 3444 "Go to the same level previous thread. |
3445 Argument N specifies the number of threads." | |
3446 (interactive "p") | |
3447 ;; Adjust cursor point. | |
3448 (beginning-of-line) | |
3449 (search-forward ":" nil t) | |
3450 (let ((init (point)) | |
3451 (last (point)) | |
3452 (level (current-column))) | |
3453 (while (and (> n 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3454 (gnus-summary-search-backward) |
257 | 3455 (<= level (current-column))) |
3456 ;; We have to skip lower levels. | |
3457 (if (= level (current-column)) | |
3458 (progn | |
3459 (setq last (point)) | |
3460 (setq n (1- n)) | |
3461 )) | |
3462 ) | |
3463 ;; Return non-nil if successfully move to the previous. | |
3464 (prog1 (not (= init last)) | |
3465 (goto-char last)) | |
3466 )) | |
3467 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3468 (defun gnus-summary-down-thread (d) |
257 | 3469 "Go downward current thread. |
3470 Argument D specifies the depth goes down." | |
3471 (interactive "p") | |
3472 ;; Adjust cursor point. | |
3473 (beginning-of-line) | |
3474 (search-forward ":" nil t) | |
3475 (let ((last (point)) | |
3476 (level (current-column))) | |
3477 (while (and (> d 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3478 (gnus-summary-search-forward) |
257 | 3479 (<= level (current-column))) ;<= can be <. Which do you like? |
3480 ;; We have to skip the same levels. | |
3481 (if (< level (current-column)) | |
3482 (progn | |
3483 (setq last (point)) | |
3484 (setq level (current-column)) | |
3485 (setq d (1- d)) | |
3486 )) | |
3487 ) | |
3488 (goto-char last) | |
3489 )) | |
3490 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3491 (defun gnus-summary-up-thread (d) |
257 | 3492 "Go upward current thread. |
3493 Argument D specifies the depth goes up." | |
3494 (interactive "p") | |
3495 ;; Adjust cursor point. | |
3496 (beginning-of-line) | |
3497 (search-forward ":" nil t) | |
3498 (let ((last (point)) | |
3499 (level (current-column))) | |
3500 (while (and (> d 0) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3501 (gnus-summary-search-backward)) |
257 | 3502 ;; We have to skip the same levels. |
3503 (if (> level (current-column)) | |
3504 (progn | |
3505 (setq last (point)) | |
3506 (setq level (current-column)) | |
3507 (setq d (1- d)) | |
3508 )) | |
3509 ) | |
3510 (goto-char last) | |
3511 )) | |
3512 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3513 (defun gnus-summary-kill-thread (unmark) |
257 | 3514 "Mark articles under current thread as read. |
3515 If argument UNMARK is positive, remove any kinds of marks. | |
3516 If argument UNMARK is negative, mark articles as unread instead." | |
3517 (interactive "P") | |
3518 (if unmark | |
3519 (setq unmark (prefix-numeric-value unmark))) | |
3520 ;; Adjust cursor point. | |
3521 (beginning-of-line) | |
3522 (search-forward ":" nil t) | |
3523 (save-excursion | |
3524 (let ((level (current-column))) | |
3525 ;; Mark current article. | |
3526 (cond ((null unmark) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3527 (gnus-summary-mark-as-read nil "K")) |
257 | 3528 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3529 (gnus-summary-mark-as-unread nil t)) |
257 | 3530 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3531 (gnus-summary-mark-as-unread)) |
257 | 3532 ) |
3533 ;; Mark following articles. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3534 (while (and (gnus-summary-search-forward) |
257 | 3535 (< level (current-column))) |
3536 (cond ((null unmark) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3537 (gnus-summary-mark-as-read nil "K")) |
257 | 3538 ((> unmark 0) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3539 (gnus-summary-mark-as-unread nil t)) |
257 | 3540 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3541 (gnus-summary-mark-as-unread)) |
257 | 3542 )) |
3543 )) | |
3544 ;; Hide killed subtrees. | |
3545 (and (null unmark) | |
3546 gnus-thread-hide-killed | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3547 (gnus-summary-hide-thread)) |
257 | 3548 ;; If marked as read, go to next unread subject. |
3549 (if (null unmark) | |
3550 ;; Go to next unread subject. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3551 (gnus-summary-next-subject 1 t)) |
257 | 3552 ) |
3553 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3554 (defun gnus-summary-toggle-truncation (arg) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3555 "Toggle truncation of summary lines. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3556 With arg, turn line truncation on iff arg is positive." |
257 | 3557 (interactive "P") |
3558 (setq truncate-lines | |
3559 (if (null arg) (not truncate-lines) | |
3560 (> (prefix-numeric-value arg) 0))) | |
3561 (redraw-display)) | |
3562 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3563 (defun gnus-summary-sort-by-number (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3564 "Sort Summary buffer by article number. |
257 | 3565 Argument REVERSE means reverse order." |
3566 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3567 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3568 (function <) |
257 | 3569 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3570 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3571 (nntp-header-number a))) |
257 | 3572 reverse |
3573 )) | |
3574 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3575 (defun gnus-summary-sort-by-author (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3576 "Sort Summary buffer by author name alphabetically. |
257 | 3577 If case-fold-search is non-nil, case of letters is ignored. |
3578 Argument REVERSE means reverse order." | |
3579 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3580 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3581 (function string-lessp) |
257 | 3582 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3583 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3584 (if case-fold-search |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3585 (downcase (nntp-header-from a)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3586 (nntp-header-from a)))) |
257 | 3587 reverse |
3588 )) | |
3589 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3590 (defun gnus-summary-sort-by-subject (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3591 "Sort Summary buffer by subject alphabetically. `Re:'s are ignored. |
257 | 3592 If case-fold-search is non-nil, case of letters is ignored. |
3593 Argument REVERSE means reverse order." | |
3594 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3595 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3596 (function string-lessp) |
257 | 3597 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3598 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3599 (if case-fold-search |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3600 (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
|
3601 (gnus-simplify-subject (nntp-header-subject a) 're-only)))) |
257 | 3602 reverse |
3603 )) | |
3604 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3605 (defun gnus-summary-sort-by-date (reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3606 "Sort Summary buffer by date. |
257 | 3607 Argument REVERSE means reverse order." |
3608 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3609 (gnus-summary-keysort-summary |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3610 (function string-lessp) |
257 | 3611 (function |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3612 (lambda (a) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3613 (gnus-sortable-date (nntp-header-date a)))) |
257 | 3614 reverse |
3615 )) | |
3616 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3617 (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
|
3618 "Sort Summary buffer by PREDICATE using a value passed by KEY. |
257 | 3619 Optional argument REVERSE means reverse order." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3620 (let ((current (gnus-summary-article-number))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3621 (gnus-keysort-headers predicate key reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3622 (gnus-summary-prepare) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3623 (gnus-summary-goto-subject current) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3624 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3625 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3626 (defun gnus-summary-sort-summary (predicate &optional reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3627 "Sort Summary buffer by PREDICATE. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3628 Optional argument REVERSE means reverse order." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3629 (let ((current (gnus-summary-article-number))) |
257 | 3630 (gnus-sort-headers predicate reverse) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3631 (gnus-summary-prepare) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3632 (gnus-summary-goto-subject current) |
257 | 3633 )) |
3634 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3635 (defun gnus-summary-reselect-current-group (show-all) |
257 | 3636 "Once exit and then reselect the current newsgroup. |
3637 Prefix argument SHOW-ALL means to select all articles." | |
3638 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3639 (let ((current-subject (gnus-summary-article-number))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3640 (gnus-summary-exit t) |
257 | 3641 ;; We have to adjust the point of Group mode buffer because the |
3642 ;; current point was moved to the next unread newsgroup by | |
3643 ;; exiting. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3644 (gnus-summary-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3645 (gnus-group-read-group show-all t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3646 (gnus-summary-goto-subject current-subject) |
257 | 3647 )) |
3648 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3649 (defun gnus-summary-caesar-message (rotnum) |
257 | 3650 "Caesar rotates all letters of current message by 13/47 places. |
3651 With prefix arg, specifies the number of places to rotate each letter forward. | |
3652 Caesar rotates Japanese letters by 47 places in any case." | |
3653 (interactive "P") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3654 (gnus-summary-select-article) |
257 | 3655 (gnus-overload-functions) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3656 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3657 (save-restriction |
3658 (widen) | |
3659 ;; We don't want to jump to the beginning of the message. | |
3660 ;; `save-excursion' does not do its job. | |
3661 (move-to-window-line 0) | |
3662 (let ((last (point))) | |
3663 (news-caesar-buffer-body rotnum) | |
3664 (goto-char last) | |
3665 (recenter 0) | |
3666 )) | |
3667 )) | |
3668 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3669 (defun gnus-summary-rmail-digest () |
257 | 3670 "Run RMAIL on current digest article. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3671 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
|
3672 value is non-nil. It is possible to modify the article so that Rmail |
257 | 3673 can work with it. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3674 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
|
3675 is non-nil. The hook is intended to customize Rmail mode." |
257 | 3676 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3677 (gnus-summary-select-article) |
257 | 3678 (require 'rmail) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3679 (let ((artbuf gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3680 (digbuf (get-buffer-create gnus-digest-buffer)) |
257 | 3681 (mail-header-separator "")) |
3682 (set-buffer digbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3683 (buffer-flush-undo (current-buffer)) |
257 | 3684 (setq buffer-read-only nil) |
3685 (erase-buffer) | |
3686 (insert-buffer-substring artbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3687 (run-hooks 'gnus-select-digest-hook) |
257 | 3688 (gnus-convert-article-to-rmail) |
3689 (goto-char (point-min)) | |
3690 ;; Rmail initializations. | |
3691 (rmail-insert-rmail-file-header) | |
3692 (rmail-mode) | |
3693 (rmail-set-message-counters) | |
3694 (rmail-show-message) | |
3695 (condition-case () | |
3696 (progn | |
3697 (undigestify-rmail-message) | |
3698 (rmail-expunge) ;Delete original message. | |
3699 ;; File name is meaningless but `save-buffer' requires it. | |
3700 (setq buffer-file-name "GNUS Digest") | |
3701 (setq mode-line-buffer-identification | |
3702 (concat "Digest: " | |
3703 (nntp-header-subject gnus-current-headers))) | |
3704 ;; There is no need to write this buffer to a file. | |
3705 (make-local-variable 'write-file-hooks) | |
3706 (setq write-file-hooks | |
3707 (list (function | |
3708 (lambda () | |
3709 (set-buffer-modified-p nil) | |
3710 (message "(No changes need to be saved)") | |
3711 'no-need-to-write-this-buffer)))) | |
3712 ;; Default file name saving digest messages. | |
3713 (setq rmail-last-rmail-file | |
3714 (funcall gnus-rmail-save-name | |
3715 gnus-newsgroup-name | |
3716 gnus-current-headers | |
3717 gnus-newsgroup-last-rmail | |
3718 )) | |
3719 (setq rmail-last-file | |
3720 (funcall gnus-mail-save-name | |
3721 gnus-newsgroup-name | |
3722 gnus-current-headers | |
3723 gnus-newsgroup-last-mail | |
3724 )) | |
3725 ;; Prevent generating new buffer named ***<N> each time. | |
3726 (setq rmail-summary-buffer | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3727 (get-buffer-create gnus-digest-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3728 (run-hooks 'gnus-rmail-digest-hook) |
257 | 3729 ;; Take all windows safely. |
3730 (gnus-configure-windows '(1 0 0)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3731 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3732 ;; Use Summary Article windows for Digest summary and |
257 | 3733 ;; Digest buffers. |
3734 (if gnus-digest-show-summary | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3735 (let ((gnus-summary-buffer gnus-digest-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3736 (gnus-article-buffer gnus-digest-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3737 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3738 (pop-to-buffer gnus-digest-buffer) |
257 | 3739 (rmail-summary) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3740 (pop-to-buffer gnus-digest-summary-buffer) |
257 | 3741 (message (substitute-command-keys |
3742 "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
|
3743 (let ((gnus-summary-buffer gnus-digest-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3744 (gnus-configure-windows 'summary) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3745 (pop-to-buffer gnus-digest-buffer) |
257 | 3746 (message (substitute-command-keys |
3747 "Type \\[rmail-quit] to return to GNUS"))) | |
3748 ) | |
3749 ;; 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
|
3750 (bury-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3751 (bury-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3752 (bury-buffer gnus-digest-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3753 (bury-buffer gnus-digest-buffer)) |
257 | 3754 (error (set-buffer-modified-p nil) |
3755 (kill-buffer digbuf) | |
3756 ;; This command should not signal an error because the | |
3757 ;; command is called from hooks. | |
3758 (ding) (message "Article is not a digest"))) | |
3759 )) | |
3760 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3761 (defun gnus-summary-save-article () |
257 | 3762 "Save this article using default saver function. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3763 The variable `gnus-default-article-saver' specifies the saver function." |
257 | 3764 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3765 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers) |
257 | 3766 (if gnus-default-article-saver |
3767 (call-interactively gnus-default-article-saver) | |
3768 (error "No default saver is defined."))) | |
3769 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3770 (defun gnus-summary-save-in-rmail (&optional filename) |
257 | 3771 "Append this article to Rmail file. |
3772 Optional argument FILENAME specifies file name. | |
3773 Directory to save to is default to `gnus-article-save-directory' which | |
3774 is initialized from the SAVEDIR environment variable." | |
3775 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3776 (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
|
3777 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3778 (save-excursion |
3779 (save-restriction | |
3780 (widen) | |
3781 (let ((default-name | |
3782 (funcall gnus-rmail-save-name | |
3783 gnus-newsgroup-name | |
3784 gnus-current-headers | |
3785 gnus-newsgroup-last-rmail | |
3786 ))) | |
3787 (or filename | |
3788 (setq filename | |
3789 (read-file-name | |
3790 (concat "Save article in Rmail file: (default " | |
3791 (file-name-nondirectory default-name) | |
3792 ") ") | |
3793 (file-name-directory default-name) | |
3794 default-name))) | |
3795 (gnus-make-directory (file-name-directory filename)) | |
3796 (gnus-output-to-rmail filename) | |
3797 ;; Remember the directory name to save articles. | |
3798 (setq gnus-newsgroup-last-rmail filename) | |
3799 ))) | |
3800 )) | |
3801 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3802 (defun gnus-summary-save-in-mail (&optional filename) |
257 | 3803 "Append this article to Unix mail file. |
3804 Optional argument FILENAME specifies file name. | |
3805 Directory to save to is default to `gnus-article-save-directory' which | |
3806 is initialized from the SAVEDIR environment variable." | |
3807 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3808 (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
|
3809 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3810 (save-excursion |
3811 (save-restriction | |
3812 (widen) | |
3813 (let ((default-name | |
3814 (funcall gnus-mail-save-name | |
3815 gnus-newsgroup-name | |
3816 gnus-current-headers | |
3817 gnus-newsgroup-last-mail | |
3818 ))) | |
3819 (or filename | |
3820 (setq filename | |
3821 (read-file-name | |
3822 (concat "Save article in Unix mail file: (default " | |
3823 (file-name-nondirectory default-name) | |
3824 ") ") | |
3825 (file-name-directory default-name) | |
3826 default-name))) | |
5052
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3827 (setq filename |
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3828 (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
|
3829 (and default-name |
b605cd28d596
(gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents:
5012
diff
changeset
|
3830 (file-name-directory default-name)))) |
257 | 3831 (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
|
3832 (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
|
3833 (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
|
3834 (rmail-output filename 1 t t)) |
257 | 3835 ;; Remember the directory name to save articles. |
3836 (setq gnus-newsgroup-last-mail filename) | |
3837 ))) | |
3838 )) | |
3839 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3840 (defun gnus-summary-save-in-file (&optional filename) |
257 | 3841 "Append this article to file. |
3842 Optional argument FILENAME specifies file name. | |
3843 Directory to save to is default to `gnus-article-save-directory' which | |
3844 is initialized from the SAVEDIR environment variable." | |
3845 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3846 (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
|
3847 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3848 (save-excursion |
3849 (save-restriction | |
3850 (widen) | |
3851 (let ((default-name | |
3852 (funcall gnus-file-save-name | |
3853 gnus-newsgroup-name | |
3854 gnus-current-headers | |
3855 gnus-newsgroup-last-file | |
3856 ))) | |
3857 (or filename | |
3858 (setq filename | |
3859 (read-file-name | |
3860 (concat "Save article in file: (default " | |
3861 (file-name-nondirectory default-name) | |
3862 ") ") | |
3863 (file-name-directory default-name) | |
3864 default-name))) | |
3865 (gnus-make-directory (file-name-directory filename)) | |
3866 (gnus-output-to-file filename) | |
3867 ;; Remember the directory name to save articles. | |
3868 (setq gnus-newsgroup-last-file filename) | |
3869 ))) | |
3870 )) | |
3871 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3872 (defun gnus-summary-save-in-folder (&optional folder) |
257 | 3873 "Save this article to MH folder (using `rcvstore' in MH library). |
3874 Optional argument FOLDER specifies folder name." | |
3875 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3876 (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
|
3877 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3878 (save-restriction |
3879 (widen) | |
3880 ;; Thanks to yuki@flab.Fujitsu.JUNET and ohm@kaba.junet. | |
3881 (mh-find-path) | |
3882 (let ((folder | |
3883 (or folder | |
3884 (mh-prompt-for-folder "Save article in" | |
3885 (funcall gnus-folder-save-name | |
3886 gnus-newsgroup-name | |
3887 gnus-current-headers | |
3888 gnus-newsgroup-last-folder | |
3889 ) | |
3890 t | |
3891 ))) | |
3892 (errbuf (get-buffer-create " *GNUS rcvstore*"))) | |
3893 (unwind-protect | |
3894 (call-process-region (point-min) (point-max) | |
3895 (expand-file-name "rcvstore" mh-lib) | |
3896 nil errbuf nil folder) | |
3897 (set-buffer errbuf) | |
3898 (if (zerop (buffer-size)) | |
3899 (message "Article saved in folder: %s" folder) | |
3900 (message "%s" (buffer-string))) | |
3901 (kill-buffer errbuf) | |
3902 (setq gnus-newsgroup-last-folder folder)) | |
3903 )) | |
3904 )) | |
3905 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3906 (defun gnus-summary-pipe-output () |
257 | 3907 "Pipe this article to subprocess." |
3908 (interactive) | |
3909 ;; 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
|
3910 ;;(gnus-summary-select-article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3911 ;; Huuum. Is this right? |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3912 (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
|
3913 (gnus-eval-in-buffer-window gnus-article-buffer |
257 | 3914 (save-restriction |
3915 (widen) | |
3916 (let ((command (read-string "Shell command on article: " | |
3917 gnus-last-shell-command))) | |
3918 (if (string-equal command "") | |
3919 (setq command gnus-last-shell-command)) | |
3920 (shell-command-on-region (point-min) (point-max) command nil) | |
3921 (setq gnus-last-shell-command command) | |
3922 )) | |
3923 )) | |
3924 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3925 (defun gnus-summary-catchup (all &optional quietly) |
257 | 3926 "Mark all articles not marked as unread in this newsgroup as read. |
3927 If prefix argument ALL is non-nil, all articles are marked as read." | |
3928 (interactive "P") | |
3929 (if (or quietly | |
3930 (y-or-n-p | |
3931 (if all | |
3932 "Do you really want to mark everything as read? " | |
3933 "Delete all articles not marked as unread? "))) | |
3934 (let ((unmarked | |
3935 (gnus-set-difference gnus-newsgroup-unreads | |
3936 (if (not all) gnus-newsgroup-marked)))) | |
3937 (message "") ;Erase "Yes or No" question. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3938 ;; Hidden thread subtrees must be searched for ,too. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3939 (gnus-summary-show-all-threads) |
257 | 3940 (while unmarked |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3941 (gnus-summary-mark-as-read (car unmarked) "C") |
257 | 3942 (setq unmarked (cdr unmarked)) |
3943 )) | |
3944 )) | |
3945 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3946 (defun gnus-summary-catchup-all (&optional quietly) |
257 | 3947 "Mark all articles in this newsgroup as read." |
3948 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3949 (gnus-summary-catchup t quietly)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3950 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3951 (defun gnus-summary-catchup-and-exit (all &optional quietly) |
257 | 3952 "Mark all articles not marked as unread in this newsgroup as read, then exit. |
3953 If prefix argument ALL is non-nil, all articles are marked as read." | |
3954 (interactive "P") | |
3955 (if (or quietly | |
3956 (y-or-n-p | |
3957 (if all | |
3958 "Do you really want to mark everything as read? " | |
3959 "Delete all articles not marked as unread? "))) | |
3960 (let ((unmarked | |
3961 (gnus-set-difference gnus-newsgroup-unreads | |
3962 (if (not all) gnus-newsgroup-marked)))) | |
3963 (message "") ;Erase "Yes or No" question. | |
3964 (while unmarked | |
3965 (gnus-mark-article-as-read (car unmarked)) | |
3966 (setq unmarked (cdr unmarked))) | |
3967 ;; Select next newsgroup or exit. | |
3968 (cond ((eq gnus-auto-select-next 'quietly) | |
3969 ;; Select next newsgroup quietly. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3970 (gnus-summary-next-group nil)) |
257 | 3971 (t |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3972 (gnus-summary-exit))) |
257 | 3973 ))) |
3974 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3975 (defun gnus-summary-catchup-all-and-exit (&optional quietly) |
257 | 3976 "Mark all articles in this newsgroup as read, and then exit." |
3977 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3978 (gnus-summary-catchup-and-exit t quietly)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3979 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3980 (defun gnus-summary-edit-global-kill () |
257 | 3981 "Edit a global KILL file." |
3982 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3983 (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
|
3984 (gnus-kill-file-edit-file nil) ;Nil stands for global KILL file. |
257 | 3985 (message |
3986 (substitute-command-keys | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3987 "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
|
3988 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3989 (defun gnus-summary-edit-local-kill () |
257 | 3990 "Edit a local KILL file applied to the current newsgroup." |
3991 (interactive) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3992 (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
|
3993 (gnus-kill-file-edit-file gnus-newsgroup-name) |
257 | 3994 (message |
3995 (substitute-command-keys | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3996 "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
|
3997 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
3998 (defun gnus-summary-exit (&optional temporary) |
257 | 3999 "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
|
4000 gnus-exit-group-hook is called with no arguments if that value is non-nil." |
257 | 4001 (interactive) |
4002 (let ((updated nil) | |
4003 (gnus-newsgroup-headers gnus-newsgroup-headers) | |
4004 (gnus-newsgroup-unreads gnus-newsgroup-unreads) | |
4005 (gnus-newsgroup-unselected gnus-newsgroup-unselected) | |
4006 (gnus-newsgroup-marked gnus-newsgroup-marked)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4007 ;; 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
|
4008 ;; Summary buffer even if hook changes them. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4009 (run-hooks 'gnus-exit-group-hook) |
257 | 4010 (gnus-update-unread-articles gnus-newsgroup-name |
4011 (append gnus-newsgroup-unselected | |
4012 gnus-newsgroup-unreads) | |
4013 gnus-newsgroup-marked) | |
4014 ;; T means ignore unsubscribed newsgroups. | |
4015 (if gnus-use-cross-reference | |
4016 (setq updated | |
4017 (gnus-mark-as-read-by-xref gnus-newsgroup-name | |
4018 gnus-newsgroup-headers | |
4019 gnus-newsgroup-unreads | |
4020 (eq gnus-use-cross-reference t) | |
4021 ))) | |
4022 ;; 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
|
4023 (set-buffer gnus-group-buffer) |
257 | 4024 ;; Update cross referenced group info. |
4025 (while updated | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4026 (gnus-group-update-group (car updated) t) ;Ignore invisible group. |
257 | 4027 (setq updated (cdr updated))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4028 (gnus-group-update-group gnus-newsgroup-name)) |
257 | 4029 ;; 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
|
4030 (gnus-group-jump-to-group gnus-newsgroup-name) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4031 (gnus-group-next-unread-group 1) |
257 | 4032 (if temporary |
4033 ;; If exiting temporary, caller should adjust Group mode | |
4034 ;; buffer point by itself. | |
4035 nil ;Nothing to do. | |
4036 ;; Return to Group mode buffer. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4037 (if (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4038 (bury-buffer gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4039 (if (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4040 (bury-buffer gnus-article-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4041 (gnus-configure-windows 'newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4042 (pop-to-buffer gnus-group-buffer))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4043 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4044 (defun gnus-summary-quit () |
257 | 4045 "Quit reading current newsgroup without updating read article info." |
4046 (interactive) | |
4047 (if (y-or-n-p "Do you really wanna quit reading this group? ") | |
4048 (progn | |
4049 (message "") ;Erase "Yes or No" question. | |
4050 ;; Return to Group selection mode. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4051 (if (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4052 (bury-buffer gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4053 (if (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4054 (bury-buffer gnus-article-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4055 (gnus-configure-windows 'newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4056 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4057 (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
|
4058 (gnus-group-next-group 1) ;(gnus-group-next-unread-group 1) |
257 | 4059 ))) |
4060 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4061 (defun gnus-summary-describe-briefly () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4062 "Describe Summary mode commands briefly." |
257 | 4063 (interactive) |
4064 (message | |
4065 (concat | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4066 (substitute-command-keys "\\[gnus-summary-next-page]:Select ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4067 (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
|
4068 (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
|
4069 (substitute-command-keys "\\[gnus-summary-exit]:Exit ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4070 (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
|
4071 (substitute-command-keys "\\[gnus-summary-describe-briefly]:This help") |
257 | 4072 ))) |
4073 | |
4074 | |
4075 ;;; | |
4076 ;;; GNUS Article Mode | |
4077 ;;; | |
4078 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4079 (if gnus-article-mode-map |
257 | 4080 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4081 (setq gnus-article-mode-map (make-keymap)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4082 (suppress-keymap gnus-article-mode-map) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4083 (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
|
4084 (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
|
4085 (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
|
4086 (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
|
4087 (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
|
4088 (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
|
4089 (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
|
4090 (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
|
4091 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4092 (defun gnus-article-mode () |
257 | 4093 "Major mode for browsing through an article. |
4094 All normal editing commands are turned off. | |
4095 Instead, these commands are available: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4096 \\{gnus-article-mode-map} |
257 | 4097 |
4098 Various hooks for customization: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4099 gnus-article-mode-hook |
257 | 4100 Entry to this mode calls the value with no arguments, if that |
4101 value is non-nil. | |
4102 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4103 gnus-article-prepare-hook |
257 | 4104 Called with no arguments after an article is prepared for reading, |
4105 if that value is non-nil." | |
4106 (interactive) | |
4107 (kill-all-local-variables) | |
4108 ;; Gee. Why don't you upgrade? | |
4109 (cond ((boundp 'mode-line-modified) | |
4110 (setq mode-line-modified "--- ")) | |
4111 ((listp (default-value 'mode-line-format)) | |
4112 (setq mode-line-format | |
4113 (cons "--- " (cdr (default-value 'mode-line-format)))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4114 ;; To disable display-time facility. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4115 ;;(make-local-variable 'global-mode-string) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4116 ;;(setq global-mode-string nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4117 (setq major-mode 'gnus-article-mode) |
257 | 4118 (setq mode-name "Article") |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4119 (make-local-variable 'minor-mode-alist) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4120 (or (assq 'gnus-show-mime minor-mode-alist) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4121 (setq minor-mode-alist |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4122 (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
|
4123 (gnus-article-set-mode-line) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4124 (use-local-map gnus-article-mode-map) |
257 | 4125 (make-local-variable 'page-delimiter) |
4126 (setq page-delimiter gnus-page-delimiter) | |
4127 (make-local-variable 'mail-header-separator) | |
4128 (setq mail-header-separator "") ;For caesar function. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4129 (buffer-flush-undo (current-buffer)) |
257 | 4130 (setq buffer-read-only t) ;Disable modification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4131 (run-hooks 'gnus-article-mode-hook)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4132 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4133 (defun gnus-article-setup-buffer () |
257 | 4134 "Initialize Article mode buffer." |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4135 (or (get-buffer gnus-article-buffer) |
257 | 4136 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4137 (set-buffer (get-buffer-create gnus-article-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4138 (gnus-article-mode)) |
257 | 4139 )) |
4140 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4141 (defun gnus-article-prepare (article &optional all-headers) |
257 | 4142 "Prepare ARTICLE in Article mode buffer. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4143 ARTICLE can be either a article number or Message-ID. |
257 | 4144 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
|
4145 ;; 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
|
4146 (if (not (gnus-server-opened)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4147 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4148 (gnus-start-news-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4149 (gnus-request-group gnus-newsgroup-name))) |
257 | 4150 (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4151 (set-buffer gnus-article-buffer) |
257 | 4152 (let ((buffer-read-only nil)) |
4153 (erase-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4154 ;; 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
|
4155 ;; 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
|
4156 ;; nnspool too. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4157 ;; 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
|
4158 ;; 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
|
4159 ;; in the following. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4160 (if (let* ((header |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4161 (and (stringp article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4162 (gnus-get-header-by-id article))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4163 (article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4164 (if header |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4165 (nntp-header-number header) article))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4166 (gnus-request-article article)) |
257 | 4167 (progn |
4168 ;; Prepare article buffer | |
4169 (insert-buffer-substring nntp-server-buffer) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4170 ;; 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
|
4171 (setq gnus-have-all-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4172 (not (not (or all-headers gnus-show-all-headers)))) |
257 | 4173 (if (and (numberp article) |
4174 (not (eq article gnus-current-article))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4175 ;; Seems me that a new article has been selected. |
257 | 4176 (progn |
4177 ;; gnus-current-article must be an article number. | |
4178 (setq gnus-last-article gnus-current-article) | |
4179 (setq gnus-current-article article) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4180 ;; (setq gnus-current-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4181 ;; (gnus-find-header-by-number gnus-newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4182 ;; gnus-current-article)) |
257 | 4183 (setq gnus-current-headers |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4184 (gnus-get-header-by-number gnus-current-article)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4185 (run-hooks 'gnus-mark-article-hook) |
257 | 4186 )) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4187 ;; Clear article history only when the article is |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4188 ;; retrieved by the article number. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4189 (if (numberp article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4190 (setq gnus-current-history nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4191 ;; Hooks for modifying contents of the article. This hook |
257 | 4192 ;; must be called before being narrowed. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4193 (run-hooks 'gnus-article-prepare-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4194 ;; Decode MIME message. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4195 (if (and gnus-show-mime |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4196 (gnus-fetch-field "Mime-Version")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4197 (funcall gnus-show-mime-method)) |
257 | 4198 ;; Delete unnecessary headers. |
4199 (or gnus-have-all-headers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4200 (gnus-article-delete-headers)) |
257 | 4201 ;; Do page break. |
4202 (goto-char (point-min)) | |
4203 (if gnus-break-pages | |
4204 (gnus-narrow-to-page)) | |
4205 ;; Next function must be called after setting | |
4206 ;; `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
|
4207 (gnus-article-set-mode-line) |
257 | 4208 ) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4209 ;; There is no such article. |
257 | 4210 (if (numberp article) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4211 (gnus-summary-mark-as-read article)) |
257 | 4212 (ding) (message "No such article (may be canceled)")) |
4213 ))) | |
4214 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4215 (defun gnus-article-show-all-headers () |
257 | 4216 "Show all article headers in Article mode buffer." |
4217 (or gnus-have-all-headers | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4218 (gnus-article-prepare gnus-current-article t))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4219 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4220 ;;(defun gnus-article-set-mode-line () |
257 | 4221 ;; "Set Article mode line string." |
4222 ;; (setq mode-line-buffer-identification | |
4223 ;; (list 17 | |
4224 ;; (format "GNUS: %s {%d-%d} %d" | |
4225 ;; gnus-newsgroup-name | |
4226 ;; gnus-newsgroup-begin | |
4227 ;; gnus-newsgroup-end | |
4228 ;; gnus-current-article | |
4229 ;; ))) | |
4230 ;; (set-buffer-modified-p t)) | |
4231 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4232 ;;(defun gnus-article-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4233 ;; "Set Article mode line string." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4234 ;; (let ((unmarked |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4235 ;; (- (length gnus-newsgroup-unreads) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4236 ;; (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4237 ;; gnus-newsgroup-unreads gnus-newsgroup-marked)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4238 ;; (unselected |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4239 ;; (- (length gnus-newsgroup-unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4240 ;; (length (gnus-intersection |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4241 ;; gnus-newsgroup-unselected gnus-newsgroup-marked))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4242 ;; (setq mode-line-buffer-identification |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4243 ;; (list 17 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4244 ;; (format "GNUS: %s{%d} %s" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4245 ;; gnus-newsgroup-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4246 ;; gnus-current-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4247 ;; ;; This is proposed by tale@pawl.rpi.edu. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4248 ;; (cond ((and (zerop unmarked) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4249 ;; (zerop unselected)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4250 ;; " ") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4251 ;; ((zerop unselected) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4252 ;; (format "%d more" unmarked)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4253 ;; (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4254 ;; (format "%d(+%d) more" unmarked unselected))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4255 ;; )))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4256 ;; (set-buffer-modified-p t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4257 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4258 ;; New implementation in gnus 3.14.3 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4259 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4260 (defun gnus-article-set-mode-line () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4261 "Set Article mode line string. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4262 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
|
4263 (let ((maxlen 15) ;Maximum subject length |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4264 (subject |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4265 (if gnus-current-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4266 (nntp-header-subject gnus-current-headers) ""))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4267 ;; The value must be a string to escape %-constructs because of subject. |
257 | 4268 (setq mode-line-buffer-identification |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4269 (format "GNUS: %s%s %s%s%s" |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4270 gnus-newsgroup-name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4271 (if gnus-current-article |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4272 (format "/%d" gnus-current-article) "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4273 (substring subject 0 (min (length subject) maxlen)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4274 (if (> (length subject) maxlen) "..." "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4275 (make-string (max 0 (- 17 (length subject))) ? ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4276 ))) |
257 | 4277 (set-buffer-modified-p t)) |
4278 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4279 (defun gnus-article-delete-headers () |
257 | 4280 "Delete unnecessary headers." |
4281 (save-excursion | |
4282 (save-restriction | |
4283 (goto-char (point-min)) | |
4284 (narrow-to-region (point-min) | |
4285 (progn (search-forward "\n\n" nil 'move) (point))) | |
4286 (goto-char (point-min)) | |
4287 (and (stringp gnus-ignored-headers) | |
4288 (while (re-search-forward gnus-ignored-headers nil t) | |
4289 (beginning-of-line) | |
4290 (delete-region (point) | |
4291 (progn (re-search-forward "\n[^ \t]") | |
4292 (forward-char -1) | |
4293 (point))))) | |
4294 ))) | |
4295 | |
4296 ;; Working on article's buffer | |
4297 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4298 (defun gnus-article-next-page (lines) |
257 | 4299 "Show next page of current article. |
4300 If end of article, return non-nil. Otherwise return nil. | |
4301 Argument LINES specifies lines to be scrolled up." | |
4302 (interactive "P") | |
4303 (move-to-window-line -1) | |
4304 ;; Fixed by enami@ptgd.sony.co.jp (enami tsugutomo) | |
4305 (if (save-excursion | |
4306 (end-of-line) | |
4307 (and (pos-visible-in-window-p) ;Not continuation line. | |
4308 (eobp))) | |
4309 ;; Nothing in this page. | |
4310 (if (or (not gnus-break-pages) | |
4311 (save-excursion | |
4312 (save-restriction | |
4313 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer? | |
4314 t ;Nothing more. | |
4315 (gnus-narrow-to-page 1) ;Go to next page. | |
4316 nil | |
4317 ) | |
4318 ;; More in this page. | |
4319 (condition-case () | |
4320 (scroll-up lines) | |
4321 (end-of-buffer | |
4322 ;; Long lines may cause an end-of-buffer error. | |
4323 (goto-char (point-max)))) | |
4324 nil | |
4325 )) | |
4326 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4327 (defun gnus-article-prev-page (lines) |
257 | 4328 "Show previous page of current article. |
4329 Argument LINES specifies lines to be scrolled down." | |
4330 (interactive "P") | |
4331 (move-to-window-line 0) | |
4332 (if (and gnus-break-pages | |
4333 (bobp) | |
4334 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer? | |
4335 (progn | |
4336 (gnus-narrow-to-page -1) ;Go to previous page. | |
4337 (goto-char (point-max)) | |
4338 (recenter -1)) | |
4339 (scroll-down lines))) | |
4340 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4341 (defun gnus-article-next-digest (nth) |
257 | 4342 "Move to head of NTH next digested message. |
4343 Set mark at end of digested message." | |
4344 ;; Stop page breaking in digest mode. | |
4345 (widen) | |
4346 (end-of-line) | |
4347 ;; Skip NTH - 1 digest. | |
4348 ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>. | |
4349 ;; Digest separator is customizable. | |
4350 ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>. | |
4351 (while (and (> nth 1) | |
4352 (re-search-forward gnus-digest-separator nil 'move)) | |
4353 (setq nth (1- nth))) | |
4354 (if (re-search-forward gnus-digest-separator nil t) | |
4355 (let ((begin (point))) | |
4356 ;; Search for end of this message. | |
4357 (end-of-line) | |
4358 (if (re-search-forward gnus-digest-separator nil t) | |
4359 (progn | |
4360 (search-backward "\n\n") ;This may be incorrect. | |
4361 (forward-line 1)) | |
4362 (goto-char (point-max))) | |
4363 (push-mark) ;Set mark at end of digested message. | |
4364 (goto-char begin) | |
4365 (beginning-of-line) | |
4366 ;; Show From: and Subject: fields. | |
4367 (recenter 1)) | |
4368 (message "End of message") | |
4369 )) | |
4370 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4371 (defun gnus-article-prev-digest (nth) |
257 | 4372 "Move to head of NTH previous digested message." |
4373 ;; Stop page breaking in digest mode. | |
4374 (widen) | |
4375 (beginning-of-line) | |
4376 ;; Skip NTH - 1 digest. | |
4377 ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>. | |
4378 ;; Digest separator is customizable. | |
4379 ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>. | |
4380 (while (and (> nth 1) | |
4381 (re-search-backward gnus-digest-separator nil 'move)) | |
4382 (setq nth (1- nth))) | |
4383 (if (re-search-backward gnus-digest-separator nil t) | |
4384 (let ((begin (point))) | |
4385 ;; Search for end of this message. | |
4386 (end-of-line) | |
4387 (if (re-search-forward gnus-digest-separator nil t) | |
4388 (progn | |
4389 (search-backward "\n\n") ;This may be incorrect. | |
4390 (forward-line 1)) | |
4391 (goto-char (point-max))) | |
4392 (push-mark) ;Set mark at end of digested message. | |
4393 (goto-char begin) | |
4394 ;; Show From: and Subject: fields. | |
4395 (recenter 1)) | |
4396 (goto-char (point-min)) | |
4397 (message "Top of message") | |
4398 )) | |
4399 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4400 (defun gnus-article-refer-article () |
257 | 4401 "Read article specified by message-id around point." |
4402 (interactive) | |
4403 (save-window-excursion | |
4404 (save-excursion | |
4405 (re-search-forward ">" nil t) ;Move point to end of "<....>". | |
4406 (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t) | |
4407 (let ((message-id | |
4408 (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
|
4409 (set-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4410 (gnus-summary-refer-article message-id)) |
257 | 4411 (error "No references around point")) |
4412 ))) | |
4413 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4414 (defun gnus-article-pop-article () |
257 | 4415 "Pop up article history." |
4416 (interactive) | |
4417 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4418 (set-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4419 (gnus-summary-refer-article nil))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4420 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4421 (defun gnus-article-show-summary () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4422 "Reconfigure windows to show Summary buffer." |
257 | 4423 (interactive) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4424 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4425 (pop-to-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4426 (gnus-summary-goto-subject gnus-current-article)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4427 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4428 (defun gnus-article-describe-briefly () |
257 | 4429 "Describe Article mode commands briefly." |
4430 (interactive) | |
4431 (message | |
4432 (concat | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4433 (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
|
4434 (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
|
4435 (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
|
4436 (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
|
4437 (substitute-command-keys "\\[gnus-article-describe-briefly]:This help") |
257 | 4438 ))) |
4439 | |
4440 | |
4441 ;;; | |
4442 ;;; GNUS KILL-File Mode | |
4443 ;;; | |
4444 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4445 (if gnus-kill-file-mode-map |
257 | 4446 nil |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4447 (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
|
4448 (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
|
4449 (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
|
4450 (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
|
4451 (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
|
4452 (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
|
4453 (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
|
4454 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4455 (defun gnus-kill-file-mode () |
257 | 4456 "Major mode for editing KILL file. |
4457 | |
4458 In addition to Emacs-Lisp Mode, the following commands are available: | |
4459 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4460 \\[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
|
4461 \\[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
|
4462 \\[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
|
4463 \\[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
|
4464 \\[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
|
4465 \\[gnus-info-find-node] Read Info about KILL file. |
257 | 4466 |
4467 A KILL file contains lisp expressions to be applied to a selected | |
4468 newsgroup. The purpose is to mark articles as read on the basis of | |
4469 some set of regexps. A global KILL file is applied to every newsgroup, | |
4470 and a local KILL file is applied to a specified newsgroup. Since a | |
4471 global KILL file is applied to every newsgroup, for better performance | |
4472 use a local one. | |
4473 | |
4474 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
|
4475 to be evaluated in the Summary buffer. Writing lisp programs for this |
257 | 4476 purpose is not so easy because the internal working of GNUS must be |
4477 well-known. For this reason, GNUS provides a general function which | |
4478 does this easily for non-Lisp programmers. | |
4479 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4480 The `gnus-kill' function executes commands available in Summary Mode |
257 | 4481 by their key sequences. `gnus-kill' should be called with FIELD, |
4482 REGEXP and optional COMMAND and ALL. FIELD is a string representing | |
4483 the header field or an empty string. If FIELD is an empty string, the | |
4484 entire article body is searched for. REGEXP is a string which is | |
4485 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
|
4486 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
|
4487 '(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
|
4488 executed in the Summary buffer. If the second optional argument ALL |
257 | 4489 is non-nil, the COMMAND is applied to articles which are already |
4490 marked as read or unread. Articles which are marked are skipped over | |
4491 by default. | |
4492 | |
4493 For example, if you want to mark articles of which subjects contain | |
4494 the string `AI' as read, a possible KILL file may look like: | |
4495 | |
4496 (gnus-kill \"Subject\" \"AI\") | |
4497 | |
4498 If you want to mark articles with `D' instead of `X', you can use | |
4499 the following expression: | |
4500 | |
4501 (gnus-kill \"Subject\" \"AI\" \"d\") | |
4502 | |
4503 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
|
4504 `gnus-summary-mark-as-read-forward' is assigned to `d' in Summary Mode. |
257 | 4505 |
4506 It is possible to delete unnecessary headers which are marked with | |
4507 `X' in a KILL file as follows: | |
4508 | |
4509 (gnus-expunge \"X\") | |
4510 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4511 If the Summary buffer is empty after applying KILL files, GNUS will |
257 | 4512 exit the selected newsgroup normally. If headers which are marked |
4513 with `D' are deleted in a KILL file, it is impossible to read articles | |
4514 which are marked as read in the previous GNUS sessions. Marks other | |
4515 than `D' should be used for articles which should really be deleted. | |
4516 | |
4517 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
|
4518 gnus-kill-file-mode-hook with no arguments, if that value is non-nil." |
257 | 4519 (interactive) |
4520 (kill-all-local-variables) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4521 (use-local-map gnus-kill-file-mode-map) |
257 | 4522 (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
|
4523 (setq major-mode 'gnus-kill-file-mode) |
257 | 4524 (setq mode-name "KILL-File") |
4525 (lisp-mode-variables nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4526 (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
|
4527 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4528 (defun gnus-kill-file-edit-file (newsgroup) |
257 | 4529 "Begin editing a KILL file of NEWSGROUP. |
4530 If NEWSGROUP is nil, the global KILL file is selected." | |
4531 (interactive "sNewsgroup: ") | |
4532 (let ((file (gnus-newsgroup-kill-file newsgroup))) | |
4533 (gnus-make-directory (file-name-directory file)) | |
4534 ;; Save current window configuration if this is first invocation. | |
4535 (or (and (get-file-buffer file) | |
4536 (get-buffer-window (get-file-buffer file))) | |
4537 (setq gnus-winconf-kill-file (current-window-configuration))) | |
4538 ;; Hack windows. | |
4539 (let ((buffer (find-file-noselect file))) | |
4540 (cond ((get-buffer-window buffer) | |
4541 (pop-to-buffer buffer)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4542 ((eq major-mode 'gnus-group-mode) |
257 | 4543 (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
|
4544 (pop-to-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4545 (let ((gnus-summary-buffer buffer)) |
257 | 4546 (gnus-configure-windows '(1 1 0)) ;Split into two. |
4547 (pop-to-buffer buffer))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4548 ((eq major-mode 'gnus-summary-mode) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4549 (gnus-configure-windows 'article) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4550 (pop-to-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4551 (bury-buffer gnus-article-buffer) |
257 | 4552 (switch-to-buffer buffer)) |
4553 (t ;No good rules. | |
4554 (find-file-other-window file)) | |
4555 )) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4556 (gnus-kill-file-mode) |
257 | 4557 )) |
4558 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4559 (defun gnus-kill-file-kill-by-subject () |
257 | 4560 "Insert KILL command for current subject." |
4561 (interactive) | |
4562 (insert | |
4563 (format "(gnus-kill \"Subject\" %s)\n" | |
4564 (prin1-to-string | |
4565 (if gnus-current-kill-article | |
4566 (regexp-quote | |
4567 (nntp-header-subject | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4568 ;; No need to speed up this command. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4569 ;;(gnus-get-header-by-number gnus-current-kill-article) |
257 | 4570 (gnus-find-header-by-number gnus-newsgroup-headers |
4571 gnus-current-kill-article))) | |
4572 ""))))) | |
4573 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4574 (defun gnus-kill-file-kill-by-author () |
257 | 4575 "Insert KILL command for current author." |
4576 (interactive) | |
4577 (insert | |
4578 (format "(gnus-kill \"From\" %s)\n" | |
4579 (prin1-to-string | |
4580 (if gnus-current-kill-article | |
4581 (regexp-quote | |
4582 (nntp-header-from | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4583 ;; No need to speed up this command. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4584 ;;(gnus-get-header-by-number gnus-current-kill-article) |
257 | 4585 (gnus-find-header-by-number gnus-newsgroup-headers |
4586 gnus-current-kill-article))) | |
4587 ""))))) | |
4588 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4589 (defun gnus-kill-file-apply-buffer () |
257 | 4590 "Apply current buffer to current newsgroup." |
4591 (interactive) | |
4592 (if (and gnus-current-kill-article | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4593 (get-buffer gnus-summary-buffer)) |
257 | 4594 ;; Assume newsgroup is selected. |
4595 (let ((string (concat "(progn \n" (buffer-string) "\n)" ))) | |
4596 (save-excursion | |
4597 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4598 (pop-to-buffer gnus-summary-buffer) |
257 | 4599 (eval (car (read-from-string string)))))) |
4600 (ding) (message "No newsgroup is selected."))) | |
4601 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4602 (defun gnus-kill-file-apply-last-sexp () |
257 | 4603 "Apply sexp before point in current buffer to current newsgroup." |
4604 (interactive) | |
4605 (if (and gnus-current-kill-article | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4606 (get-buffer gnus-summary-buffer)) |
257 | 4607 ;; Assume newsgroup is selected. |
4608 (let ((string | |
4609 (buffer-substring | |
4610 (save-excursion (forward-sexp -1) (point)) (point)))) | |
4611 (save-excursion | |
4612 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4613 (pop-to-buffer gnus-summary-buffer) |
257 | 4614 (eval (car (read-from-string string)))))) |
4615 (ding) (message "No newsgroup is selected."))) | |
4616 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4617 (defun gnus-kill-file-exit () |
257 | 4618 "Save a KILL file, then return to the previous buffer." |
4619 (interactive) | |
4620 (save-buffer) | |
4621 (let ((killbuf (current-buffer))) | |
4622 ;; 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
|
4623 (and (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4624 (bury-buffer (get-buffer gnus-article-buffer))) |
257 | 4625 ;; Delete the KILL file windows. |
4626 (delete-windows-on killbuf) | |
4627 ;; Restore last window configuration if available. | |
4628 (and gnus-winconf-kill-file | |
4629 (set-window-configuration gnus-winconf-kill-file)) | |
4630 (setq gnus-winconf-kill-file nil) | |
4631 ;; Kill the KILL file buffer. Suggested by tale@pawl.rpi.edu. | |
4632 (kill-buffer killbuf))) | |
4633 | |
4634 | |
4635 ;;; | |
4636 ;;; Utility functions | |
4637 ;;; | |
4638 | |
4639 ;; Basic ideas by emv@math.lsa.umich.edu (Edward Vielmetti) | |
4640 | |
4641 (defun gnus-batch-kill () | |
4642 "Run batched KILL. | |
4643 Usage: emacs -batch -l gnus -f gnus-batch-kill NEWSGROUP ..." | |
4644 (if (not noninteractive) | |
4645 (error "gnus-batch-kill is to be used only with -batch")) | |
4646 (let* ((group nil) | |
4647 (subscribed nil) | |
4648 (newsrc nil) | |
4649 (yes-and-no | |
4650 (gnus-parse-n-options | |
4651 (apply (function concat) | |
4652 (mapcar (function (lambda (g) (concat g " "))) | |
4653 command-line-args-left)))) | |
4654 (yes (car yes-and-no)) | |
4655 (no (cdr yes-and-no)) | |
4656 ;; Disable verbose message. | |
4657 (gnus-novice-user nil) | |
4658 (gnus-large-newsgroup nil) | |
4659 (nntp-large-newsgroup nil)) | |
4660 ;; Eat all arguments. | |
4661 (setq command-line-args-left nil) | |
4662 ;; Startup GNUS. | |
4663 (gnus) | |
4664 ;; Apply kills to specified newsgroups in command line arguments. | |
4665 (setq newsrc (copy-sequence gnus-newsrc-assoc)) | |
4666 (while newsrc | |
4667 (setq group (car (car newsrc))) | |
4668 (setq subscribed (nth 1 (car newsrc))) | |
4669 (setq newsrc (cdr newsrc)) | |
4670 (if (and subscribed | |
4671 (not (zerop (nth 1 (gnus-gethash group gnus-unread-hashtb)))) | |
4672 (if yes | |
4673 (string-match yes group) t) | |
4674 (or (null no) | |
4675 (not (string-match no group)))) | |
4676 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4677 (gnus-summary-read-group group nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4678 (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
|
4679 (gnus-summary-exit t)) |
257 | 4680 )) |
4681 ) | |
4682 ;; Finally, exit Emacs. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4683 (set-buffer gnus-group-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4684 (gnus-group-exit) |
257 | 4685 )) |
4686 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4687 ;; For saving articles |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4688 |
257 | 4689 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file) |
4690 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4691 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group/num. | |
4692 Otherwise, it is like ~/News/news/group/num." | |
4693 (let ((default | |
4694 (expand-file-name | |
4695 (concat (if gnus-use-long-file-name | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4696 (gnus-capitalize-newsgroup newsgroup) |
257 | 4697 (gnus-newsgroup-directory-form newsgroup)) |
4698 "/" (int-to-string (nntp-header-number headers))) | |
4699 (or gnus-article-save-directory "~/News")))) | |
4700 (if (and last-file | |
4701 (string-equal (file-name-directory default) | |
4702 (file-name-directory last-file)) | |
4703 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
4704 default | |
4705 (or last-file default)))) | |
4706 | |
4707 (defun gnus-numeric-save-name (newsgroup headers &optional last-file) | |
4708 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4709 If variable `gnus-use-long-file-name' is nil, it is ~/News/news.group/num. | |
4710 Otherwise, it is like ~/News/news/group/num." | |
4711 (let ((default | |
4712 (expand-file-name | |
4713 (concat (if gnus-use-long-file-name | |
4714 newsgroup | |
4715 (gnus-newsgroup-directory-form newsgroup)) | |
4716 "/" (int-to-string (nntp-header-number headers))) | |
4717 (or gnus-article-save-directory "~/News")))) | |
4718 (if (and last-file | |
4719 (string-equal (file-name-directory default) | |
4720 (file-name-directory last-file)) | |
4721 (string-match "^[0-9]+$" (file-name-nondirectory last-file))) | |
4722 default | |
4723 (or last-file default)))) | |
4724 | |
4725 (defun gnus-Plain-save-name (newsgroup headers &optional last-file) | |
4726 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4727 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group. | |
4728 Otherwise, it is like ~/News/news/group/news." | |
4729 (or last-file | |
4730 (expand-file-name | |
4731 (if gnus-use-long-file-name | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4732 (gnus-capitalize-newsgroup newsgroup) |
257 | 4733 (concat (gnus-newsgroup-directory-form newsgroup) "/news")) |
4734 (or gnus-article-save-directory "~/News")))) | |
4735 | |
4736 (defun gnus-plain-save-name (newsgroup headers &optional last-file) | |
4737 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE. | |
4738 If variable `gnus-use-long-file-name' is nil, it is ~/News/news.group. | |
4739 Otherwise, it is like ~/News/news/group/news." | |
4740 (or last-file | |
4741 (expand-file-name | |
4742 (if gnus-use-long-file-name | |
4743 newsgroup | |
4744 (concat (gnus-newsgroup-directory-form newsgroup) "/news")) | |
4745 (or gnus-article-save-directory "~/News")))) | |
4746 | |
4747 (defun gnus-Folder-save-name (newsgroup headers &optional last-folder) | |
4748 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER. | |
4749 If variable `gnus-use-long-file-name' is nil, it is +News.group. | |
4750 Otherwise, it is like +news/group." | |
4751 (or last-folder | |
4752 (concat "+" | |
4753 (if gnus-use-long-file-name | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4754 (gnus-capitalize-newsgroup newsgroup) |
257 | 4755 (gnus-newsgroup-directory-form newsgroup))))) |
4756 | |
4757 (defun gnus-folder-save-name (newsgroup headers &optional last-folder) | |
4758 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER. | |
4759 If variable `gnus-use-long-file-name' is nil, it is +news.group. | |
4760 Otherwise, it is like +news/group." | |
4761 (or last-folder | |
4762 (concat "+" | |
4763 (if gnus-use-long-file-name | |
4764 newsgroup | |
4765 (gnus-newsgroup-directory-form newsgroup))))) | |
4766 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4767 ;; For KILL files |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4768 |
257 | 4769 (defun gnus-apply-kill-file () |
4770 "Apply KILL file to the current newsgroup." | |
4771 ;; Apply the global KILL file. | |
4772 (load (gnus-newsgroup-kill-file nil) t nil t) | |
4773 ;; And then apply the local KILL file. | |
4774 (load (gnus-newsgroup-kill-file gnus-newsgroup-name) t nil t)) | |
4775 | |
4776 (defun gnus-Newsgroup-kill-file (newsgroup) | |
4777 "Return the name of a KILL file of NEWSGROUP. | |
4778 If NEWSGROUP is nil, return the global KILL file instead." | |
4779 (cond ((or (null newsgroup) | |
4780 (string-equal newsgroup "")) | |
4781 ;; The global KILL file is placed at top of the directory. | |
4782 (expand-file-name gnus-kill-file-name | |
4783 (or gnus-article-save-directory "~/News"))) | |
4784 (gnus-use-long-file-name | |
4785 ;; Append ".KILL" to capitalized newsgroup name. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4786 (expand-file-name (concat (gnus-capitalize-newsgroup newsgroup) |
257 | 4787 "." gnus-kill-file-name) |
4788 (or gnus-article-save-directory "~/News"))) | |
4789 (t | |
4790 ;; Place "KILL" under the hierarchical directory. | |
4791 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup) | |
4792 "/" gnus-kill-file-name) | |
4793 (or gnus-article-save-directory "~/News"))) | |
4794 )) | |
4795 | |
4796 (defun gnus-newsgroup-kill-file (newsgroup) | |
4797 "Return the name of a KILL file of NEWSGROUP. | |
4798 If NEWSGROUP is nil, return the global KILL file instead." | |
4799 (cond ((or (null newsgroup) | |
4800 (string-equal newsgroup "")) | |
4801 ;; The global KILL file is placed at top of the directory. | |
4802 (expand-file-name gnus-kill-file-name | |
4803 (or gnus-article-save-directory "~/News"))) | |
4804 (gnus-use-long-file-name | |
4805 ;; Append ".KILL" to newsgroup name. | |
4806 (expand-file-name (concat newsgroup "." gnus-kill-file-name) | |
4807 (or gnus-article-save-directory "~/News"))) | |
4808 (t | |
4809 ;; Place "KILL" under the hierarchical directory. | |
4810 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup) | |
4811 "/" gnus-kill-file-name) | |
4812 (or gnus-article-save-directory "~/News"))) | |
4813 )) | |
4814 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4815 ;; For subscribing new newsgroup |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4816 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4817 (defun gnus-subscribe-randomly (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4818 "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
|
4819 (gnus-subscribe-newsgroup newsgroup |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4820 (car (car gnus-newsrc-assoc)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4821 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4822 (defun gnus-subscribe-alphabetically (newgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4823 "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
|
4824 ;; 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
|
4825 (let ((groups gnus-newsrc-assoc) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4826 (before nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4827 (while (and (not before) groups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4828 (if (string< newgroup (car (car groups))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4829 (setq before (car (car groups))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4830 (setq groups (cdr groups)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4831 (gnus-subscribe-newsgroup newgroup before) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4832 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4833 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4834 (defun gnus-subscribe-hierarchically (newgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4835 "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
|
4836 ;; 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
|
4837 (save-excursion |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4838 (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
|
4839 (let ((groupkey newgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4840 (before nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4841 (while (and (not before) groupkey) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4842 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4843 (let ((groupkey-re |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4844 (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4845 (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
|
4846 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4847 (setq before (buffer-substring |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4848 (match-beginning 1) (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4849 (string< before newgroup))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4850 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4851 ;; 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
|
4852 (setq groupkey |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4853 (if (string-match "^\\(.*\\)\\.[^.]+$" groupkey) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4854 (substring groupkey (match-beginning 1) (match-end 1))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4855 (gnus-subscribe-newsgroup newgroup before) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4856 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4857 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4858 (defun gnus-subscribe-interactively (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4859 "Subscribe new NEWSGROUP interactively. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4860 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
|
4861 Unless, it is killed." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4862 (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
|
4863 (gnus-subscribe-hierarchically newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4864 ;; Save in kill-ring |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4865 (gnus-subscribe-newsgroup newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4866 (gnus-kill-newsgroup newsgroup))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4867 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4868 (defun gnus-subscribe-newsgroup (newsgroup &optional next) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4869 "Subscribe new NEWSGROUP. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4870 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
|
4871 (gnus-insert-newsgroup (list newsgroup t) next) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4872 (message "Subscribe newsgroup: %s" newsgroup)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4873 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4874 ;; For directories |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4875 |
257 | 4876 (defun gnus-newsgroup-directory-form (newsgroup) |
4877 "Make hierarchical directory name from NEWSGROUP name." | |
4878 (let ((newsgroup (substring newsgroup 0)) ;Copy string. | |
4879 (len (length newsgroup)) | |
4880 (idx 0)) | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
4881 ;; Replace all occurrences of `.' with `/'. |
257 | 4882 (while (< idx len) |
4883 (if (= (aref newsgroup idx) ?.) | |
4884 (aset newsgroup idx ?/)) | |
4885 (setq idx (1+ idx))) | |
4886 newsgroup | |
4887 )) | |
4888 | |
4889 (defun gnus-make-directory (directory) | |
4890 "Make DIRECTORY recursively." | |
4891 (let ((directory (expand-file-name directory default-directory))) | |
4892 (or (file-exists-p directory) | |
4893 (gnus-make-directory-1 "" directory)) | |
4894 )) | |
4895 | |
4896 (defun gnus-make-directory-1 (head tail) | |
4897 (cond ((string-match "^/\\([^/]+\\)" tail) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4898 ;; ange-ftp interferes with calling match-* after |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4899 ;; calling file-name-as-directory. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4900 (let ((beg (match-beginning 1)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4901 (end (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4902 (setq head (concat (file-name-as-directory head) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4903 (substring tail beg end))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4904 (or (file-exists-p head) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4905 (call-process "mkdir" nil nil nil head)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4906 (gnus-make-directory-1 head (substring tail end)))) |
257 | 4907 ((string-equal tail "") t) |
4908 )) | |
4909 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4910 (defun gnus-capitalize-newsgroup (newsgroup) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4911 "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
|
4912 ;; 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
|
4913 (let ((current-syntax-table (syntax-table))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4914 (unwind-protect |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4915 (progn |
5313
3189e46001fd
(gnus-capitalize-newsgroup): Modify a new temporary
Richard M. Stallman <rms@gnu.org>
parents:
5057
diff
changeset
|
4916 (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
|
4917 (modify-syntax-entry ?- "w") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4918 (modify-syntax-entry ?. "w") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4919 (capitalize newsgroup)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4920 (set-syntax-table current-syntax-table)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4921 |
257 | 4922 (defun gnus-simplify-subject (subject &optional re-only) |
4923 "Remove `Re:' and words in parentheses. | |
4924 If optional argument RE-ONLY is non-nil, strip `Re:' only." | |
4925 (let ((case-fold-search t)) ;Ignore case. | |
4926 ;; Remove `Re:' and `Re^N:'. | |
4927 (if (string-match "\\`\\(re\\(\\^[0-9]+\\)?:[ \t]+\\)+" subject) | |
4928 (setq subject (substring subject (match-end 0)))) | |
4929 ;; Remove words in parentheses from end. | |
4930 (or re-only | |
4931 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject) | |
4932 (setq subject (substring subject 0 (match-beginning 0))))) | |
4933 ;; Return subject string. | |
4934 subject | |
4935 )) | |
4936 | |
4937 (defun gnus-optional-lines-and-from (header) | |
4938 "Return a string like `NNN:AUTHOR' from HEADER." | |
4939 (let ((name-length (length "umerin@photon"))) | |
4940 (substring (format "%3d:%s" | |
4941 ;; Lines of the article. | |
4942 ;; Suggested by dana@bellcore.com. | |
4943 (nntp-header-lines header) | |
4944 ;; Its author. | |
4945 (concat (mail-strip-quoted-names | |
4946 (nntp-header-from header)) | |
4947 (make-string name-length ? ))) | |
4948 ;; 4 stands for length of `NNN:'. | |
4949 0 (+ 4 name-length)))) | |
4950 | |
4951 (defun gnus-optional-lines (header) | |
4952 "Return a string like `NNN' from HEADER." | |
4953 (format "%4d" (nntp-header-lines header))) | |
4954 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4955 ;; 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
|
4956 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4957 (defun gnus-keysort-headers (predicate key &optional reverse) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4958 "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
|
4959 *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
|
4960 Optional argument REVERSE means reverse order." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4961 (let ((inhibit-quit t)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4962 (setq gnus-newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4963 (if reverse |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4964 (nreverse |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4965 (gnus-keysort (nreverse gnus-newsgroup-headers) predicate key)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4966 (gnus-keysort gnus-newsgroup-headers predicate key))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4967 ;; Make sure we don't have to call |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4968 ;; 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
|
4969 ;; 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
|
4970 ;; 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
|
4971 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4972 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4973 (defun gnus-keysort (list predicate key) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4974 "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
|
4975 (mapcar (function cdr) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4976 (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
|
4977 (function (lambda (a b) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4978 (funcall predicate (car a) (car b))))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4979 |
257 | 4980 (defun gnus-sort-headers (predicate &optional reverse) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4981 "Sort current headers by PREDICATE safely. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4982 *Safely* means C-g quitting is disabled during sort. |
257 | 4983 Optional argument REVERSE means reverse order." |
4984 (let ((inhibit-quit t)) | |
4985 (setq gnus-newsgroup-headers | |
4986 (if reverse | |
4987 (nreverse (sort (nreverse gnus-newsgroup-headers) predicate)) | |
4988 (sort gnus-newsgroup-headers predicate))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4989 ;; Make sure we don't have to call |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4990 ;; 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
|
4991 ;; 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
|
4992 ;; entry is added to nor deleted from the variable. |
257 | 4993 )) |
4994 | |
4995 (defun gnus-string-lessp (a b) | |
4996 "Return T if first arg string is less than second in lexicographic order. | |
4997 If case-fold-search is non-nil, case of letters is ignored." | |
4998 (if case-fold-search | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
4999 (string-lessp (downcase a) (downcase b)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5000 (string-lessp a b))) |
257 | 5001 |
5002 (defun gnus-date-lessp (date1 date2) | |
5003 "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
|
5004 (string-lessp (gnus-sortable-date date1) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5005 (gnus-sortable-date date2))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5006 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5007 (defun gnus-sortable-date (date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5008 "Make sortable string by string-lessp from DATE. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5009 Timezone package is used." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5010 (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
|
5011 (year (string-to-int (aref date 0))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5012 (month (string-to-int (aref date 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5013 (day (string-to-int (aref date 2))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5014 (time (aref date 3))) ;HH:MM:SS |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5015 ;; 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
|
5016 ;; 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
|
5017 (timezone-make-sortable-date year month day time) |
257 | 5018 )) |
5019 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5020 ;;(defun gnus-sortable-date (date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5021 ;; "Make sortable string by string-lessp from DATE." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5022 ;; (let ((month '(("JAN" . " 1")("FEB" . " 2")("MAR" . " 3") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5023 ;; ("APR" . " 4")("MAY" . " 5")("JUN" . " 6") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5024 ;; ("JUL" . " 7")("AUG" . " 8")("SEP" . " 9") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5025 ;; ("OCT" . "10")("NOV" . "11")("DEC" . "12"))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5026 ;; (date (or date ""))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5027 ;; ;; Can understand the following styles: |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5028 ;; ;; (1) 14 Apr 89 03:20:12 GMT |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5029 ;; ;; (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
|
5030 ;; (if (string-match |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5031 ;; "\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\) \\([0-9:]+\\)" date) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5032 ;; (concat |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5033 ;; ;; Year |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5034 ;; (substring date (match-beginning 3) (match-end 3)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5035 ;; ;; Month |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5036 ;; (cdr |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5037 ;; (assoc |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5038 ;; (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
|
5039 ;; ;; Day |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5040 ;; (format "%2d" (string-to-int |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5041 ;; (substring date |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5042 ;; (match-beginning 1) (match-end 1)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5043 ;; ;; Time |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5044 ;; (substring date (match-beginning 4) (match-end 4))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5045 ;; ;; Cannot understand DATE string. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5046 ;; date |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5047 ;; ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5048 ;; )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5049 |
257 | 5050 (defun gnus-fetch-field (field) |
5051 "Return the value of the header FIELD of current article." | |
5052 (save-excursion | |
5053 (save-restriction | |
5054 (widen) | |
5055 (goto-char (point-min)) | |
5056 (narrow-to-region (point-min) | |
5057 (progn (search-forward "\n\n" nil 'move) (point))) | |
5058 (mail-fetch-field field)))) | |
5059 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5060 (fset 'gnus-expunge 'gnus-summary-delete-marked-with) |
257 | 5061 |
5062 (defun gnus-kill (field regexp &optional command all) | |
5063 "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
|
5064 Optional 1st argument COMMAND is default to |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5065 (gnus-summary-mark-as-read nil \"X\"). |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5066 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
|
5067 If FIELD is an empty string (or nil), entire article body is searched for. |
257 | 5068 COMMAND must be a lisp expression or a string representing a key sequence." |
5069 ;; We don't want to change current point nor window configuration. | |
5070 (save-excursion | |
5071 (save-window-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5072 ;; 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
|
5073 ;; macros correctly. See command_loop_1. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5074 (switch-to-buffer gnus-summary-buffer 'norecord) |
257 | 5075 (goto-char (point-min)) ;From the beginning. |
5076 (if (null command) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5077 (setq command '(gnus-summary-mark-as-read nil "X"))) |
257 | 5078 (gnus-execute field regexp command nil (not all)) |
5079 ))) | |
5080 | |
5081 (defun gnus-execute (field regexp form &optional backward ignore-marked) | |
5082 "If FIELD of article header matches REGEXP, execute lisp FORM (or a string). | |
5083 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
|
5084 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
|
5085 If optional 2nd argument IGNORE-MARKED is non-nil, articles which are |
257 | 5086 marked as read or unread are ignored." |
5087 (let ((function nil) | |
5088 (header nil) | |
5089 (article nil)) | |
5090 (if (string-equal field "") | |
5091 (setq field nil)) | |
5092 (if (null field) | |
5093 nil | |
5094 (or (stringp field) | |
5095 (setq field (symbol-name field))) | |
5096 ;; Get access function of header filed. | |
5097 (setq function (intern-soft (concat "gnus-header-" (downcase field)))) | |
5098 (if (and function (fboundp function)) | |
5099 (setq function (symbol-function function)) | |
5100 (error "Unknown header field: \"%s\"" field))) | |
5101 ;; Make FORM funcallable. | |
5102 (if (and (listp form) (not (eq (car form) 'lambda))) | |
5103 (setq form (list 'lambda nil form))) | |
5104 ;; Starting from the current article. | |
5105 (or (and ignore-marked | |
5106 ;; 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
|
5107 (setq article (gnus-summary-article-number)) |
257 | 5108 (or (not (memq article gnus-newsgroup-unreads)) ;Marked as read. |
5109 (memq article gnus-newsgroup-marked) ;Marked as unread. | |
5110 )) | |
5111 (gnus-execute-1 function regexp form)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5112 (while (gnus-summary-search-subject backward ignore-marked nil) |
257 | 5113 (gnus-execute-1 function regexp form)) |
5114 )) | |
5115 | |
5116 (defun gnus-execute-1 (function regexp form) | |
5117 (save-excursion | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5118 ;; 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
|
5119 (let ((article (gnus-summary-article-number))) |
257 | 5120 (if (null article) |
5121 nil ;Nothing to do. | |
5122 (if function | |
5123 ;; Compare with header field. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5124 (let (;;(header (gnus-find-header-by-number |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5125 ;; gnus-newsgroup-headers article)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5126 (header (gnus-get-header-by-number article)) |
257 | 5127 (value nil)) |
5128 (and header | |
5129 (progn | |
5130 (setq value (funcall function header)) | |
5131 ;; Number (Lines:) or symbol must be converted to string. | |
5132 (or (stringp value) | |
5133 (setq value (prin1-to-string value))) | |
5134 (string-match regexp value)) | |
5135 (if (stringp form) ;Keyboard macro. | |
5136 (execute-kbd-macro form) | |
5137 (funcall form)))) | |
5138 ;; Search article body. | |
5139 (let ((gnus-current-article nil) ;Save article pointer. | |
5140 (gnus-last-article nil) | |
5141 (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
|
5142 (gnus-mark-article-hook nil)) ;Inhibit marking as read. |
257 | 5143 (message "Searching for article: %d..." article) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5144 (gnus-article-setup-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5145 (gnus-article-prepare article t) |
257 | 5146 (if (save-excursion |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5147 (set-buffer gnus-article-buffer) |
257 | 5148 (goto-char (point-min)) |
5149 (re-search-forward regexp nil t)) | |
5150 (if (stringp form) ;Keyboard macro. | |
5151 (execute-kbd-macro form) | |
5152 (funcall form)))) | |
5153 )) | |
5154 ))) | |
5155 | |
5156 ;;; caesar-region written by phr@prep.ai.mit.edu Nov 86 | |
5157 ;;; modified by tower@prep Nov 86 | |
5158 ;;; Modified by umerin@flab.flab.Fujitsu.JUNET for ROT47. | |
5159 | |
5160 (defun gnus-caesar-region (&optional n) | |
5161 "Caesar rotation of region by N, default 13, for decrypting netnews. | |
5162 ROT47 will be performed for Japanese text in any case." | |
5163 (interactive (if current-prefix-arg ; Was there a prefix arg? | |
5164 (list (prefix-numeric-value current-prefix-arg)) | |
5165 (list nil))) | |
5166 (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
|
5167 (t (setq n (mod n 26)))) ;canonicalize N |
257 | 5168 (if (not (zerop n)) ; no action needed for a rot of 0 |
5169 (progn | |
5170 (if (or (not (boundp 'caesar-translate-table)) | |
5171 (/= (aref caesar-translate-table ?a) (+ ?a n))) | |
5172 (let ((i 0) (lower "abcdefghijklmnopqrstuvwxyz") upper) | |
5173 (message "Building caesar-translate-table...") | |
5174 (setq caesar-translate-table (make-vector 256 0)) | |
5175 (while (< i 256) | |
5176 (aset caesar-translate-table i i) | |
5177 (setq i (1+ i))) | |
5178 (setq lower (concat lower lower) upper (upcase lower) i 0) | |
5179 (while (< i 26) | |
5180 (aset caesar-translate-table (+ ?a i) (aref lower (+ i n))) | |
5181 (aset caesar-translate-table (+ ?A i) (aref upper (+ i n))) | |
5182 (setq i (1+ i))) | |
5183 ;; ROT47 for Japanese text. | |
5184 ;; Thanks to ichikawa@flab.fujitsu.junet. | |
5185 (setq i 161) | |
5186 (let ((t1 (logior ?O 128)) | |
5187 (t2 (logior ?! 128)) | |
5188 (t3 (logior ?~ 128))) | |
5189 (while (< i 256) | |
5190 (aset caesar-translate-table i | |
5191 (let ((v (aref caesar-translate-table i))) | |
5192 (if (<= v t1) (if (< v t2) v (+ v 47)) | |
5193 (if (<= v t3) (- v 47) v)))) | |
5194 (setq i (1+ i)))) | |
5195 (message "Building caesar-translate-table... done"))) | |
5196 (let ((from (region-beginning)) | |
5197 (to (region-end)) | |
5198 (i 0) str len) | |
5199 (setq str (buffer-substring from to)) | |
5200 (setq len (length str)) | |
5201 (while (< i len) | |
5202 (aset str i (aref caesar-translate-table (aref str i))) | |
5203 (setq i (1+ i))) | |
5204 (goto-char from) | |
5205 (delete-region from to) | |
5206 (insert str))))) | |
5207 | |
5208 ;; Functions accessing headers. | |
5209 ;; Functions are more convenient than macros in some case. | |
5210 | |
5211 (defun gnus-header-number (header) | |
5212 "Return article number in HEADER." | |
5213 (nntp-header-number header)) | |
5214 | |
5215 (defun gnus-header-subject (header) | |
5216 "Return subject string in HEADER." | |
5217 (nntp-header-subject header)) | |
5218 | |
5219 (defun gnus-header-from (header) | |
5220 "Return author string in HEADER." | |
5221 (nntp-header-from header)) | |
5222 | |
5223 (defun gnus-header-xref (header) | |
5224 "Return xref string in HEADER." | |
5225 (nntp-header-xref header)) | |
5226 | |
5227 (defun gnus-header-lines (header) | |
5228 "Return lines in HEADER." | |
5229 (nntp-header-lines header)) | |
5230 | |
5231 (defun gnus-header-date (header) | |
5232 "Return date in HEADER." | |
5233 (nntp-header-date header)) | |
5234 | |
5235 (defun gnus-header-id (header) | |
5236 "Return Id in HEADER." | |
5237 (nntp-header-id header)) | |
5238 | |
5239 (defun gnus-header-references (header) | |
5240 "Return references in HEADER." | |
5241 (nntp-header-references header)) | |
5242 | |
5243 | |
5244 ;;; | |
5245 ;;; Article savers. | |
5246 ;;; | |
5247 | |
5248 (defun gnus-output-to-rmail (file-name) | |
5249 "Append the current article to an Rmail file named FILE-NAME." | |
5250 (require 'rmail) | |
5251 ;; Most of these codes are borrowed from rmailout.el. | |
5252 (setq file-name (expand-file-name file-name)) | |
5253 (setq rmail-last-rmail-file file-name) | |
5254 (let ((artbuf (current-buffer)) | |
5255 (tmpbuf (get-buffer-create " *GNUS-output*"))) | |
5256 (save-excursion | |
5257 (or (get-file-buffer file-name) | |
5258 (file-exists-p file-name) | |
5259 (if (yes-or-no-p | |
5260 (concat "\"" file-name "\" does not exist, create it? ")) | |
5261 (let ((file-buffer (create-file-buffer file-name))) | |
5262 (save-excursion | |
5263 (set-buffer file-buffer) | |
5264 (rmail-insert-rmail-file-header) | |
5265 (let ((require-final-newline nil)) | |
5266 (write-region (point-min) (point-max) file-name t 1))) | |
5267 (kill-buffer file-buffer)) | |
5268 (error "Output file does not exist"))) | |
5269 (set-buffer tmpbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5270 (buffer-flush-undo (current-buffer)) |
257 | 5271 (erase-buffer) |
5272 (insert-buffer-substring artbuf) | |
5273 (gnus-convert-article-to-rmail) | |
5274 ;; Decide whether to append to a file or to an Emacs buffer. | |
5275 (let ((outbuf (get-file-buffer file-name))) | |
5276 (if (not outbuf) | |
5277 (append-to-file (point-min) (point-max) file-name) | |
5278 ;; File has been visited, in buffer OUTBUF. | |
5279 (set-buffer outbuf) | |
5280 (let ((buffer-read-only nil) | |
5281 (msg (and (boundp 'rmail-current-message) | |
5282 rmail-current-message))) | |
5283 ;; If MSG is non-nil, buffer is in RMAIL mode. | |
5284 (if msg | |
5285 (progn (widen) | |
5286 (narrow-to-region (point-max) (point-max)))) | |
5287 (insert-buffer-substring tmpbuf) | |
5288 (if msg | |
5289 (progn | |
5290 (goto-char (point-min)) | |
5291 (widen) | |
5292 (search-backward "\^_") | |
5293 (narrow-to-region (point) (point-max)) | |
5294 (goto-char (1+ (point-min))) | |
5295 (rmail-count-new-messages t) | |
5296 (rmail-show-message msg)))))) | |
5297 ) | |
5298 (kill-buffer tmpbuf) | |
5299 )) | |
5300 | |
5301 (defun gnus-output-to-file (file-name) | |
5302 "Append the current article to a file named FILE-NAME." | |
5303 (setq file-name (expand-file-name file-name)) | |
5304 (let ((artbuf (current-buffer)) | |
5305 (tmpbuf (get-buffer-create " *GNUS-output*"))) | |
5306 (save-excursion | |
5307 (set-buffer tmpbuf) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5308 (buffer-flush-undo (current-buffer)) |
257 | 5309 (erase-buffer) |
5310 (insert-buffer-substring artbuf) | |
5311 ;; Append newline at end of the buffer as separator, and then | |
5312 ;; save it to file. | |
5313 (goto-char (point-max)) | |
5314 (insert "\n") | |
5315 (append-to-file (point-min) (point-max) file-name)) | |
5316 (kill-buffer tmpbuf) | |
5317 )) | |
5318 | |
5319 (defun gnus-convert-article-to-rmail () | |
5320 "Convert article in current buffer to Rmail message format." | |
5321 (let ((buffer-read-only nil)) | |
5322 ;; Convert article directly into Babyl format. | |
5323 ;; Suggested by Rob Austein <sra@lcs.mit.edu> | |
5324 (goto-char (point-min)) | |
5325 (insert "\^L\n0, unseen,,\n*** EOOH ***\n") | |
5326 (while (search-forward "\n\^_" nil t) ;single char | |
5327 (replace-match "\n^_")) ;2 chars: "^" and "_" | |
5328 (goto-char (point-max)) | |
5329 (insert "\^_"))) | |
5330 | |
5331 ;;(defun gnus-convert-article-to-rmail () | |
5332 ;; "Convert article in current buffer to Rmail message format." | |
5333 ;; (let ((buffer-read-only nil)) | |
5334 ;; ;; Insert special header of Unix mail. | |
5335 ;; (goto-char (point-min)) | |
5336 ;; (insert "From " | |
5337 ;; (or (mail-strip-quoted-names (mail-fetch-field "from")) | |
5338 ;; "unknown") | |
5339 ;; " " (current-time-string) "\n") | |
5340 ;; ;; Stop quoting `From' since this seems unnecessary in most cases. | |
5341 ;; ;; ``Quote'' "\nFrom " as "\n>From " | |
5342 ;; ;;(while (search-forward "\nFrom " nil t) | |
5343 ;; ;; (forward-char -5) | |
5344 ;; ;; (insert ?>)) | |
5345 ;; ;; Convert article to babyl format. | |
5346 ;; (rmail-convert-to-babyl-format) | |
5347 ;; )) | |
5348 | |
5349 | |
5350 ;;; | |
5351 ;;; Internal functions. | |
5352 ;;; | |
5353 | |
5354 (defun gnus-start-news-server (&optional confirm) | |
5355 "Open network stream to remote NNTP server. | |
5356 If optional argument CONFIRM is non-nil, ask you host that NNTP server | |
5357 is running even if it is defined. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5358 Run gnus-open-server-hook just before opening news server." |
257 | 5359 (if (gnus-server-opened) |
5360 ;; Stream is already opened. | |
5361 nil | |
5362 ;; Open NNTP server. | |
5363 (if (or confirm | |
5364 (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
|
5365 ;; 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
|
5366 ;; 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
|
5367 (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
|
5368 (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
|
5369 ;; 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
|
5370 (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
|
5371 (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
|
5372 (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
|
5373 gnus-secondary-servers) |
d701e7af5ba5
* gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents:
3610
diff
changeset
|
5374 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
|
5375 (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
|
5376 (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
|
5377 (setq gnus-nntp-server ""))) |
257 | 5378 ;; 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
|
5379 (if (or (string-equal gnus-nntp-server "") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5380 (string-equal gnus-nntp-server "::")) ;RMS preference. |
257 | 5381 (setq gnus-nntp-server (system-name))) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5382 ;; 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
|
5383 ;; 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
|
5384 ;; gnus-nntp-server. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5385 (cond ((and (null gnus-nntp-service) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5386 (string-equal gnus-nntp-server (system-name))) |
716
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5387 (require 'nnspool) |
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5388 (gnus-define-access-method 'nnspool) |
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5389 (message "Looking up local news spool...")) |
f11e7af7c0d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
711
diff
changeset
|
5390 ((string-match ":" gnus-nntp-server) |
257 | 5391 ;; :DIRECTORY |
5392 (require 'mhspool) | |
5393 (gnus-define-access-method 'mhspool) | |
5394 (message "Looking up private directory...")) | |
5395 (t | |
5396 (gnus-define-access-method 'nntp) | |
5397 (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
|
5398 (run-hooks 'gnus-open-server-hook) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5399 (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
|
5400 (message "")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5401 ((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
|
5402 (message "")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5403 (t |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5404 (error |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5405 (gnus-nntp-message |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5406 (format "Cannot open NNTP server on %s" gnus-nntp-server))))) |
257 | 5407 )) |
5408 | |
5409 ;; Dummy functions used only once. Should return nil. | |
5410 (defun gnus-server-opened () nil) | |
5411 (defun gnus-close-server () nil) | |
5412 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5413 (defun gnus-nntp-message (&optional message) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5414 "Return a message returned from NNTP server. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5415 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
|
5416 (let ((status (gnus-status-message)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5417 (message (or message ""))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5418 (if (and (stringp status) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5419 (> (length status) 0)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5420 status message))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5421 |
257 | 5422 (defun gnus-define-access-method (method &optional access-methods) |
5423 "Define access functions for the access METHOD. | |
3591
507f64624555
Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents:
3496
diff
changeset
|
5424 Methods definition is taken from optional argument ACCESS-METHODS or |
257 | 5425 the variable gnus-access-methods." |
5426 (let ((bindings | |
5427 (cdr (assoc method (or access-methods gnus-access-methods))))) | |
5428 (if (null bindings) | |
5429 (error "Unknown access method: %s" method) | |
5430 ;; Should not use symbol-function here since overload does not work. | |
5431 (while bindings | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5432 ;; 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
|
5433 (fset (car (car bindings)) (car (cdr (car bindings)))) |
257 | 5434 (setq bindings (cdr bindings))) |
5435 ))) | |
5436 | |
5437 (defun gnus-select-newsgroup (group &optional show-all) | |
5438 "Select newsgroup GROUP. | |
5439 If optional argument SHOW-ALL is non-nil, all of articles in the group | |
5440 are selected." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5441 ;; 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
|
5442 (gnus-start-news-server) |
257 | 5443 (if (gnus-request-group group) |
5444 (let ((articles nil)) | |
5445 (setq gnus-newsgroup-name group) | |
5446 (setq gnus-newsgroup-unreads | |
5447 (gnus-uncompress-sequence | |
5448 (nthcdr 2 (gnus-gethash group gnus-unread-hashtb)))) | |
5449 (cond (show-all | |
5450 ;; Select all active articles. | |
5451 (setq articles | |
5452 (gnus-uncompress-sequence | |
5453 (nthcdr 2 (gnus-gethash group gnus-active-hashtb))))) | |
5454 (t | |
5455 ;; Select unread articles only. | |
5456 (setq articles gnus-newsgroup-unreads))) | |
5457 ;; Require confirmation if selecting large newsgroup. | |
5458 (setq gnus-newsgroup-unselected nil) | |
5459 (if (not (numberp gnus-large-newsgroup)) | |
5460 nil | |
5461 (let ((selected nil) | |
5462 (number (length articles))) | |
5463 (if (> number gnus-large-newsgroup) | |
5464 (progn | |
5465 (condition-case () | |
5466 (let ((input | |
5467 (read-string | |
5468 (format | |
5469 "How many articles from %s (default %d): " | |
5470 gnus-newsgroup-name number)))) | |
5471 (setq selected | |
5472 (if (string-equal input "") | |
5473 number (string-to-int input)))) | |
5474 (quit | |
5475 (setq selected 0))) | |
5476 (cond ((and (> selected 0) | |
5477 (< selected number)) | |
5478 ;; Select last N articles. | |
5479 (setq articles (nthcdr (- number selected) articles))) | |
5480 ((and (< selected 0) | |
5481 (< (- 0 selected) number)) | |
5482 ;; Select first N articles. | |
5483 (setq selected (- 0 selected)) | |
5484 (setq articles (copy-sequence articles)) | |
5485 (setcdr (nthcdr (1- selected) articles) nil)) | |
5486 ((zerop selected) | |
5487 (setq articles nil)) | |
5488 ;; Otherwise select all. | |
5489 ) | |
5490 ;; Get unselected unread articles. | |
5491 (setq gnus-newsgroup-unselected | |
5492 (gnus-set-difference gnus-newsgroup-unreads articles)) | |
5493 )) | |
5494 )) | |
5495 ;; Get headers list. | |
5496 (setq gnus-newsgroup-headers (gnus-retrieve-headers articles)) | |
5497 ;; UNREADS may contain expired articles, so we have to remove | |
5498 ;; them from the list. | |
5499 (setq gnus-newsgroup-unreads | |
5500 (gnus-intersection gnus-newsgroup-unreads | |
5501 (mapcar | |
5502 (function | |
5503 (lambda (header) | |
5504 (nntp-header-number header))) | |
5505 gnus-newsgroup-headers))) | |
5506 ;; Marked article must be a subset of unread articles. | |
5507 (setq gnus-newsgroup-marked | |
5508 (gnus-intersection (append gnus-newsgroup-unselected | |
5509 gnus-newsgroup-unreads) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5510 (cdr |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5511 (gnus-gethash group gnus-marked-hashtb)))) |
257 | 5512 ;; First and last article in this newsgroup. |
5513 (setq gnus-newsgroup-begin | |
5514 (if gnus-newsgroup-headers | |
5515 (nntp-header-number (car gnus-newsgroup-headers)) | |
5516 0 | |
5517 )) | |
5518 (setq gnus-newsgroup-end | |
5519 (if gnus-newsgroup-headers | |
5520 (nntp-header-number | |
5521 (gnus-last-element gnus-newsgroup-headers)) | |
5522 0 | |
5523 )) | |
5524 ;; File name that an article was saved last. | |
5525 (setq gnus-newsgroup-last-rmail nil) | |
5526 (setq gnus-newsgroup-last-mail nil) | |
5527 (setq gnus-newsgroup-last-folder nil) | |
5528 (setq gnus-newsgroup-last-file nil) | |
5529 ;; Reset article pointer etc. | |
5530 (setq gnus-current-article nil) | |
5531 (setq gnus-current-headers nil) | |
5532 (setq gnus-current-history nil) | |
5533 (setq gnus-have-all-headers nil) | |
5534 (setq gnus-last-article nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5535 ;; 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
|
5536 (gnus-clear-hashtables-for-newsgroup-headers) |
257 | 5537 ;; GROUP is successfully selected. |
5538 t | |
5539 ) | |
5540 )) | |
5541 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5542 ;; Hacking for making header search much faster. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5543 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5544 (defun gnus-get-header-by-number (number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5545 "Return a header specified by a NUMBER. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5546 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
|
5547 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
|
5548 rehash is necessary." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5549 (or gnus-newsgroup-headers-hashtb-by-number |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5550 (gnus-make-headers-hashtable-by-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5551 (gnus-gethash (int-to-string number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5552 gnus-newsgroup-headers-hashtb-by-number)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5553 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5554 (defun gnus-get-header-by-id (id) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5555 "Return a header specified by an ID. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5556 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
|
5557 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
|
5558 rehash is necessary." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5559 (or gnus-newsgroup-headers-hashtb-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5560 (gnus-make-headers-hashtable-by-id)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5561 (and (stringp id) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5562 (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
|
5563 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5564 (defun gnus-make-headers-hashtable-by-number () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5565 "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
|
5566 (let ((header nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5567 (headers gnus-newsgroup-headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5568 (setq gnus-newsgroup-headers-hashtb-by-number |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5569 (gnus-make-hashtable (length headers))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5570 (while headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5571 (setq header (car headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5572 (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
|
5573 header gnus-newsgroup-headers-hashtb-by-number) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5574 (setq headers (cdr headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5575 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5576 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5577 (defun gnus-make-headers-hashtable-by-id () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5578 "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
|
5579 (let ((header nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5580 (headers gnus-newsgroup-headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5581 (setq gnus-newsgroup-headers-hashtb-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5582 (gnus-make-hashtable (length headers))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5583 (while headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5584 (setq header (car headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5585 (gnus-sethash (nntp-header-id header) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5586 header gnus-newsgroup-headers-hashtb-by-id) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5587 (setq headers (cdr headers)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5588 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5589 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5590 (defun gnus-clear-hashtables-for-newsgroup-headers () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5591 "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
|
5592 (setq gnus-newsgroup-headers-hashtb-by-id nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5593 (setq gnus-newsgroup-headers-hashtb-by-number nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5594 |
257 | 5595 (defun gnus-more-header-backward () |
5596 "Find new header backward." | |
5597 (let ((first | |
5598 (car (nth 2 (gnus-gethash gnus-newsgroup-name gnus-active-hashtb)))) | |
5599 (artnum gnus-newsgroup-begin) | |
5600 (header nil)) | |
5601 (while (and (not header) | |
5602 (> artnum first)) | |
5603 (setq artnum (1- artnum)) | |
5604 (setq header (car (gnus-retrieve-headers (list artnum))))) | |
5605 header | |
5606 )) | |
5607 | |
5608 (defun gnus-more-header-forward () | |
5609 "Find new header forward." | |
5610 (let ((last | |
5611 (cdr (nth 2 (gnus-gethash gnus-newsgroup-name gnus-active-hashtb)))) | |
5612 (artnum gnus-newsgroup-end) | |
5613 (header nil)) | |
5614 (while (and (not header) | |
5615 (< artnum last)) | |
5616 (setq artnum (1+ artnum)) | |
5617 (setq header (car (gnus-retrieve-headers (list artnum))))) | |
5618 header | |
5619 )) | |
5620 | |
5621 (defun gnus-extend-newsgroup (header &optional backward) | |
5622 "Extend newsgroup selection with HEADER. | |
5623 Optional argument BACKWARD means extend toward backward." | |
5624 (if header | |
5625 (let ((artnum (nntp-header-number header))) | |
5626 (setq gnus-newsgroup-headers | |
5627 (if backward | |
5628 (cons header gnus-newsgroup-headers) | |
5629 (append gnus-newsgroup-headers (list header)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5630 ;; 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
|
5631 (gnus-clear-hashtables-for-newsgroup-headers) |
257 | 5632 ;; We have to update unreads and unselected, but don't have to |
5633 ;; care about gnus-newsgroup-marked. | |
5634 (if (memq artnum gnus-newsgroup-unselected) | |
5635 (setq gnus-newsgroup-unreads | |
5636 (cons artnum gnus-newsgroup-unreads))) | |
5637 (setq gnus-newsgroup-unselected | |
5638 (delq artnum gnus-newsgroup-unselected)) | |
5639 (setq gnus-newsgroup-begin (min gnus-newsgroup-begin artnum)) | |
5640 (setq gnus-newsgroup-end (max gnus-newsgroup-end artnum)) | |
5641 ))) | |
5642 | |
5643 (defun gnus-mark-article-as-read (article) | |
5644 "Remember that ARTICLE is marked as read." | |
5645 ;; Remove from unread and marked list. | |
5646 (setq gnus-newsgroup-unreads | |
5647 (delq article gnus-newsgroup-unreads)) | |
5648 (setq gnus-newsgroup-marked | |
5649 (delq article gnus-newsgroup-marked))) | |
5650 | |
5651 (defun gnus-mark-article-as-unread (article &optional clear-mark) | |
5652 "Remember that ARTICLE is marked as unread. | |
5653 Optional argument CLEAR-MARK means ARTICLE should not be remembered | |
5654 that it was marked as read once." | |
5655 ;; Add to unread list. | |
5656 (or (memq article gnus-newsgroup-unreads) | |
5657 (setq gnus-newsgroup-unreads | |
5658 (cons article gnus-newsgroup-unreads))) | |
5659 ;; If CLEAR-MARK is non-nil, the article must be removed from marked | |
5660 ;; list. Otherwise, it must be added to the list. | |
5661 (if clear-mark | |
5662 (setq gnus-newsgroup-marked | |
5663 (delq article gnus-newsgroup-marked)) | |
5664 (or (memq article gnus-newsgroup-marked) | |
5665 (setq gnus-newsgroup-marked | |
5666 (cons article gnus-newsgroup-marked))))) | |
5667 | |
5668 (defun gnus-clear-system () | |
5669 "Clear all variables and buffer." | |
5670 ;; Clear GNUS variables. | |
5671 (let ((variables gnus-variable-list)) | |
5672 (while variables | |
5673 (set (car variables) nil) | |
5674 (setq variables (cdr variables)))) | |
5675 ;; Clear other internal variables. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5676 (setq gnus-newsrc-hashtb nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5677 (setq gnus-marked-hashtb nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5678 (setq gnus-killed-hashtb nil) |
257 | 5679 (setq gnus-active-hashtb nil) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5680 (setq gnus-octive-hashtb nil) |
257 | 5681 (setq gnus-unread-hashtb nil) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5682 (setq gnus-newsgroup-headers nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5683 (setq gnus-newsgroup-headers-hashtb-by-id nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5684 (setq gnus-newsgroup-headers-hashtb-by-number nil) |
257 | 5685 ;; Kill the startup file. |
5686 (and gnus-current-startup-file | |
5687 (get-file-buffer gnus-current-startup-file) | |
5688 (kill-buffer (get-file-buffer gnus-current-startup-file))) | |
5689 (setq gnus-current-startup-file nil) | |
5690 ;; Kill GNUS buffers. | |
5691 (let ((buffers gnus-buffer-list)) | |
5692 (while buffers | |
5693 (if (get-buffer (car buffers)) | |
5694 (kill-buffer (car buffers))) | |
5695 (setq buffers (cdr buffers)) | |
5696 ))) | |
5697 | |
5698 (defun gnus-configure-windows (action) | |
5699 "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
|
5700 The ACTION is either a symbol, such as `summary', or a |
257 | 5701 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
|
5702 configuration list is got from the variable gnus-window-configuration." |
257 | 5703 (let* ((windows |
5704 (if (listp action) | |
5705 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
|
5706 (grpwin (get-buffer-window gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5707 (subwin (get-buffer-window gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5708 (artwin (get-buffer-window gnus-article-buffer)) |
257 | 5709 (winsum nil) |
5710 (height nil) | |
5711 (grpheight 0) | |
5712 (subheight 0) | |
5713 (artheight 0)) | |
5714 (if (or (null windows) ;No configuration is specified. | |
5715 (and (eq (null grpwin) | |
5716 (zerop (nth 0 windows))) | |
5717 (eq (null subwin) | |
5718 (zerop (nth 1 windows))) | |
5719 (eq (null artwin) | |
5720 (zerop (nth 2 windows))))) | |
5721 ;; No need to change window configuration. | |
5722 nil | |
5723 (select-window (or grpwin subwin artwin (selected-window))) | |
5724 ;; First of all, compute the height of each window. | |
5725 (cond (gnus-use-full-window | |
5726 ;; Take up the entire screen. | |
5727 (delete-other-windows) | |
5728 (setq height (window-height (selected-window)))) | |
5729 (t | |
5730 (setq height (+ (if grpwin (window-height grpwin) 0) | |
5731 (if subwin (window-height subwin) 0) | |
5732 (if artwin (window-height artwin) 0))))) | |
5733 ;; The Newsgroup buffer exits always. So, use it to extend the | |
5734 ;; 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
|
5735 (switch-to-buffer gnus-group-buffer 'norecord) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5736 (and (get-buffer gnus-summary-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5737 (delete-windows-on gnus-summary-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5738 (and (get-buffer gnus-article-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5739 (delete-windows-on gnus-article-buffer)) |
257 | 5740 ;; Compute expected window height. |
5741 (setq winsum (apply (function +) windows)) | |
5742 (if (not (zerop (nth 0 windows))) | |
5743 (setq grpheight (max window-min-height | |
5744 (/ (* height (nth 0 windows)) winsum)))) | |
5745 (if (not (zerop (nth 1 windows))) | |
5746 (setq subheight (max window-min-height | |
5747 (/ (* height (nth 1 windows)) winsum)))) | |
5748 (if (not (zerop (nth 2 windows))) | |
5749 (setq artheight (max window-min-height | |
5750 (/ (* height (nth 2 windows)) winsum)))) | |
5751 (setq height (+ grpheight subheight artheight)) | |
5752 (enlarge-window (max 0 (- height (window-height (selected-window))))) | |
5753 ;; Then split the window. | |
5754 (and (not (zerop artheight)) | |
5755 (or (not (zerop grpheight)) | |
5756 (not (zerop subheight))) | |
5757 (split-window-vertically (+ grpheight subheight))) | |
5758 (and (not (zerop grpheight)) | |
5759 (not (zerop subheight)) | |
5760 (split-window-vertically grpheight)) | |
5761 ;; Then select buffers in each window. | |
5762 (and (not (zerop grpheight)) | |
5763 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5764 (switch-to-buffer gnus-group-buffer 'norecord) |
257 | 5765 (other-window 1))) |
5766 (and (not (zerop subheight)) | |
5767 (progn | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5768 (switch-to-buffer gnus-summary-buffer 'norecord) |
257 | 5769 (other-window 1))) |
5770 (and (not (zerop artheight)) | |
5771 (progn | |
5772 ;; If Article buffer does not exist, it will be created | |
5773 ;; and initialized. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5774 (gnus-article-setup-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5775 (switch-to-buffer gnus-article-buffer 'norecord))) |
257 | 5776 ) |
5777 )) | |
5778 | |
5779 (defun gnus-find-header-by-number (headers number) | |
5780 "Return a header which is a element of HEADERS and has NUMBER." | |
5781 (let ((found nil)) | |
5782 (while (and headers (not found)) | |
5783 ;; We cannot use `=' to accept non-numeric NUMBER. | |
5784 (if (eq number (nntp-header-number (car headers))) | |
5785 (setq found (car headers))) | |
5786 (setq headers (cdr headers))) | |
5787 found | |
5788 )) | |
5789 | |
5790 (defun gnus-find-header-by-id (headers id) | |
5791 "Return a header which is a element of HEADERS and has Message-ID." | |
5792 (let ((found nil)) | |
5793 (while (and headers (not found)) | |
5794 (if (string-equal id (nntp-header-id (car headers))) | |
5795 (setq found (car headers))) | |
5796 (setq headers (cdr headers))) | |
5797 found | |
5798 )) | |
5799 | |
5800 (defun gnus-version () | |
5801 "Version numbers of this version of GNUS." | |
5802 (interactive) | |
5803 (cond ((and (boundp 'mhspool-version) (boundp 'nnspool-version)) | |
5804 (message "%s; %s; %s; %s" | |
5805 gnus-version nntp-version nnspool-version mhspool-version)) | |
5806 ((boundp 'mhspool-version) | |
5807 (message "%s; %s; %s" | |
5808 gnus-version nntp-version mhspool-version)) | |
5809 ((boundp 'nnspool-version) | |
5810 (message "%s; %s; %s" | |
5811 gnus-version nntp-version nnspool-version)) | |
5812 (t | |
5813 (message "%s; %s" gnus-version nntp-version)))) | |
5814 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5815 (defun gnus-info-find-node () |
257 | 5816 "Find Info documentation of GNUS." |
5817 (interactive) | |
5818 (require 'info) | |
5819 ;; Enlarge info window if needed. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5820 (cond ((eq major-mode 'gnus-group-mode) |
257 | 5821 (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
|
5822 (pop-to-buffer gnus-group-buffer)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5823 ((eq major-mode 'gnus-summary-mode) |
257 | 5824 (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
|
5825 (pop-to-buffer gnus-summary-buffer))) |
2845
7a48e4a67e8c
(gnus-info-directory): Variable removed.
Roland McGrath <roland@gnu.org>
parents:
2843
diff
changeset
|
5826 (Info-goto-node (car (cdr (assq major-mode gnus-info-nodes))))) |
257 | 5827 |
5828 (defun gnus-overload-functions (&optional overloads) | |
5829 "Overload functions specified by optional argument OVERLOADS. | |
5830 If nothing is specified, use the variable gnus-overload-functions." | |
5831 (let ((defs nil) | |
5832 (overloads (or overloads gnus-overload-functions))) | |
5833 (while overloads | |
5834 (setq defs (car overloads)) | |
5835 (setq overloads (cdr overloads)) | |
5836 ;; 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
|
5837 ;; sure we cannot use `require' always. |
257 | 5838 (and (not (fboundp (car defs))) |
5839 (car (cdr (cdr defs))) | |
5840 (load (car (cdr (cdr defs))) nil 'nomessage)) | |
5841 (fset (car defs) (car (cdr defs))) | |
5842 ))) | |
5843 | |
5844 (defun gnus-make-threads (newsgroup-headers) | |
5845 "Make conversation threads tree from NEWSGROUP-HEADERS." | |
5846 (let ((headers newsgroup-headers) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5847 (refer nil) |
257 | 5848 (h nil) |
5849 (d nil) | |
5850 (roots nil) | |
5851 (dependencies nil)) | |
5852 ;; Make message dependency alist. | |
5853 (while headers | |
5854 (setq h (car headers)) | |
5855 (setq headers (cdr headers)) | |
5856 ;; Ignore invalid headers. | |
5857 (if (vectorp h) ;Depends on nntp.el. | |
5858 (progn | |
5859 ;; 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
|
5860 (setq refer (nntp-header-references h)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5861 (setq d (and refer |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5862 (string-match "\\(<[^<>]+>\\)[^>]*$" refer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5863 ;; (gnus-find-header-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5864 ;; newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5865 ;; (substring refer (match-beginning 1) (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5866 ;; In fact if the variable newsgroup-headers |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5867 ;; is not 'equal' to the variable |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5868 ;; gnus-newsgroup-headers, the following |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5869 ;; function call may return bogus value. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5870 (gnus-get-header-by-id |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5871 (substring refer (match-beginning 1) (match-end 1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5872 )) |
257 | 5873 ;; Check subject equality. |
5874 (or gnus-thread-ignore-subject | |
5875 (null d) | |
5876 (string-equal (gnus-simplify-subject | |
5877 (nntp-header-subject h) 're) | |
5878 (gnus-simplify-subject | |
5879 (nntp-header-subject d) 're)) | |
5880 ;; H should be a thread root. | |
5881 (setq d nil)) | |
5882 ;; H depends on D. | |
5883 (setq dependencies | |
5884 (cons (cons h d) dependencies)) | |
5885 ;; H is a thread root. | |
5886 (if (null d) | |
5887 (setq roots (cons h roots))) | |
5888 )) | |
5889 ) | |
5890 ;; Make complete threads from the roots. | |
5891 ;; Note: dependencies are in reverse order, but | |
5892 ;; gnus-make-threads-1 processes it in reverse order again. So, | |
5893 ;; we don't have to worry about it. | |
5894 (mapcar | |
5895 (function | |
5896 (lambda (root) | |
5897 (gnus-make-threads-1 root dependencies))) (nreverse roots)) | |
5898 )) | |
5899 | |
5900 (defun gnus-make-threads-1 (parent dependencies) | |
5901 (let ((children nil) | |
5902 (d nil) | |
5903 (depends dependencies)) | |
5904 ;; Find children. | |
5905 (while depends | |
5906 (setq d (car depends)) | |
5907 (setq depends (cdr depends)) | |
5908 (and (cdr d) | |
5909 (eq (nntp-header-id parent) (nntp-header-id (cdr d))) | |
5910 (setq children (cons (car d) children)))) | |
5911 ;; Go down. | |
5912 (cons parent | |
5913 (mapcar | |
5914 (function | |
5915 (lambda (child) | |
5916 (gnus-make-threads-1 child dependencies))) children)) | |
5917 )) | |
5918 | |
5919 (defun gnus-narrow-to-page (&optional arg) | |
5920 "Make text outside current page invisible except for page delimiter. | |
5921 A numeric arg specifies to move forward or backward by that many pages, | |
5922 thus showing a page other than the one point was originally in." | |
5923 (interactive "P") | |
5924 (setq arg (if arg (prefix-numeric-value arg) 0)) | |
5925 (save-excursion | |
5926 (forward-page -1) ;Beginning of current page. | |
5927 (widen) | |
5928 (if (> arg 0) | |
5929 (forward-page arg) | |
5930 (if (< arg 0) | |
5931 (forward-page (1- arg)))) | |
5932 ;; Find the end of the page. | |
5933 (forward-page) | |
5934 ;; If we stopped due to end of buffer, stay there. | |
5935 ;; If we stopped after a page delimiter, put end of restriction | |
5936 ;; at the beginning of that line. | |
5937 ;; These are commented out. | |
5938 ;; (if (save-excursion (beginning-of-line) | |
5939 ;; (looking-at page-delimiter)) | |
5940 ;; (beginning-of-line)) | |
5941 (narrow-to-region (point) | |
5942 (progn | |
5943 ;; Find the top of the page. | |
5944 (forward-page -1) | |
5945 ;; If we found beginning of buffer, stay there. | |
5946 ;; If extra text follows page delimiter on same line, | |
5947 ;; include it. | |
5948 ;; Otherwise, show text starting with following line. | |
5949 (if (and (eolp) (not (bobp))) | |
5950 (forward-line 1)) | |
5951 (point))) | |
5952 )) | |
5953 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5954 ;; 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
|
5955 ;; gnus-killed-assoc, and gnus-marked-assoc. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5956 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5957 (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
|
5958 "Return hash table for ALIST. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5959 Optional argument HASHSIZE specifies the hashtable size. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5960 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
|
5961 (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
|
5962 (while alist |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5963 (gnus-sethash (car (car alist)) ;Newsgroup name |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5964 (car alist) ;Alist element |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5965 hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5966 (setq alist (cdr alist))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5967 hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5968 )) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
5969 |
257 | 5970 (defun gnus-last-element (list) |
5971 "Return last element of LIST." | |
5972 (let ((last nil)) | |
5973 (while list | |
5974 (if (null (cdr list)) | |
5975 (setq last (car list))) | |
5976 (setq list (cdr list))) | |
5977 last | |
5978 )) | |
5979 | |
5980 (defun gnus-set-difference (list1 list2) | |
5981 "Return a list of elements of LIST1 that do not appear in LIST2." | |
5982 (let ((list1 (copy-sequence list1))) | |
5983 (while list2 | |
5984 (setq list1 (delq (car list2) list1)) | |
5985 (setq list2 (cdr list2))) | |
5986 list1 | |
5987 )) | |
5988 | |
5989 (defun gnus-intersection (list1 list2) | |
5990 "Return a list of elements that appear in both LIST1 and LIST2." | |
5991 (let ((result nil)) | |
5992 (while list2 | |
5993 (if (memq (car list2) list1) | |
5994 (setq result (cons (car list2) result))) | |
5995 (setq list2 (cdr list2))) | |
5996 result | |
5997 )) | |
5998 | |
5999 | |
6000 ;;; | |
6001 ;;; Get information about active articles, already read articles, and | |
6002 ;;; still unread articles. | |
6003 ;;; | |
6004 | |
6005 ;; GNUS internal format of gnus-newsrc-assoc and gnus-killed-assoc: | |
6006 ;; (("general" t (1 . 1)) | |
6007 ;; ("misc" t (1 . 10) (12 . 15)) | |
6008 ;; ("test" nil (1 . 99)) ...) | |
6009 ;; GNUS internal format of gnus-marked-assoc: | |
6010 ;; (("general" 1 2 3) | |
6011 ;; ("misc" 2) ...) | |
6012 ;; GNUS internal format of gnus-active-hashtb: | |
6013 ;; (("general" t (1 . 1)) | |
6014 ;; ("misc" t (1 . 10)) | |
6015 ;; ("test" nil (1 . 99)) ...) | |
6016 ;; GNUS internal format of gnus-unread-hashtb: | |
6017 ;; (("general" 1 (1 . 1)) | |
6018 ;; ("misc" 14 (1 . 10) (12 . 15)) | |
6019 ;; ("test" 99 (1 . 99)) ...) | |
6020 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6021 (defun gnus-setup-news (&optional rawfile) |
257 | 6022 "Setup news information. |
6023 If optional argument RAWFILE is non-nil, force to read raw startup file." | |
6024 (let ((init (not (and gnus-newsrc-assoc | |
6025 gnus-active-hashtb | |
6026 gnus-unread-hashtb | |
6027 (not rawfile) | |
6028 )))) | |
6029 ;; We have to clear some variables to re-initialize news info. | |
6030 (if init | |
6031 (setq gnus-newsrc-assoc nil | |
6032 gnus-active-hashtb nil | |
6033 gnus-unread-hashtb nil)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6034 (gnus-read-active-file) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6035 ;; Initialize only once. |
257 | 6036 (if init |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6037 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6038 ;; Get distributions only once. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6039 (gnus-read-distributions-file) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6040 ;; 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
|
6041 ;; 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
|
6042 (gnus-read-newsrc-file rawfile) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6043 )) |
257 | 6044 (gnus-expire-marked-articles) |
6045 (gnus-get-unread-articles) | |
6046 ;; Check new newsgroups and subscribe them. | |
6047 (if init | |
6048 (let ((new-newsgroups (gnus-find-new-newsgroups))) | |
6049 (while new-newsgroups | |
6050 (funcall gnus-subscribe-newsgroup-method (car new-newsgroups)) | |
6051 (setq new-newsgroups (cdr new-newsgroups)) | |
6052 ))) | |
6053 )) | |
6054 | |
6055 (defun gnus-add-newsgroup (newsgroup) | |
6056 "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
|
6057 (and (null (gnus-gethash newsgroup gnus-newsrc-hashtb)) ;Really new? |
257 | 6058 (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
|
6059 (gnus-insert-newsgroup (or (gnus-gethash newsgroup gnus-killed-hashtb) |
257 | 6060 (list newsgroup t)) |
6061 (car (car gnus-newsrc-assoc))))) | |
6062 | |
6063 (defun gnus-find-new-newsgroups () | |
6064 "Looking for new newsgroups and return names. | |
6065 `-n' option of options line in .newsrc file is recognized." | |
6066 (let ((group nil) | |
6067 (new-newsgroups nil)) | |
6068 (mapatoms | |
6069 (function | |
6070 (lambda (sym) | |
6071 (setq group (symbol-name sym)) | |
6072 ;; Taking account of `-n' option. | |
6073 (and (or (null gnus-newsrc-options-n-no) | |
6074 (not (string-match gnus-newsrc-options-n-no group)) | |
6075 (and gnus-newsrc-options-n-yes | |
6076 (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
|
6077 (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
|
6078 (null (gnus-gethash group gnus-newsrc-hashtb)) ;Really new. |
257 | 6079 ;; Find new newsgroup. |
6080 (setq new-newsgroups | |
6081 (cons group new-newsgroups))) | |
6082 )) | |
6083 gnus-active-hashtb) | |
6084 ;; Return new newsgroups. | |
6085 new-newsgroups | |
6086 )) | |
6087 | |
6088 (defun gnus-kill-newsgroup (group) | |
6089 "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
|
6090 (let ((info (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 6091 (if (null info) |
6092 nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6093 ;; Delete from gnus-newsrc-assoc and gnus-newsrc-hashtb. |
257 | 6094 (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
|
6095 (gnus-sethash group nil gnus-newsrc-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6096 ;; Add to gnus-killed-assoc and gnus-killed-hashtb. |
257 | 6097 (setq gnus-killed-assoc |
6098 (cons info | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6099 (delq (gnus-gethash group gnus-killed-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6100 gnus-killed-assoc))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6101 (gnus-sethash group info gnus-killed-hashtb) |
257 | 6102 ;; Clear unread hashtable. |
6103 ;; Thanks cwitty@csli.Stanford.EDU (Carl Witty). | |
6104 (gnus-sethash group nil gnus-unread-hashtb) | |
6105 ;; Then delete from .newsrc | |
6106 (gnus-update-newsrc-buffer group 'delete) | |
6107 ;; Return the deleted newsrc entry. | |
6108 info | |
6109 ))) | |
6110 | |
6111 (defun gnus-insert-newsgroup (info &optional next) | |
6112 "Insert newsrc INFO entry before NEXT. | |
6113 If optional argument NEXT is nil, appended to the last." | |
6114 (if (null info) | |
6115 (error "Invalid argument: %s" info)) | |
6116 (let* ((group (car info)) ;Newsgroup name. | |
6117 (range | |
6118 (gnus-difference-of-range | |
6119 (nth 2 (gnus-gethash group gnus-active-hashtb)) (nthcdr 2 info)))) | |
6120 ;; Check duplication. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6121 (if (gnus-gethash group gnus-newsrc-hashtb) |
257 | 6122 (error "Duplicated: %s" group)) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6123 ;; Insert to gnus-newsrc-assoc and gnus-newsrc-hashtb. |
257 | 6124 (if (string-equal next (car (car gnus-newsrc-assoc))) |
6125 (setq gnus-newsrc-assoc | |
6126 (cons info gnus-newsrc-assoc)) | |
6127 (let ((found nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6128 (rest (cdr gnus-newsrc-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6129 (tail gnus-newsrc-assoc)) |
257 | 6130 ;; Seach insertion point. |
6131 (while (and (not found) rest) | |
6132 (if (string-equal next (car (car rest))) | |
6133 (setq found t) | |
6134 (setq rest (cdr rest)) | |
6135 (setq tail (cdr tail)) | |
6136 )) | |
6137 ;; Find it. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6138 (if (consp tail) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6139 (setcdr tail (cons info rest)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6140 ;; gnus-newsrc-assoc must be nil. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6141 (setq gnus-newsrc-assoc |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6142 (append gnus-newsrc-assoc (cons info rest)))) |
257 | 6143 )) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6144 (gnus-sethash group info gnus-newsrc-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6145 ;; Delete from gnus-killed-assoc and gnus-killed-hashtb. |
257 | 6146 (setq gnus-killed-assoc |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6147 (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
|
6148 (gnus-sethash group nil gnus-killed-hashtb) |
257 | 6149 ;; Then insert to .newsrc. |
6150 (gnus-update-newsrc-buffer group nil next) | |
6151 ;; Add to gnus-unread-hashtb. | |
6152 (gnus-sethash group | |
6153 (cons group ;Newsgroup name. | |
6154 (cons (gnus-number-of-articles range) range)) | |
6155 gnus-unread-hashtb) | |
6156 )) | |
6157 | |
6158 (defun gnus-check-killed-newsgroups () | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6159 "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
|
6160 gnus-killed-hashtb is also updated." |
257 | 6161 (let ((group nil) |
6162 (new-killed nil) | |
6163 (old-killed gnus-killed-assoc)) | |
6164 (while old-killed | |
6165 (setq group (car (car old-killed))) | |
6166 (and (or (null gnus-newsrc-options-n-no) | |
6167 (not (string-match gnus-newsrc-options-n-no group)) | |
6168 (and gnus-newsrc-options-n-yes | |
6169 (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
|
6170 (null (gnus-gethash group gnus-newsrc-hashtb)) ;No duplication. |
257 | 6171 ;; Subscribed in options line and not in gnus-newsrc-assoc. |
6172 (setq new-killed | |
6173 (cons (car old-killed) new-killed))) | |
6174 (setq old-killed (cdr old-killed)) | |
6175 ) | |
6176 (setq gnus-killed-assoc (nreverse new-killed)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6177 (setq gnus-killed-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6178 (gnus-make-hashtable-from-alist gnus-killed-assoc)) |
257 | 6179 )) |
6180 | |
6181 (defun gnus-check-bogus-newsgroups (&optional confirm) | |
6182 "Delete bogus newsgroups. | |
6183 If optional argument CONFIRM is non-nil, confirm deletion of newsgroups." | |
6184 (let ((group nil) ;Newsgroup name temporary used. | |
6185 (old-newsrc gnus-newsrc-assoc) | |
6186 (new-newsrc nil) | |
6187 (bogus nil) ;List of bogus newsgroups. | |
6188 (old-killed gnus-killed-assoc) | |
6189 (new-killed nil) | |
6190 (old-marked gnus-marked-assoc) | |
6191 (new-marked nil)) | |
6192 (message "Checking bogus newsgroups...") | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6193 ;; Update gnus-newsrc-assoc and gnus-newsrc-hashtb. |
257 | 6194 (while old-newsrc |
6195 (setq group (car (car old-newsrc))) | |
6196 (if (or (gnus-gethash group gnus-active-hashtb) | |
6197 (and confirm | |
6198 (not (y-or-n-p | |
6199 (format "Delete bogus newsgroup: %s " group))))) | |
6200 ;; Active newsgroup. | |
6201 (setq new-newsrc (cons (car old-newsrc) new-newsrc)) | |
6202 ;; Found a bogus newsgroup. | |
6203 (setq bogus (cons group bogus))) | |
6204 (setq old-newsrc (cdr old-newsrc)) | |
6205 ) | |
6206 (setq gnus-newsrc-assoc (nreverse new-newsrc)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6207 (setq gnus-newsrc-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6208 (gnus-make-hashtable-from-alist gnus-newsrc-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6209 ;; Update gnus-killed-assoc and gnus-killed-hashtb. |
257 | 6210 ;; The killed newsgroups are deleted without any confirmations. |
6211 (while old-killed | |
6212 (setq group (car (car old-killed))) | |
6213 (and (gnus-gethash group gnus-active-hashtb) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6214 (null (gnus-gethash group gnus-newsrc-hashtb)) |
257 | 6215 ;; Active and really killed newsgroup. |
6216 (setq new-killed (cons (car old-killed) new-killed))) | |
6217 (setq old-killed (cdr old-killed)) | |
6218 ) | |
6219 (setq gnus-killed-assoc (nreverse new-killed)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6220 (setq gnus-killed-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6221 (gnus-make-hashtable-from-alist gnus-killed-assoc)) |
257 | 6222 ;; Remove BOGUS from .newsrc file. |
6223 (while bogus | |
6224 (gnus-update-newsrc-buffer (car bogus) 'delete) | |
6225 (setq bogus (cdr bogus))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6226 ;; Update gnus-marked-assoc and gnus-marked-hashtb. |
257 | 6227 (while old-marked |
6228 (setq group (car (car old-marked))) | |
6229 (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
|
6230 (gnus-gethash group gnus-newsrc-hashtb)) ;Not bogus? |
257 | 6231 (setq new-marked (cons (car old-marked) new-marked))) |
6232 (setq old-marked (cdr old-marked))) | |
6233 (setq gnus-marked-assoc new-marked) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6234 (setq gnus-marked-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6235 (gnus-make-hashtable-from-alist gnus-marked-assoc)) |
257 | 6236 (message "Checking bogus newsgroups... done") |
6237 )) | |
6238 | |
6239 (defun gnus-get-unread-articles () | |
6240 "Compute diffs between active and read articles." | |
6241 (let ((read gnus-newsrc-assoc) | |
6242 (group-info nil) | |
6243 (group-name nil) | |
6244 (active nil) | |
6245 (range nil)) | |
6246 (message "Checking new news...") | |
6247 (or gnus-unread-hashtb | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6248 (setq gnus-unread-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6249 (gnus-make-hashtable (length gnus-active-hashtb)))) |
257 | 6250 (while read |
6251 (setq group-info (car read)) ;About one newsgroup | |
6252 (setq group-name (car group-info)) | |
6253 (setq active (nth 2 (gnus-gethash group-name gnus-active-hashtb))) | |
6254 (if (and gnus-octive-hashtb | |
6255 ;; Is nothing changed? | |
6256 (equal active | |
6257 (nth 2 (gnus-gethash group-name gnus-octive-hashtb))) | |
6258 ;; Is this newsgroup in the unread hash table? | |
6259 (gnus-gethash group-name gnus-unread-hashtb) | |
6260 ) | |
6261 nil ;Nothing to do. | |
6262 (setq range (gnus-difference-of-range active (nthcdr 2 group-info))) | |
6263 (gnus-sethash group-name | |
6264 (cons group-name ;Group name | |
6265 (cons (gnus-number-of-articles range) | |
6266 range)) ;Range of unread articles | |
6267 gnus-unread-hashtb) | |
6268 ) | |
6269 (setq read (cdr read)) | |
6270 ) | |
6271 (message "Checking new news... done") | |
6272 )) | |
6273 | |
6274 (defun gnus-expire-marked-articles () | |
6275 "Check expired article which is marked as unread." | |
6276 (let ((marked-assoc gnus-marked-assoc) | |
6277 (updated-assoc nil) | |
6278 (marked nil) ;Current marked info. | |
6279 (articles nil) ;List of marked articles. | |
6280 (updated nil) ;List of real marked. | |
6281 (begin nil)) | |
6282 (while marked-assoc | |
6283 (setq marked (car marked-assoc)) | |
6284 (setq articles (cdr marked)) | |
6285 (setq updated nil) | |
6286 (setq begin | |
6287 (car (nth 2 (gnus-gethash (car marked) gnus-active-hashtb)))) | |
6288 (while (and begin articles) | |
6289 (if (>= (car articles) begin) | |
6290 ;; This article is still active. | |
6291 (setq updated (cons (car articles) updated))) | |
6292 (setq articles (cdr articles))) | |
6293 (if updated | |
6294 (setq updated-assoc | |
6295 (cons (cons (car marked) updated) updated-assoc))) | |
6296 (setq marked-assoc (cdr marked-assoc))) | |
6297 (setq gnus-marked-assoc updated-assoc) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6298 (setq gnus-marked-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6299 (gnus-make-hashtable-from-alist gnus-marked-assoc)) |
257 | 6300 )) |
6301 | |
6302 (defun gnus-mark-as-read-by-xref | |
6303 (group headers unreads &optional subscribed-only) | |
6304 "Mark articles as read using cross references and return updated newsgroups. | |
6305 Arguments are GROUP, HEADERS, UNREADS, and optional SUBSCRIBED-ONLY." | |
6306 (let ((xref-list nil) | |
6307 (header nil) | |
6308 (xrefs nil) ;One Xref: field info. | |
6309 (xref nil) ;(NEWSGROUP . ARTICLE) | |
6310 (gname nil) ;Newsgroup name | |
6311 (article nil)) ;Article number | |
6312 (while headers | |
6313 (setq header (car headers)) | |
6314 (if (memq (nntp-header-number header) unreads) | |
6315 ;; This article is not yet marked as read. | |
6316 nil | |
6317 (setq xrefs (gnus-parse-xref-field (nntp-header-xref header))) | |
6318 ;; For each cross reference info. in one Xref: field. | |
6319 (while xrefs | |
6320 (setq xref (car xrefs)) | |
6321 (setq gname (car xref)) ;Newsgroup name | |
6322 (setq article (cdr xref)) ;Article number | |
6323 (or (string-equal group gname) ;Ignore current newsgroup. | |
6324 ;; Ignore unsubscribed newsgroup if requested. | |
6325 (and subscribed-only | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6326 (not (nth 1 (gnus-gethash gname gnus-newsrc-hashtb)))) |
257 | 6327 ;; Ignore article marked as unread. |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6328 (memq article (cdr (gnus-gethash gname gnus-marked-hashtb))) |
257 | 6329 (let ((group-xref (assoc gname xref-list))) |
6330 (if group-xref | |
6331 (if (memq article (cdr group-xref)) | |
6332 nil ;Alread marked. | |
6333 (setcdr group-xref (cons article (cdr group-xref)))) | |
6334 ;; Create new assoc entry for GROUP. | |
6335 (setq xref-list (cons (list gname article) xref-list))) | |
6336 )) | |
6337 (setq xrefs (cdr xrefs)) | |
6338 )) | |
6339 (setq headers (cdr headers))) | |
6340 ;; Mark cross referenced articles as read. | |
6341 (gnus-mark-xrefed-as-read xref-list) | |
6342 ;;(message "%s %s" (prin1-to-string unreads) (prin1-to-string xref-list)) | |
6343 ;; Return list of updated group name. | |
6344 (mapcar (function car) xref-list) | |
6345 )) | |
6346 | |
6347 (defun gnus-parse-xref-field (xref-value) | |
6348 "Parse Xref: field value, and return list of `(group . article-id)'." | |
6349 (let ((xref-list nil) | |
6350 (xref-value (or xref-value ""))) | |
6351 ;; Remove server host name. | |
6352 (if (string-match "^[ \t]*[^ \t,]+[ \t,]+\\(.*\\)$" xref-value) | |
6353 (setq xref-value (substring xref-value (match-beginning 1))) | |
6354 (setq xref-value nil)) | |
6355 ;; Process each xref info. | |
6356 (while xref-value | |
6357 (if (string-match | |
6358 "^[ \t,]*\\([^ \t,]+\\):\\([0-9]+\\)[^0-9]*" xref-value) | |
6359 (progn | |
6360 (setq xref-list | |
6361 (cons | |
6362 (cons | |
6363 ;; Group name | |
6364 (substring xref-value (match-beginning 1) (match-end 1)) | |
6365 ;; Article-ID | |
6366 (string-to-int | |
6367 (substring xref-value (match-beginning 2) (match-end 2)))) | |
6368 xref-list)) | |
6369 (setq xref-value (substring xref-value (match-end 2)))) | |
6370 (setq xref-value nil))) | |
6371 ;; Return alist. | |
6372 xref-list | |
6373 )) | |
6374 | |
6375 (defun gnus-mark-xrefed-as-read (xrefs) | |
6376 "Update unread article information using XREFS alist." | |
6377 (let ((group nil) | |
6378 (idlist nil) | |
6379 (unread nil)) | |
6380 (while xrefs | |
6381 (setq group (car (car xrefs))) | |
6382 (setq idlist (cdr (car xrefs))) | |
6383 (setq unread (gnus-uncompress-sequence | |
6384 (nthcdr 2 (gnus-gethash group gnus-unread-hashtb)))) | |
6385 (while idlist | |
6386 (setq unread (delq (car idlist) unread)) | |
6387 (setq idlist (cdr idlist))) | |
6388 (gnus-update-unread-articles group unread 'ignore) | |
6389 (setq xrefs (cdr xrefs)) | |
6390 ))) | |
6391 | |
6392 (defun gnus-update-unread-articles (group unread-list marked-list) | |
6393 "Update unread articles of GROUP using UNREAD-LIST and MARKED-LIST." | |
6394 (let ((active (nth 2 (gnus-gethash group gnus-active-hashtb))) | |
6395 (unread (gnus-gethash group gnus-unread-hashtb))) | |
6396 (if (or (null active) (null unread)) | |
6397 ;; Ignore unknown newsgroup. | |
6398 nil | |
6399 ;; Update gnus-unread-hashtb. | |
6400 (if unread-list | |
6401 (setcdr (cdr unread) | |
6402 (gnus-compress-sequence unread-list)) | |
6403 ;; All of the articles are read. | |
6404 (setcdr (cdr unread) '((0 . 0)))) | |
6405 ;; Number of unread articles. | |
6406 (setcar (cdr unread) | |
6407 (gnus-number-of-articles (nthcdr 2 unread))) | |
6408 ;; Update gnus-newsrc-assoc. | |
6409 (if (> (car active) 0) | |
6410 ;; Articles from 1 to N are not active. | |
6411 (setq active (cons 1 (cdr active)))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6412 (setcdr (cdr (gnus-gethash group gnus-newsrc-hashtb)) |
257 | 6413 (gnus-difference-of-range active (nthcdr 2 unread))) |
6414 ;; Update .newsrc buffer. | |
6415 (gnus-update-newsrc-buffer group) | |
6416 ;; Update gnus-marked-assoc. | |
6417 (if (listp marked-list) ;Includes NIL. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6418 (let ((marked (gnus-gethash group gnus-marked-hashtb))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6419 (cond (marked ;There is an entry. |
257 | 6420 (setcdr marked marked-list)) |
6421 (marked-list ;Non-NIL. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6422 (let ((info (cons group marked-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6423 ;; hashtb must share the same cons cell. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6424 (setq gnus-marked-assoc |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6425 (cons info gnus-marked-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6426 (gnus-sethash group info gnus-marked-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6427 )) |
257 | 6428 ))) |
6429 ))) | |
6430 | |
6431 (defun gnus-read-active-file () | |
6432 "Get active file from NNTP server." | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6433 ;; 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
|
6434 (gnus-start-news-server) |
257 | 6435 (message "Reading active file...") |
6436 (if (gnus-request-list) ;Get active file from server | |
6437 (save-excursion | |
6438 (set-buffer nntp-server-buffer) | |
6439 (gnus-active-to-gnus-format) | |
6440 (message "Reading active file... done")) | |
6441 (error "Cannot read active file from NNTP server."))) | |
6442 | |
6443 (defun gnus-active-to-gnus-format () | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6444 "Convert active file format to internal format. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6445 Lines matching gnus-ignored-newsgroups are ignored." |
257 | 6446 ;; Delete unnecessary lines. |
6447 (goto-char (point-min)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6448 ;;(delete-matching-lines "^to\\..*$") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6449 (delete-matching-lines gnus-ignored-newsgroups) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6450 ;; Save OLD active info. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6451 (setq gnus-octive-hashtb gnus-active-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6452 ;; Make large enough hash table. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6453 (setq gnus-active-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6454 (gnus-make-hashtable (count-lines (point-min) (point-max)))) |
257 | 6455 ;; Store active file in hashtable. |
6456 (goto-char (point-min)) | |
6457 (while | |
6458 (re-search-forward | |
6459 "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([ymn]\\).*$" | |
6460 nil t) | |
6461 (gnus-sethash | |
6462 (buffer-substring (match-beginning 1) (match-end 1)) | |
6463 (list (buffer-substring (match-beginning 1) (match-end 1)) | |
6464 (string-equal | |
6465 "y" (buffer-substring (match-beginning 4) (match-end 4))) | |
6466 (cons (string-to-int | |
6467 (buffer-substring (match-beginning 3) (match-end 3))) | |
6468 (string-to-int | |
6469 (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
|
6470 gnus-active-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6471 )) |
257 | 6472 |
6473 (defun gnus-read-newsrc-file (&optional rawfile) | |
6474 "Read startup FILE. | |
6475 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
|
6476 (setq gnus-current-startup-file (gnus-make-newsrc-file gnus-startup-file)) |
257 | 6477 ;; Reset variables which may be included in the quick startup file. |
6478 (let ((variables gnus-variable-list)) | |
6479 (while variables | |
6480 (set (car variables) nil) | |
6481 (setq variables (cdr variables)))) | |
6482 (let* ((newsrc-file gnus-current-startup-file) | |
6483 (quick-file (concat newsrc-file ".el")) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6484 (quick-loaded nil)) |
257 | 6485 (save-excursion |
6486 ;; Prepare .newsrc buffer. | |
6487 (set-buffer (find-file-noselect newsrc-file)) | |
6488 ;; 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
|
6489 ;;(buffer-flush-undo (current-buffer)) |
257 | 6490 ;; Load quick .newsrc to restore gnus-marked-assoc and |
6491 ;; gnus-killed-assoc even if gnus-newsrc-assoc is out of date. | |
6492 (condition-case nil | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6493 (progn |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6494 (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
|
6495 ;; Recreate hashtables. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6496 (setq gnus-killed-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6497 (gnus-make-hashtable-from-alist gnus-killed-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6498 (setq gnus-marked-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6499 (gnus-make-hashtable-from-alist gnus-marked-assoc)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6500 ) |
257 | 6501 (error nil)) |
6502 (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
|
6503 ;; .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
|
6504 ;; 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
|
6505 ;; (on fast machines/disks). |
9eaa2151f7f6
(gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents:
3331
diff
changeset
|
6506 (not (file-newer-than-file-p newsrc-file quick-file)) |
257 | 6507 quick-loaded |
6508 gnus-newsrc-assoc ;Really loaded? | |
6509 ) | |
6510 ;; 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
|
6511 ;; 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
|
6512 ;; So, we have to define the hashtable here. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6513 (setq gnus-newsrc-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6514 (gnus-make-hashtable-from-alist gnus-newsrc-assoc))) |
257 | 6515 (t |
6516 ;; Since .newsrc file is newer than quick file, read it. | |
6517 (message "Reading %s..." newsrc-file) | |
6518 (gnus-newsrc-to-gnus-format) | |
6519 (gnus-check-killed-newsgroups) | |
6520 (message "Reading %s... Done" newsrc-file))) | |
6521 ))) | |
6522 | |
6523 (defun gnus-make-newsrc-file (file) | |
6524 "Make server dependent file name by catenating FILE and server host name." | |
6525 (let* ((file (expand-file-name file nil)) | |
6526 (real-file (concat file "-" gnus-nntp-server))) | |
6527 (if (file-exists-p real-file) | |
6528 real-file file) | |
6529 )) | |
6530 | |
6531 (defun gnus-newsrc-to-gnus-format () | |
6532 "Parse current buffer as .newsrc file." | |
6533 (let ((newsgroup nil) | |
6534 (subscribe nil) | |
6535 (ranges nil) | |
6536 (subrange nil) | |
6537 (read-list nil)) | |
6538 ;; We have to re-initialize these variable (except for | |
6539 ;; gnus-marked-assoc and gnus-killed-assoc) because quick startup | |
6540 ;; file may contain bogus values. | |
6541 (setq gnus-newsrc-options nil) | |
6542 (setq gnus-newsrc-options-n-yes nil) | |
6543 (setq gnus-newsrc-options-n-no nil) | |
6544 (setq gnus-newsrc-assoc nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6545 ;; Make large enough hash table. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6546 (setq gnus-newsrc-hashtb |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6547 (gnus-make-hashtable |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6548 (max (length gnus-active-hashtb) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6549 (count-lines (point-min) (point-max))))) |
257 | 6550 ;; Save options line to variable. |
6551 ;; Lines beginning with white spaces are treated as continuation | |
6552 ;; line. Refer man page of newsrc(5). | |
6553 (goto-char (point-min)) | |
6554 (if (re-search-forward | |
6555 "^[ \t]*options[ \t]*\\(.*\\(\n[ \t]+.*\\)*\\)[ \t]*$" nil t) | |
6556 (progn | |
6557 ;; Save entire options line. | |
6558 (setq gnus-newsrc-options | |
6559 (buffer-substring (match-beginning 1) (match-end 1))) | |
6560 ;; Compile "-n" option. | |
6561 (if (string-match "\\(^\\|[ \t\n]\\)-n" gnus-newsrc-options) | |
6562 (let ((yes-and-no | |
6563 (gnus-parse-n-options | |
6564 (substring gnus-newsrc-options (match-end 0))))) | |
6565 (setq gnus-newsrc-options-n-yes (car yes-and-no)) | |
6566 (setq gnus-newsrc-options-n-no (cdr yes-and-no)) | |
6567 )) | |
6568 )) | |
6569 ;; Parse body of .newsrc file | |
6570 ;; Options line continuation lines must be also considered here. | |
6571 ;; Before supporting continuation lines, " newsgroup ! 1-5" was | |
6572 ;; okay, but now it is invalid. It should be "newsgroup! 1-5". | |
6573 (goto-char (point-min)) | |
6574 ;; Due to overflows in regex.c, change the following regexp: | |
6575 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(.*\\)$" | |
3610
b0c94b723e6a
* gnus.el (gnus-newsrc-to-gnus-format): Change regexp which
Jim Blandy <jimb@redhat.com>
parents:
3591
diff
changeset
|
6576 ;; 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
|
6577 ;; 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
|
6578 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(\\(...\\)*.*\\)$" |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6579 ;; but, the following causes trouble on some case: |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6580 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(\\|[^ \t\n].*\\)$" |
257 | 6581 (while (re-search-forward |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6582 (if (= gnus-emacs-version 18) |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6583 "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(\\(...\\)*.*\\)$" |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6584 "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(.*\\)$") |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6585 nil t) |
257 | 6586 (setq newsgroup (buffer-substring (match-beginning 1) (match-end 1))) |
6587 ;; Check duplications of newsgroups. | |
6588 ;; 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
|
6589 (if (gnus-gethash newsgroup gnus-newsrc-hashtb) |
257 | 6590 (message "Ignore duplicated newsgroup: %s" newsgroup) |
6591 (setq subscribe | |
6592 (string-equal | |
6593 ":" (buffer-substring (match-beginning 2) (match-end 2)))) | |
6594 (setq ranges (buffer-substring (match-beginning 3) (match-end 3))) | |
6595 (setq read-list nil) | |
6596 (while (string-match "^[, \t]*\\([0-9-]+\\)" ranges) | |
6597 (setq subrange (substring ranges (match-beginning 1) (match-end 1))) | |
6598 (setq ranges (substring ranges (match-end 1))) | |
6599 (cond ((string-match "^\\([0-9]+\\)-\\([0-9]+\\)$" subrange) | |
6600 (setq read-list | |
6601 (cons | |
6602 (cons (string-to-int | |
6603 (substring subrange | |
6604 (match-beginning 1) (match-end 1))) | |
6605 (string-to-int | |
6606 (substring subrange | |
6607 (match-beginning 2) (match-end 2)))) | |
6608 read-list))) | |
6609 ((string-match "^[0-9]+$" subrange) | |
6610 (setq read-list | |
6611 (cons (cons (string-to-int subrange) | |
6612 (string-to-int subrange)) | |
6613 read-list))) | |
6614 (t | |
6615 (ding) (message "Ignoring bogus lines of %s" newsgroup) | |
6616 (sit-for 0)) | |
6617 )) | |
6618 (setq gnus-newsrc-assoc | |
6619 (cons (cons newsgroup (cons subscribe (nreverse read-list))) | |
6620 gnus-newsrc-assoc)) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6621 ;; Update gnus-newsrc-hashtb one by one. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6622 (gnus-sethash newsgroup (car gnus-newsrc-assoc) gnus-newsrc-hashtb) |
257 | 6623 )) |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6624 (setq gnus-newsrc-assoc (nreverse gnus-newsrc-assoc)) |
257 | 6625 )) |
6626 | |
6627 (defun gnus-parse-n-options (options) | |
6628 "Parse -n NEWSGROUPS options and return a cons of YES and NO regexps." | |
6629 (let ((yes nil) | |
6630 (no nil) | |
6631 (yes-or-no nil) ;`!' or not. | |
6632 (newsgroup nil)) | |
6633 ;; Parse each newsgroup description such as "comp.all". Commas | |
6634 ;; and white spaces can be a newsgroup separator. | |
6635 (while | |
6636 (string-match "^[ \t\n,]*\\(!?\\)\\([^--- \t\n,][^ \t\n,]*\\)" options) | |
6637 (setq yes-or-no | |
6638 (substring options (match-beginning 1) (match-end 1))) | |
6639 (setq newsgroup | |
6640 (regexp-quote | |
6641 (substring options | |
6642 (match-beginning 2) (match-end 2)))) | |
6643 (setq options (substring options (match-end 2))) | |
6644 ;; Rewrite "all" to ".+" not ".*". ".+" requires at least one | |
6645 ;; character. | |
6646 (while (string-match "\\(^\\|\\\\[.]\\)all\\(\\\\[.]\\|$\\)" newsgroup) | |
6647 (setq newsgroup | |
6648 (concat (substring newsgroup 0 (match-end 1)) | |
6649 ".+" | |
6650 (substring newsgroup (match-beginning 2))))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6651 ;; It is yes or no. |
257 | 6652 (cond ((string-equal yes-or-no "!") |
6653 (setq no (cons newsgroup no))) | |
6654 ((string-equal newsgroup ".+")) ;Ignore `all'. | |
6655 (t | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6656 (setq yes (cons newsgroup yes)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6657 ) |
257 | 6658 ;; 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
|
6659 ;; 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
|
6660 ;; 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
|
6661 ;; "jp.network". |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6662 ;; Fixes for large regexp problems are from yonezu@nak.math.keio.ac.jp. |
257 | 6663 (cons (if yes |
6664 (concat "^\\(" | |
6665 (apply (function concat) | |
6666 (mapcar | |
6667 (function | |
6668 (lambda (newsgroup) | |
6669 (concat newsgroup "\\|"))) | |
6670 (cdr yes))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6671 (car yes) "\\)\\(\\.\\|$\\)")) |
257 | 6672 (if no |
6673 (concat "^\\(" | |
6674 (apply (function concat) | |
6675 (mapcar | |
6676 (function | |
6677 (lambda (newsgroup) | |
6678 (concat newsgroup "\\|"))) | |
6679 (cdr no))) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6680 (car no) "\\)\\(\\.\\|$\\)"))) |
257 | 6681 )) |
6682 | |
6683 (defun gnus-save-newsrc-file () | |
6684 "Save to .newsrc FILE." | |
6685 ;; Note: We cannot save .newsrc file if all newsgroups are removed | |
6686 ;; from the variable gnus-newsrc-assoc. | |
6687 (and (or gnus-newsrc-assoc gnus-killed-assoc) | |
6688 gnus-current-startup-file | |
6689 (save-excursion | |
6690 ;; A buffer containing .newsrc file may be deleted. | |
6691 (set-buffer (find-file-noselect gnus-current-startup-file)) | |
6692 (if (not (buffer-modified-p)) | |
6693 (message "(No changes need to be saved)") | |
6694 (message "Saving %s..." gnus-current-startup-file) | |
6695 (let ((make-backup-files t) | |
6696 (version-control nil) | |
6697 (require-final-newline t)) ;Don't ask even if requested. | |
6698 ;; Make backup file of master newsrc. | |
6699 ;; You can stop or change version control of backup file. | |
6700 ;; Suggested by jason@violet.berkeley.edu. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6701 (run-hooks 'gnus-save-newsrc-hook) |
257 | 6702 (save-buffer)) |
6703 ;; Quickly loadable .newsrc. | |
6704 (set-buffer (get-buffer-create " *GNUS-newsrc*")) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6705 (buffer-flush-undo (current-buffer)) |
257 | 6706 (erase-buffer) |
6707 (gnus-gnus-to-quick-newsrc-format) | |
6708 (let ((make-backup-files nil) | |
6709 (version-control nil) | |
6710 (require-final-newline t)) ;Don't ask even if requested. | |
6711 (write-file (concat gnus-current-startup-file ".el"))) | |
6712 (kill-buffer (current-buffer)) | |
6713 (message "Saving %s... Done" gnus-current-startup-file) | |
6714 )) | |
6715 )) | |
6716 | |
6717 (defun gnus-update-newsrc-buffer (group &optional delete next) | |
6718 "Incrementally update .newsrc buffer about GROUP. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6719 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
|
6720 If optional 2nd argument NEXT is non-nil, inserted before it." |
257 | 6721 (save-excursion |
6722 ;; Taking account of the killed startup file. | |
6723 ;; Suggested by tale@pawl.rpi.edu. | |
6724 (set-buffer (or (get-file-buffer gnus-current-startup-file) | |
6725 (find-file-noselect gnus-current-startup-file))) | |
6726 ;; Options line continuation lines must be also considered here. | |
6727 ;; Before supporting continuation lines, " newsgroup ! 1-5" was | |
6728 ;; okay, but now it is invalid. It should be "newsgroup! 1-5". | |
6729 (let ((deleted nil) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6730 (case-fold-search nil) ;Should NOT ignore case. |
257 | 6731 (buffer-read-only nil)) ;May be not modifiable. |
6732 ;; Delete ALL entries which match for GROUP. | |
6733 (goto-char (point-min)) | |
6734 (while (re-search-forward | |
6735 (concat "^" (regexp-quote group) "[:!]") nil t) | |
6736 (beginning-of-line) | |
6737 (delete-region (point) (progn (forward-line 1) (point))) | |
6738 (setq deleted t) ;Old entry is deleted. | |
6739 ) | |
6740 (if delete | |
6741 nil | |
6742 ;; Insert group entry. | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6743 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb))) |
257 | 6744 (if (null newsrc) |
6745 nil | |
6746 ;; Find insertion point. | |
6747 (cond (deleted nil) ;Insert here. | |
6748 ((and (stringp next) | |
6749 (progn | |
6750 (goto-char (point-min)) | |
6751 (re-search-forward | |
6752 (concat "^" (regexp-quote next) "[:!]") nil t))) | |
6753 (beginning-of-line)) | |
6754 (t | |
6755 (goto-char (point-max)) | |
6756 (or (bolp) | |
6757 (insert "\n")))) | |
6758 ;; Insert after options line. | |
6759 (if (looking-at "^[ \t]*options\\([ \t]\\|$\\)") | |
6760 (progn | |
6761 (forward-line 1) | |
6762 ;; Skip continuation lines. | |
6763 (while (and (not (eobp)) | |
6764 (looking-at "^[ \t]+")) | |
6765 (forward-line 1)))) | |
6766 (insert group ;Group name | |
6767 (if (nth 1 newsrc) ": " "! ")) ;Subscribed? | |
6768 (gnus-ranges-to-newsrc-format (nthcdr 2 newsrc)) ;Read articles | |
6769 (insert "\n") | |
6770 ))) | |
6771 ))) | |
6772 | |
6773 (defun gnus-gnus-to-quick-newsrc-format () | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6774 "Insert GNUS variables such as gnus-newsrc-assoc in lisp format." |
257 | 6775 (insert ";; GNUS internal format of .newsrc.\n") |
6776 (insert ";; Touch .newsrc instead if you think to remove this file.\n") | |
6777 (let ((variable nil) | |
6778 (variables gnus-variable-list) | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6779 ;; Temporary rebind to make changes |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6780 ;; gnus-check-killed-newsgroups in invisible. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6781 (gnus-killed-assoc gnus-killed-assoc) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6782 (gnus-killed-hashtb gnus-killed-hashtb)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6783 ;; Remove duplicated or unsubscribed newsgroups in |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6784 ;; gnus-killed-assoc (and gnus-killed-hashtb). |
257 | 6785 (gnus-check-killed-newsgroups) |
6786 ;; Then, insert lisp expressions. | |
6787 (while variables | |
6788 (setq variable (car variables)) | |
6789 (and (boundp variable) | |
6790 (symbol-value variable) | |
6791 (insert "(setq " (symbol-name variable) " '" | |
6792 (prin1-to-string (symbol-value variable)) | |
6793 ")\n")) | |
6794 (setq variables (cdr variables))) | |
6795 )) | |
6796 | |
6797 (defun gnus-ranges-to-newsrc-format (ranges) | |
6798 "Insert ranges of read articles." | |
6799 (let ((range nil)) ;Range is a pair of BEGIN and END. | |
6800 (while ranges | |
6801 (setq range (car ranges)) | |
6802 (setq ranges (cdr ranges)) | |
6803 (cond ((= (car range) (cdr range)) | |
6804 (if (= (car range) 0) | |
6805 (setq ranges nil) ;No unread articles. | |
6806 (insert (int-to-string (car range))) | |
6807 (if ranges (insert ",")) | |
6808 )) | |
6809 (t | |
6810 (insert (int-to-string (car range)) | |
6811 "-" | |
6812 (int-to-string (cdr range))) | |
6813 (if ranges (insert ",")) | |
6814 )) | |
6815 ))) | |
6816 | |
6817 (defun gnus-compress-sequence (numbers) | |
6818 "Convert list of sorted numbers to ranges." | |
6819 (let* ((numbers (sort (copy-sequence numbers) (function <))) | |
6820 (first (car numbers)) | |
6821 (last (car numbers)) | |
6822 (result nil)) | |
6823 (while numbers | |
6824 (cond ((= last (car numbers)) nil) ;Omit duplicated number | |
6825 ((= (1+ last) (car numbers)) ;Still in sequence | |
6826 (setq last (car numbers))) | |
6827 (t ;End of one sequence | |
6828 (setq result (cons (cons first last) result)) | |
6829 (setq first (car numbers)) | |
6830 (setq last (car numbers))) | |
6831 ) | |
6832 (setq numbers (cdr numbers)) | |
6833 ) | |
6834 (nreverse (cons (cons first last) result)) | |
6835 )) | |
6836 | |
6837 (defun gnus-uncompress-sequence (ranges) | |
6838 "Expand compressed format of sequence." | |
6839 (let ((first nil) | |
6840 (last nil) | |
6841 (result nil)) | |
6842 (while ranges | |
6843 (setq first (car (car ranges))) | |
6844 (setq last (cdr (car ranges))) | |
6845 (while (< first last) | |
6846 (setq result (cons first result)) | |
6847 (setq first (1+ first))) | |
6848 (setq result (cons first result)) | |
6849 (setq ranges (cdr ranges)) | |
6850 ) | |
6851 (nreverse result) | |
6852 )) | |
6853 | |
6854 (defun gnus-number-of-articles (range) | |
6855 "Compute number of articles from RANGE `((beg1 . end1) (beg2 . end2) ...)'." | |
6856 (let ((count 0)) | |
6857 (while range | |
6858 (if (/= (cdr (car range)) 0) | |
6859 ;; If end1 is 0, it must be skipped. Usually no articles in | |
6860 ;; this group. | |
6861 (setq count (+ count 1 (- (cdr (car range)) (car (car range)))))) | |
6862 (setq range (cdr range)) | |
6863 ) | |
6864 count ;Result | |
6865 )) | |
6866 | |
6867 (defun gnus-difference-of-range (src obj) | |
6868 "Compute (SRC - OBJ) on range. | |
6869 Range of SRC is expressed as `(beg . end)'. | |
6870 Range of OBJ is expressed as `((beg1 . end1) (beg2 . end2) ...)." | |
6871 (let ((beg (car src)) | |
6872 (end (cdr src)) | |
6873 (range nil)) ;This is result. | |
6874 ;; Src may be nil. | |
6875 (while (and src obj) | |
6876 (let ((beg1 (car (car obj))) | |
6877 (end1 (cdr (car obj)))) | |
6878 (cond ((> beg end) | |
6879 (setq obj nil)) ;Terminate loop | |
6880 ((< beg beg1) | |
6881 (setq range (cons (cons beg (min (1- beg1) end)) range)) | |
6882 (setq beg (1+ end1))) | |
6883 ((>= beg beg1) | |
6884 (setq beg (max beg (1+ end1)))) | |
6885 ) | |
6886 (setq obj (cdr obj)) ;Next OBJ | |
6887 )) | |
6888 ;; Src may be nil. | |
6889 (if (and src (<= beg end)) | |
6890 (setq range (cons (cons beg end) range))) | |
6891 ;; Result | |
6892 (if range | |
6893 (nreverse range) | |
6894 (list (cons 0 0))) | |
6895 )) | |
6896 | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6897 (defun gnus-read-distributions-file () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6898 "Get distributions file from NNTP server (NNTP2 functionality)." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6899 ;; 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
|
6900 (gnus-start-news-server) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6901 (message "Reading distributions file...") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6902 (setq gnus-distribution-list nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6903 (if (gnus-request-list-distributions) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6904 (save-excursion |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6905 (set-buffer nntp-server-buffer) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6906 (gnus-distributions-to-gnus-format) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6907 (message "Reading distributions file... done")) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6908 ;; It's not a fatal error. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6909 ;;(error "Cannot read distributions file from NNTP server.") |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6910 ) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6911 ;; Merge with user supplied default distributions. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6912 (let ((defaults (reverse gnus-local-distributions)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6913 (dist nil)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6914 (while defaults |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6915 (setq dist (assoc (car defaults) gnus-distribution-list)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6916 (if dist |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6917 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6918 (delq dist gnus-distribution-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6919 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6920 (cons (list (car defaults)) gnus-distribution-list)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6921 (setq defaults (cdr defaults)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6922 ))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6923 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6924 (defun gnus-distributions-to-gnus-format () |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6925 "Convert distributions file format to internal format." |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6926 (setq gnus-distribution-list nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6927 (goto-char (point-min)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6928 (while (re-search-forward "^\\([^ \t\n]+\\).*$" nil t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6929 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6930 (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
|
6931 gnus-distribution-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6932 (setq gnus-distribution-list |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6933 (nreverse gnus-distribution-list))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6934 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6935 ;; 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
|
6936 ;; `file-newer-than-file-p'. |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6937 |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6938 (or (fboundp 'file-newer-than-file-p) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6939 (defun file-newer-than-file-p (file1 file2) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6940 "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
|
6941 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
|
6942 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
|
6943 (let ((mod1 (nth 5 (file-attributes file1))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6944 (mod2 (nth 5 (file-attributes file2)))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6945 (cond ((not (file-exists-p file1)) nil) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6946 ((not (file-exists-p file2)) t) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6947 ((and mod2 mod1) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6948 (or (< (car mod2) (car mod1)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6949 (and (= (car mod2) (car mod1)) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6950 (<= (nth 1 mod2) (nth 1 mod1))))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6951 )))) |
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6952 |
257 | 6953 |
6954 ;;Local variables: | |
2843
cd90d49526ae
Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents:
1821
diff
changeset
|
6955 ;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1) |
257 | 6956 ;;end: |
4173
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6957 |
2b3fb8d12918
(gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
4118
diff
changeset
|
6958 ;;; gnus.el ends here |