annotate lisp/=gnus.el @ 11567:bcf841745ef2

(vi-switch-mode, vi-back-to-old-mode): Use force-mode-line-update. (vi-mode, vi-goto-insert-state): Use force-mode-line-update.
author Karl Heuer <kwzh@gnu.org>
date Tue, 25 Apr 1995 22:24:14 +0000
parents 4d2a2fe1d8d7
children e1f527e99a2f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9550
5b91f8657de6 (gnus-group-group-name): Get rid of text properties.
Richard M. Stallman <rms@gnu.org>
parents: 8523
diff changeset
1 ;;; gnus.el --- NNTP-based News Reader for GNU Emacs
11234
4d2a2fe1d8d7 Update copyright.
Karl Heuer <kwzh@gnu.org>
parents: 10542
diff changeset
2 ;; Copyright (C) 1987,88,89,90,93,94,95 Free Software Foundation, Inc.
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
3
4317
267b027a8692 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 4173
diff changeset
4 ;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
5 ;; Keywords: news
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 716
diff changeset
6
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8
711
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
9 ;; GNU Emacs is free software; you can redistribute it and/or modify
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 716
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
711
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
12 ;; any later version.
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
13
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
711
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
17 ;; GNU General Public License for more details.
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
18
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
19 ;; You should have received a copy of the GNU General Public License
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
22b98190b7ef *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
21 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 716
diff changeset
23 ;;; Commentary:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 716
diff changeset
24
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
25 ;; How to Install GNUS:
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
26 ;; (0) First of all, remove GNUS related OLD *.elc files (at least
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
27 ;; nntp.elc).
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
28 ;; (1) Unshar gnus.el, gnuspost.el, gnusmail.el, gnusmisc.el, and
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
29 ;; nntp.el.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
30 ;; (2) byte-compile-file nntp.el, gnus.el, gnuspost.el, gnusmail.el,
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
31 ;; and gnusmisc.el. If you have a local news spool,
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
32 ;; byte-compile-file nnspool.el, too.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
33 ;; (3) Define three environment variables in .login file as follows:
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
34 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
35 ;; setenv NNTPSERVER flab
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
36 ;; setenv DOMAINNAME "stars.flab.Fujitsu.CO.JP"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
37 ;; setenv ORGANIZATION "Fujitsu Laboratories Ltd., Kawasaki, Japan."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
38 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
39 ;; Or instead, define lisp variables in your .emacs, site-init.el,
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
40 ;; or default.el as follows:
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
41 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
42 ;; (setq gnus-nntp-server "flab")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
43 ;; (setq gnus-local-domain "stars.flab.Fujitsu.CO.JP")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
44 ;; (setq gnus-local-organization "Fujitsu Laboratories Ltd., ...")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
45 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
46 ;; If the function (system-name) returns the full internet name,
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
47 ;; you don't have to define the domain.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
48 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
49 ;; (4) You may have to define NNTP service name as number 119.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
50 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
51 ;; (setq gnus-nntp-service 119)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
52 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
53 ;; Or, if you'd like to use a local news spool directly in stead
10177
6270254bfd9a Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 10073
diff changeset
54 ;; of NNTP, set the variable to nil as follows:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
55 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
56 ;; (setq gnus-nntp-service nil)
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 ;; (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
59 ;; define the variable as follows:
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
60 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
61 ;; (setq gnus-use-generic-from t)
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 ;; (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
64 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
65 ;; (autoload 'gnus "gnus" "Read network news." t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
66 ;; (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
67 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
68 ;; (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
69 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
70 ;; (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
71 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
72 ;; 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
73 ;; private directory using GNUS.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
74 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
75 ;; 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
76 ;; 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
77 ;; communicating with NNTP server inside Emacs.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
78 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
79 ;; (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
80 ;;
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
81 ;; 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
82 ;; 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
83 ;; variable gnus-info-directory to that directory.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 ;;
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
85 ;; 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
86 ;; gnu.emacs.gnus.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 ;; TO DO:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 ;; (1) Incremental update of active info.
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
90 ;; (2) Asynchronous transmission of large messages.
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
91
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
92 ;;; Code:
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 (require 'nntp)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 (require 'mail-utils)
8470
999e5521d05a Require timezone when loading this file.
Richard M. Stallman <rms@gnu.org>
parents: 8444
diff changeset
96 (require 'timezone)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
98 (defvar gnus-default-nntp-server nil
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
99 "*Specify default NNTP server.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
100 This variable should be defined in `site-init.el'.")
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
101
3331
3ab36486eede (gnus-nntp-server): Use gnus-default-nntp-server.
Richard M. Stallman <rms@gnu.org>
parents: 2845
diff changeset
102 (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
103 "*The name of the host running NNTP server.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
104 If it is a string starting with a colon, as in as `:DIRECTORY', then the
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
105 directory ~/DIRECTORY is used as the news spool.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
106 This variable is initialized from the NNTPSERVER environment variable
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
107 or from `gnus-default-nntp-server'.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108
716
f11e7af7c0d9 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 711
diff changeset
109 (defvar gnus-nntp-service "nntp"
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
110 "*NNTP service name (\"nntp\" or 119).
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
111 Go to a local news spool if its value is nil.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
112
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
113 (defvar gnus-startup-file "~/.newsrc"
4321
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
114 "*Your `.newsrc' file. Use `.newsrc-SERVER' instead if exists.")
716
f11e7af7c0d9 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 711
diff changeset
115
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 (defvar gnus-signature-file "~/.signature"
4321
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
117 "*Your `.signature' file. Use `.signature-DISTRIBUTION' instead if exists.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119 (defvar gnus-use-cross-reference t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
120 "*Specifies what to do with cross references (Xref: field).
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
121 If nil, ignore cross references. If t, mark articles as read in
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
122 subscribed newsgroups. Otherwise, if not nil nor t, mark articles as
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
123 read in all newsgroups.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 (defvar gnus-use-followup-to t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 "*Specifies what to do with Followup-To: field.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
127 If nil, ignore `Followup-to:' field. If t, use its value except for
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3496
diff changeset
128 `poster'. Otherwise, if not nil nor t, always use its value.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 (defvar gnus-large-newsgroup 50
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 "*The number of articles which indicates a large newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 If the number of articles in a newsgroup is greater than the value,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 confirmation is required for selecting the newsgroup.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 (defvar gnus-author-copy (getenv "AUTHORCOPY")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
136 "*File name saving a copy of an article posted using FCC: field.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 Initialized from the AUTHORCOPY environment variable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 Articles are saved using a function specified by the the variable
4321
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
140 `gnus-author-copy-saver' (`rmail-output' is default) if a file name is
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
141 given. Instead, if the first character of the name is `|', the
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
142 contents of the article is piped out to the named program. It is
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 possible to save an article in an MH folder as follows:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144
7639
67b7d1ea7b2e Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 7573
diff changeset
145 \(setq gnus-author-copy \"|/usr/local/lib/mh/rcvstore +Article\")")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 (defvar gnus-author-copy-saver (function rmail-output)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 "*A function called with a file name to save an author copy to.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
149 The default function is `rmail-output' which saves in inbox format.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 (defvar gnus-use-long-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 (not (memq system-type '(usg-unix-v xenix)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
153 "*Non-nil means that a newsgroup name is used as a default file name
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
154 to save articles to. If it's nil, the directory form of a newsgroup is
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 used instead.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 (defvar gnus-article-save-directory (getenv "SAVEDIR")
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
158 "*A directory name to save articles to (default is `~/News').
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 Initialized from the SAVEDIR environment variable.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160
8439
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
161 (defvar gnus-kill-files-directory (getenv "SAVEDIR")
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
162 "*A directory name to save kill files to (default to ~/News).
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
163 Initialized from the SAVEDIR environment variable.")
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
164
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
165 (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
166 "*A function to save articles in your favorite format.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 The function must be interactively callable (in other words, it must
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 be an Emacs command).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 GNUS provides the following functions:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
171 gnus-summary-save-in-rmail (in Rmail format)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
172 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
173 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
174 gnus-summary-save-in-file (in article format).")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 (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
177 "*A function generating a file name to save articles in Rmail format.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 (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
181 "*A function generating a file name to save articles in Unix mail format.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184 (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
185 "*A function generating a file name to save articles in MH folder.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 (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
189 "*A function generating a file name to save articles in article format.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
190 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 (defvar gnus-kill-file-name "KILL"
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
193 "*File name of a KILL file.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
194
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
195 (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
196 "*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
197 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
198 or your confirmations may be required.")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
199
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
200 (defvar gnus-interactive-catchup t
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
201 "*Require your confirmation when catching up a newsgroup if non-nil.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
202
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
203 (defvar gnus-interactive-post t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
204 "*Newsgroup, subject, and distribution will be asked for if non-nil.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
205
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
206 (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
207 "*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
208
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 (defvar gnus-user-login-name nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
210 "*The login name of the user.
5911
cfd1fc2b1c7b (gnus-user-login-name): Fix doc string.
Karl Heuer <kwzh@gnu.org>
parents: 5510
diff changeset
211 Got from the function `user-login-name' if undefined.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 (defvar gnus-user-full-name nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
214 "*The full name of the user.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
215 Got from the NAME environment variable if undefined.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
216
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
217 (defvar gnus-show-mime nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
218 "*Show MIME message if non-nil.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
220 (defvar gnus-show-threads t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
221 "*Show conversation threads in Summary Mode if non-nil.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
222
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
223 (defvar gnus-thread-hide-subject t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
224 "*Non-nil means hide subjects for thread subtrees.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
225
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
226 (defvar gnus-thread-hide-subtree nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
227 "*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
228 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
229 hand or by using `gnus-select-article-hook' to show hidden threads.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
230
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
231 (defvar gnus-thread-hide-killed t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
232 "*Non-nil means hide killed thread subtrees automatically.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
233
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
234 (defvar gnus-thread-ignore-subject nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
235 "*Don't take care of subject differences, but only references if non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236 If it is non-nil, some commands work with subjects do not work properly.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
237
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
238 (defvar gnus-thread-indent-level 4
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
239 "*Indentation of thread subtrees.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
240
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
241 (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
242 "*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
243 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
244 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
245 thus making them effectively invisible.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
246
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
247 (defvar gnus-ignored-headers
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
248 "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:"
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
249 "*Header fields not worth displaying.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
250 Ordinarily GNUS excludes these when displaying an article.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
251 If you want to see them, ask to see the message with \"the full header\"
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
252 \(also known as \"the original header\").")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
253
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
254 (defvar gnus-required-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
255 '(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
256 "*All required fields for articles you post.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
257 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
258 and Path fields. Organization, Distribution and Lines are optional.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
259 If you want GNUS not to insert some field, remove it from this list.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
260
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
261 (defvar gnus-show-all-headers nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
262 "*Show all headers of an article if non-nil.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
263
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
264 (defvar gnus-save-all-headers t
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
265 "*Save all headers of an article if non-nil.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
266
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
267 (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
268 "*A function generating a optional string displayed in GNUS Summary
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
269 mode buffer. The function is called with an article HEADER. The
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
270 result must be a string excluding `[' and `]'.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
271
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
272 (defvar gnus-auto-extend-newsgroup t
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3496
diff changeset
273 "*Extend visible articles to forward and backward if non-nil.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
274
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
275 (defvar gnus-auto-select-first t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
276 "*Select the first unread article automagically if non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
277 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
278 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
279 or `gnus-apply-kill-hook'.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
280
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
281 (defvar gnus-auto-select-next t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
282 "*Select the next newsgroup automagically if non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
283 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
284 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
285 nor t, GNUS will select the following unread newsgroup. Especially, if
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
286 the value is the symbol `quietly', the next unread newsgroup will be
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
287 selected without any confirmations.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
288
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
289 (defvar gnus-auto-select-same nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
290 "*Select the next article with the same subject automagically if non-nil.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
291
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
292 (defvar gnus-auto-center-summary t
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
293 "*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
294
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
295 (defvar gnus-auto-mail-to-author nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
296 "*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
297 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
298 `gnus-mail-send-method'.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
299
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
300 (defvar gnus-break-pages t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
301 "*Break an article into pages if non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
302 Page delimiter is specified by the variable `gnus-page-delimiter'.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
303
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
304 (defvar gnus-page-delimiter "^\^L"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
305 "*Regexp describing line-beginnings that separate pages of news article.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
306
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
307 (defvar gnus-digest-show-summary t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
308 "*Show a summary of undigestified messages if non-nil.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
309
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
310 (defvar gnus-digest-separator "^Subject:[ \t]"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
311 "*Regexp that separates messages in a digest article.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
312
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
313 (defvar gnus-use-full-window t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
314 "*Non-nil means to take up the entire screen of Emacs.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
315
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
316 (defvar gnus-window-configuration
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
317 '((summary (0 1 0))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
318 (newsgroups (1 0 0))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
319 (article (0 3 10)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
320 "*Specify window configurations for each action.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
321 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
322 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
323 respectively. ACTION is `summary', `newsgroups', or `article'.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
324
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
325 (defvar gnus-show-mime-method (function metamail-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
326 "*Function to process a MIME message.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
327 The function is expected to process current buffer as a MIME message.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
328
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
329 (defvar gnus-mail-reply-method
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
330 (function gnus-mail-reply-using-mail)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
331 "*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
332 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
333 program. The function `gnus-mail-reply-using-mhe' uses the MH-E mail
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
334 program. You can use yet another program by customizing this variable.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
335
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
336 (defvar gnus-mail-forward-method
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
337 (function gnus-mail-forward-using-mail)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
338 "*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
339 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
340 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
341
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
342 (defvar gnus-mail-other-window-method
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
343 (function gnus-mail-other-window-using-mail)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
344 "*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
345 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
346 mail program. The function `gnus-mail-other-window-using-mhe' uses the MH-E
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
347 mail program. You can use yet another program by customizing this variable.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
348
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
349 (defvar gnus-mail-send-method send-mail-function
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
350 "*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
351 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
352 the variable `send-mail-function'.")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
353
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
354 (defvar gnus-subscribe-newsgroup-method
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
355 (function gnus-subscribe-alphabetically)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
356 "*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
357 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
358 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
359 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
360 `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
361 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
362
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
363 (defvar gnus-group-mode-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
364 "*A hook for GNUS Group Mode.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
365
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
366 (defvar gnus-summary-mode-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
367 "*A hook for GNUS Summary Mode.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
368
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
369 (defvar gnus-article-mode-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
370 "*A hook for GNUS Article Mode.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
371
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
372 (defvar gnus-kill-file-mode-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
373 "*A hook for GNUS KILL File Mode.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
374
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
375 (defvar gnus-open-server-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
376 "*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
377
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
378 (defvar gnus-startup-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
379 "*A hook called at start up time.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
380 This hook is called after GNUS is connected to the NNTP server. So, it
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
381 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
382 NNTP server.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
383
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
384 (defvar gnus-group-prepare-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
385 "*A hook called after newsgroup list is created in the Newsgroup buffer.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
386 If you want to modify the Newsgroup buffer, you can use this hook.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
387
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
388 (defvar gnus-summary-prepare-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
389 "*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
390 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
391
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
392 (defvar gnus-article-prepare-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
393 "*A hook called after an article is prepared in the Article buffer.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
394 If you want to run a special decoding program like nkf, use this hook.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
395
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
396 (defvar gnus-select-group-hook nil
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
397 "*A hook called when a newsgroup is selected.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
398 If you want to sort Summary buffer by date and then by subject, you
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
399 can use the following hook:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
400
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
401 \(add-hook 'gnus-select-group-hook
4321
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
402 (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
403 (lambda ()
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
404 ;; 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
405 (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
406 (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
407 (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
408 (lambda (a)
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
409 (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
410 ;; 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
411 ;; 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
412 (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
413 (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
414 (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
415 (lambda (a)
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
416 (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
417 (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
418 (gnus-simplify-subject (gnus-header-subject a) t)))))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
419 )))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
420
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
421 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
422 `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
423 following hook:
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
424
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
425 \(add-hook 'gnus-select-group-hook
4321
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
426 (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
427 (lambda ()
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
428 (mapcar (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
429 (lambda (header)
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
430 (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
431 header
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
432 (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
433 (gnus-header-subject header) 're-only))))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
434 gnus-newsgroup-headers))))
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
435
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
436 In some newsgroups author name is meaningless. It is possible to
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
437 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
438
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
439 \(add-hook 'gnus-select-group-hook
4321
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
440 (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
441 (lambda ()
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
442 (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
443 (setq gnus-optional-headers
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
444 (function gnus-optional-lines)))
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
445 (t
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
446 (setq gnus-optional-headers
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
447 (function gnus-optional-lines-and-from)))))))")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
448
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
449 (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
450 '(gnus-summary-show-thread)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
451 "*A hook called when an article is selected.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
452 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
453 article automatically using `gnus-summary-show-thread'.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
454
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
455 If you'd like to run Rmail on a digest article automagically, you can
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
456 use the following hook:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
457
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
458 \(add-hook '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
459 (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
460 (lambda ()
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)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
467 ))))
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
468 t)")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
469
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
470 (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
471 (list
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
472 (function
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
473 (lambda ()
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
474 ;; 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
475 (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
476 (progn
2eb6fe350374 (gnus-apply-kill-hook): Make default value a list of functions.
Richard M. Stallman <rms@gnu.org>
parents: 4317
diff changeset
477 (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
478 (insert (gnus-fetch-field "From")))))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
479 "*A hook called when reading digest messages using Rmail.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
480 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
481 \(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
482
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
483 \(add-hook '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
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\")
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
494 This hook is intended to customize Rmail mode for reading digest articles.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
502 newsgroups, I recommend you to use a lighter hook function. For
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
503 example, if you'd like to apply a KILL file to articles which contains
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
504 a string `rmgroup' in subject in newsgroup `control', you can use the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
505 following hook:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
526 If you'd like to mark as unread (-) instead, use the following hook:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
548 long time, set the variable `gnus-use-cross-reference' to nil. This
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
549 inhibits marking articles as read using cross-reference information.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
560
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
561
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
562 ;; Site dependent variables. You have to define these variables in
2843
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
583 The `ORGANIZATION' environment variable is used instead if defined.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
590 (defvar gnus-use-generic-from nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
591 "*If nil, prepend local host name to the defined domain in the From:
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
592 field; if a string, use this; if non-nil, strip of the local host name.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
593
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
594 (defvar gnus-use-generic-path nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
595 "*If nil, use the NNTP server name in the Path: field; if stringp,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
596 use this; if non-nil, use no host name (user name only)")
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
597
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
598 (defvar gnus-newsgroups-regex "^\\([^ \t\n]+\\)[ \t]+\\(.*\\)$"
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
599 "Regex to retrieve the group name and the group description from
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
600 the output of the newsgroups listing.
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
601
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
602 If you have ^M at the end of lines try \"^\\([^ \t\n]+\\)[ \t]+\\([^\r]+\\)[\r]*$\"")
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
603
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
604 (defvar gnus-newsgroups-display t
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
605 "*display the newsgroup description in *Newsgroup* buffer if not nil")
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
606
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
607 (defvar gnus-newsgroups-alist nil
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
608 "alist (groupname . description)")
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
609
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
610 (defvar gnus-newsgroups-hashtb nil
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
611 "hashtable of gnus-newsgroups-alist")
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
612
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
613 (defvar gnus-newsgroups-showall nil
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
614 "non nil if we display all the groups")
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
615
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
616
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
617 ;; Internal variables.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
618
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
619 (defconst gnus-version "GNUS 4.1"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
620 "Version numbers of this version of GNUS.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
621
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
622 (defconst gnus-emacs-version
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
623 (progn
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
624 (string-match "[0-9]*" emacs-version)
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
625 (string-to-int (substring emacs-version
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
626 (match-beginning 0) (match-end 0))))
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
627 "Major version number of this emacs.")
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
628
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
629 (defvar gnus-info-nodes
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
630 '((gnus-group-mode "(gnus)Newsgroup Commands")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
631 (gnus-summary-mode "(gnus)Summary Commands")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
632 (gnus-article-mode "(gnus)Article Commands")
4118
4248276b1113 (gnus-info-nodes): Update node names.
Richard M. Stallman <rms@gnu.org>
parents: 3922
diff changeset
633 (gnus-kill-file-mode "(gnus)Kill File")
4248276b1113 (gnus-info-nodes): Update node names.
Richard M. Stallman <rms@gnu.org>
parents: 3922
diff changeset
634 (gnus-browse-killed-mode "(gnus)Maintaining Subscriptions"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
635 "Assoc list of major modes and related Info nodes.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
636
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
637 ;; Alist syntax is different from that of 3.14.3.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
638 (defvar gnus-access-methods
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
639 '((nntp
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
640 (gnus-retrieve-headers nntp-retrieve-headers)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
641 (gnus-open-server nntp-open-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
642 (gnus-close-server nntp-close-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
643 (gnus-server-opened nntp-server-opened)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
644 (gnus-status-message nntp-status-message)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
645 (gnus-request-article nntp-request-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
646 (gnus-request-group nntp-request-group)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
647 (gnus-request-list nntp-request-list)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
648 (gnus-request-list-newsgroups nntp-request-list-newsgroups)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
649 (gnus-request-list-distributions nntp-request-list-distributions)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
650 (gnus-request-post nntp-request-post))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
651 (nnspool
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
652 (gnus-retrieve-headers nnspool-retrieve-headers)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
653 (gnus-open-server nnspool-open-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
654 (gnus-close-server nnspool-close-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
655 (gnus-server-opened nnspool-server-opened)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
656 (gnus-status-message nnspool-status-message)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
657 (gnus-request-article nnspool-request-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
658 (gnus-request-group nnspool-request-group)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
659 (gnus-request-list nnspool-request-list)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
660 (gnus-request-list-newsgroups nnspool-request-list-newsgroups)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
661 (gnus-request-list-distributions nnspool-request-list-distributions)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
662 (gnus-request-post nnspool-request-post))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
663 (mhspool
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
664 (gnus-retrieve-headers mhspool-retrieve-headers)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
665 (gnus-open-server mhspool-open-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
666 (gnus-close-server mhspool-close-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
667 (gnus-server-opened mhspool-server-opened)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
668 (gnus-status-message mhspool-status-message)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
669 (gnus-request-article mhspool-request-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
670 (gnus-request-group mhspool-request-group)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
671 (gnus-request-list mhspool-request-list)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
672 (gnus-request-list-newsgroups mhspool-request-list-newsgroups)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
673 (gnus-request-list-distributions mhspool-request-list-distributions)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
674 (gnus-request-post mhspool-request-post)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
675 "Access method for NNTP, nnspool, and mhspool.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
676
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
677 (defvar gnus-group-buffer "*Newsgroup*")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
678 (defvar gnus-summary-buffer "*Summary*")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
679 (defvar gnus-article-buffer "*Article*")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
680 (defvar gnus-digest-buffer "GNUS Digest")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
681 (defvar gnus-digest-summary-buffer "GNUS Digest-summary")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
682
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
683 (defvar gnus-buffer-list
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
684 (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
685 gnus-digest-buffer gnus-digest-summary-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
686 "GNUS buffer names which should be killed when exiting.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
687
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
688 (defvar gnus-variable-list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
689 '(gnus-newsrc-options
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
690 gnus-newsrc-options-n-yes gnus-newsrc-options-n-no
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
691 gnus-newsrc-assoc gnus-killed-assoc gnus-marked-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
692 "GNUS variables saved in the quick startup file.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
693
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
694 (defvar gnus-overload-functions
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
695 '((news-inews gnus-inews-news "rnewspost")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
696 (caesar-region gnus-caesar-region "rnews"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
697 "Functions overloaded by gnus.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
698 It is a list of `(original overload &optional file)'.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
699
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
700 (defvar gnus-distribution-list nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
701
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
702 (defvar gnus-newsrc-options nil
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
703 "Options line in the `.newsrc' file.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
704
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
705 (defvar gnus-newsrc-options-n-yes nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
706 "Regexp representing subscribed newsgroups.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
707
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
708 (defvar gnus-newsrc-options-n-no nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
709 "Regexp representing unsubscribed newsgroups.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
710
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
711 (defvar gnus-newsrc-assoc nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
712 "Assoc list of read articles.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
713 `gnus-newsrc-hashtb' should be kept so that both hold the same information.")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
714
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
715 (defvar gnus-newsrc-hashtb nil
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
716 "Hashtable of `gnus-newsrc-assoc'.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
717
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
718 (defvar gnus-killed-assoc nil
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
719 "Assoc list of newsgroups removed from `gnus-newsrc-assoc'.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
720 `gnus-killed-hashtb' should be kept so that both hold the same information.")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
721
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
722 (defvar gnus-killed-hashtb nil
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
723 "Hashtable of `gnus-killed-assoc'.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
724
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
725 (defvar gnus-marked-assoc nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
726 "Assoc list of articles marked as unread.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
727 `gnus-marked-hashtb' should be kept so that both hold the same information.")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
728
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
729 (defvar gnus-marked-hashtb nil
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
730 "Hashtable of `gnus-marked-assoc'.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
731
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
732 (defvar gnus-unread-hashtb nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
733 "Hashtable of unread articles.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
734
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
735 (defvar gnus-active-hashtb nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
736 "Hashtable of active articles.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
737
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
738 (defvar gnus-octive-hashtb nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
739 "Hashtable of OLD active articles.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
740
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
741 (defvar gnus-current-startup-file nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
742 "Startup file for the current host.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
743
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
744 (defvar gnus-last-search-regexp nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
745 "Default regexp for article search command.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
746
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
747 (defvar gnus-last-shell-command nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
748 "Default shell command on article.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
749
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
750 (defvar gnus-have-all-newsgroups nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
751
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
752 (defvar gnus-newsgroup-name nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
753 (defvar gnus-newsgroup-begin nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
754 (defvar gnus-newsgroup-end nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
755 (defvar gnus-newsgroup-last-rmail nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
756 (defvar gnus-newsgroup-last-mail nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
757 (defvar gnus-newsgroup-last-folder nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
758 (defvar gnus-newsgroup-last-file nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
759
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
760 (defvar gnus-newsgroup-unreads nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
761 "List of unread articles in the current newsgroup.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
762
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
763 (defvar gnus-newsgroup-unselected nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
764 "List of unselected unread articles in the current newsgroup.")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
765
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
766 (defvar gnus-newsgroup-marked nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
767 "List of marked articles in the current newsgroup (a subset of unread art).")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
768
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
769 (defvar gnus-newsgroup-headers nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
770 "List of article headers in the current newsgroup.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
771 If you modify the variable, you must call the function
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
772 `gnus-clear-hashtables-for-newsgroup-headers' to clear the hash tables.")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
773 (defvar gnus-newsgroup-headers-hashtb-by-id nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
774 (defvar gnus-newsgroup-headers-hashtb-by-number nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
775
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
776 (defvar gnus-current-article nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
777 (defvar gnus-current-headers nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
778 (defvar gnus-current-history nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
779 (defvar gnus-have-all-headers nil "Must be either T or NIL.")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
780 (defvar gnus-last-article nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
781 (defvar gnus-current-kill-article nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
782
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
783 ;; Save window configuration.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
784 (defvar gnus-winconf-kill-file nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
785
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
786 (defvar gnus-group-mode-map nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
787 (defvar gnus-summary-mode-map nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
788 (defvar gnus-article-mode-map nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
789 (defvar gnus-kill-file-mode-map nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
790
7560
e63efa2d587c rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents: 7524
diff changeset
791 (defvar rmail-default-file (expand-file-name "~/XMBOX"))
e63efa2d587c rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents: 7524
diff changeset
792 (defvar rmail-default-rmail-file (expand-file-name "~/XNEWS"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
793
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
794 ;; Define GNUS Subsystems.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
795 (autoload 'gnus-group-post-news "gnuspost"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
796 "Post an article." t)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
797 (autoload 'gnus-summary-post-news "gnuspost"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
798 "Post an article." t)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
799 (autoload 'gnus-summary-followup "gnuspost"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
800 "Post a reply article." t)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
801 (autoload 'gnus-summary-followup-with-original "gnuspost"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
802 "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
803 (autoload 'gnus-summary-cancel-article "gnuspost"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
804 "Cancel an article you posted." t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
805
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
806 (autoload 'gnus-summary-reply "gnusmail"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
807 "Reply mail to news author." t)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
808 (autoload 'gnus-summary-reply-with-original "gnusmail"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
809 "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
810 (autoload 'gnus-summary-mail-forward "gnusmail"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
811 "Forward the current message to another user." t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
812 (autoload 'gnus-summary-mail-other-window "gnusmail"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
813 "Compose mail in other window." t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
814
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
815 (autoload 'gnus-group-kill-group "gnusmisc"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
816 "Kill newsgroup on current line." t)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
817 (autoload 'gnus-group-yank-group "gnusmisc"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
818 "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
819 (autoload 'gnus-group-kill-region "gnusmisc"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
820 "Kill newsgroups in current region." t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
821 (autoload 'gnus-group-transpose-groups "gnusmisc"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
822 "Exchange current newsgroup and previous newsgroup." t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
823 (autoload 'gnus-list-killed-groups "gnusmisc"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
824 "List the killed newsgroups." t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
825 (autoload 'gnus-gmt-to-local "gnusmisc"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
826 "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
827
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
828 (autoload 'metamail-buffer "metamail"
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
829 "Process current buffer through `metamail'." t)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
830
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
831 (autoload 'rmail-output "rmailout"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
832 "Append this message to Unix mail file named FILE-NAME." t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
833 (autoload 'mail-position-on-field "sendmail")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
834 (autoload 'mh-find-path "mh-e")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
835 (autoload 'mh-prompt-for-folder "mh-e")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
836
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
837 (put 'gnus-group-mode 'mode-class 'special)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
838 (put 'gnus-summary-mode 'mode-class 'special)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
839 (put 'gnus-article-mode 'mode-class 'special)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
840
7216
6ecee038c1c9 (gnus-summary-mode-map): Bind C-c C-v to gnus-uu-ctl-map.
Richard M. Stallman <rms@gnu.org>
parents: 6309
diff changeset
841 (autoload 'gnus-uu-ctl-map "gnus-uu" nil nil 'keymap)
7228
14df71736eae (gnus-summary-mode-map): Bind # to gnus-uu-mark-article.
Richard M. Stallman <rms@gnu.org>
parents: 7216
diff changeset
842 (autoload 'gnus-uu-mark-article "gnus-uu" nil t)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
843
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
844 ;;(put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
845
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
846 (defmacro gnus-eval-in-buffer-window (buffer &rest forms)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
847 "Pop to BUFFER, evaluate FORMS, and then returns to original window."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
848 (` (let ((GNUSStartBufferWindow (selected-window)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
849 (unwind-protect
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
850 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
851 (pop-to-buffer (, buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
852 (,@ forms))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
853 (select-window GNUSStartBufferWindow)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
854
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
855 (defmacro gnus-make-hashtable (&optional hashsize)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
856 "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
857 Optional argument HASHSIZE specifies the table size."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
858 (` (make-vector (, (if hashsize (` (max (, hashsize) 200)) 200)) 0)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
859
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
860 (defmacro gnus-gethash (string hashtable)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
861 "Get hash value of STRING in HASHTABLE."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
862 ;;(` (symbol-value (abbrev-symbol (, string) (, hashtable))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
863 ;;(` (abbrev-expansion (, string) (, hashtable)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
864 (` (symbol-value (intern-soft (, string) (, hashtable)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
865
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
866 (defmacro gnus-sethash (string value hashtable)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
867 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
868 ;; We cannot use define-abbrev since it only accepts string as value.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
869 (` (set (intern (, string) (, hashtable)) (, value))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
870
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
871 ;; Note: Macros defined here are also defined in nntp.el. I don't like
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
872 ;; to put them here, but many users got troubled with the old
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
873 ;; definitions in nntp.elc. These codes are NNTP 3.10 version.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
874
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
875 (defmacro nntp-header-number (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
876 "Return article number in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
877 (` (aref (, header) 0)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
878
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
879 (defmacro nntp-set-header-number (header number)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
880 "Set article number of HEADER to NUMBER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
881 (` (aset (, header) 0 (, number))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
882
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
883 (defmacro nntp-header-subject (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
884 "Return subject string in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
885 (` (aref (, header) 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
886
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
887 (defmacro nntp-set-header-subject (header subject)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
888 "Set article subject of HEADER to SUBJECT."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
889 (` (aset (, header) 1 (, subject))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
890
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
891 (defmacro nntp-header-from (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
892 "Return author string in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
893 (` (aref (, header) 2)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
894
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
895 (defmacro nntp-set-header-from (header from)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
896 "Set article author of HEADER to FROM."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
897 (` (aset (, header) 2 (, from))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
898
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
899 (defmacro nntp-header-xref (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
900 "Return xref string in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
901 (` (aref (, header) 3)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
902
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
903 (defmacro nntp-set-header-xref (header xref)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
904 "Set article xref of HEADER to xref."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
905 (` (aset (, header) 3 (, xref))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
906
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
907 (defmacro nntp-header-lines (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
908 "Return lines in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
909 (` (aref (, header) 4)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
910
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
911 (defmacro nntp-set-header-lines (header lines)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
912 "Set article lines of HEADER to LINES."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
913 (` (aset (, header) 4 (, lines))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
914
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
915 (defmacro nntp-header-date (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
916 "Return date in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
917 (` (aref (, header) 5)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
918
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
919 (defmacro nntp-set-header-date (header date)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
920 "Set article date of HEADER to DATE."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
921 (` (aset (, header) 5 (, date))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
922
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
923 (defmacro nntp-header-id (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
924 "Return Id in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
925 (` (aref (, header) 6)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
926
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
927 (defmacro nntp-set-header-id (header id)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
928 "Set article Id of HEADER to ID."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
929 (` (aset (, header) 6 (, id))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
930
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
931 (defmacro nntp-header-references (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
932 "Return references in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
933 (` (aref (, header) 7)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
934
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
935 (defmacro nntp-set-header-references (header ref)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
936 "Set article references of HEADER to REF."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
937 (` (aset (, header) 7 (, ref))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
938
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
939
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
940 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
941 ;;; GNUS Group Mode
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
942 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
943
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
944 (if gnus-group-mode-map
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
945 nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
946 (setq gnus-group-mode-map (make-keymap))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
947 (suppress-keymap gnus-group-mode-map)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
948 (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
949 (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
950 (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
951 (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
952 (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
953 (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
954 (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
955 (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
956 (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
957 (define-key gnus-group-mode-map "\C-p" 'gnus-group-prev-group)
7466
b48210278981 (gnus-group-mode-map, gnus-summary-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
958 (define-key gnus-group-mode-map [down] 'gnus-group-next-group)
7524
66d8171f3d42 (gnus-group-mode-map): Fix typo in prev change.
Richard M. Stallman <rms@gnu.org>
parents: 7466
diff changeset
959 (define-key gnus-group-mode-map [up] 'gnus-group-prev-group)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
960 (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
961 ;;(define-key gnus-group-mode-map "/" 'isearch-forward)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
962 (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
963 (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
964 (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
965 (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
966 (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
967 (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
968 (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
969 (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
970 (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
971 (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
972 (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
973 (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
974 (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
975 (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
976 (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
977 (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
978 (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
979 (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
980 (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
981 (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
982 (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
983 ;;(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
984 (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
985 (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
986 (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
987 (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
988 (define-key gnus-group-mode-map "?" 'gnus-group-describe-briefly)
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
989 (define-key gnus-group-mode-map "\C-c\C-i" 'gnus-info-find-node)
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
990 (define-key gnus-group-mode-map [mouse-2] 'gnus-mouse-pick-group)
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
991 (define-key gnus-group-mode-map "t" 'gnus-newsgroups-display-toggle)
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
992
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
993 ;; Make a menu bar item.
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
994 (define-key gnus-group-mode-map [menu-bar GNUS]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
995 (cons "GNUS" (make-sparse-keymap "GNUS")))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
996
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
997 (define-key gnus-group-mode-map [menu-bar GNUS force-update]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
998 '("Force Update" . gnus-group-force-update))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
999 (define-key gnus-group-mode-map [menu-bar GNUS quit]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1000 '("Quit" . gnus-group-quit))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1001 (define-key gnus-group-mode-map [menu-bar GNUS exit]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1002 '("Exit" . gnus-group-exit))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1003 (define-key gnus-group-mode-map [menu-bar GNUS restart]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1004 '("Restart" . gnus-group-restart))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1005 (define-key gnus-group-mode-map [menu-bar GNUS suspend]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1006 '("Suspend" . gnus-group-suspend))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1007 (define-key gnus-group-mode-map [menu-bar GNUS get-new-news]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1008 '("Get New News" . gnus-group-get-new-news))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1009
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1010 ;; Make a menu bar item.
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1011 (define-key gnus-group-mode-map [menu-bar groups]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1012 (cons "Groups" (make-sparse-keymap "Groups")))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1013
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1014 (define-key gnus-group-mode-map [menu-bar groups catchup]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1015 '("Catchup" . gnus-group-catchup))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1016 (define-key gnus-group-mode-map [menu-bar groups edit-global-kill]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1017 '("Edit Kill File" . gnus-group-edit-global-kill))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1018
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1019 (define-key gnus-group-mode-map [menu-bar groups separator-2]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1020 '("--"))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1021
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1022 (define-key gnus-group-mode-map [menu-bar groups yank-group]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1023 '("Yank Group" . gnus-group-yank-group))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1024 (define-key gnus-group-mode-map [menu-bar groups kill-group]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1025 '("Kill Group" . gnus-group-kill-group))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1026
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1027 (define-key gnus-group-mode-map [menu-bar groups separator-1]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1028 '("--"))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1029
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1030 (define-key gnus-group-mode-map [menu-bar groups newsgroups-update-description]
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1031 '("Update descriptions" . gnus-newsgroups-update-description))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1032 (define-key gnus-group-mode-map [menu-bar groups newsgroups-display-toggle]
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1033 '("Toggle descriptions" . gnus-newsgroups-display-toggle))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1034 (define-key gnus-group-mode-map [menu-bar groups jump-to-group]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1035 '("Jump to Group..." . gnus-group-jump-to-group))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1036 (define-key gnus-group-mode-map [menu-bar groups list-all-groups]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1037 '("List All Groups" . gnus-group-list-all-groups))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1038 (define-key gnus-group-mode-map [menu-bar groups list-groups]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1039 '("List Groups" . gnus-group-list-groups))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1040 (define-key gnus-group-mode-map [menu-bar groups unsub-current-group]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1041 '("Unsubscribe Group" . gnus-group-unsubscribe-current-group))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1042 )
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1043
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1044 (defun gnus-group-mode ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1045 "Major mode for reading network news.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1046 All normal editing commands are turned off.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1047 Instead, these commands are available:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1048
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1049 SPC Read articles in this newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1050 = Select this newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1051 j Move to the specified newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1052 n Move to the next unread newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1053 p Move to the previous unread newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1054 C-n Move to the next newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1055 C-p Move to the previous newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1056 < Move point to the beginning of this buffer.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1057 > Move point to the end of this buffer.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1058 u Unsubscribe from (subscribe to) this newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1059 U Unsubscribe from (subscribe to) the specified newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1060 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
1061 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
1062 l Revert this buffer.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1063 L List all newsgroups.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1064 g Get new news.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1065 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
1066 b Check bogus newsgroups.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1067 r Restrict visible newsgroups to the current region.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1068 a Post a new article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1069 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
1070 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
1071 C-k Kill this newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1072 C-y Yank killed newsgroup here.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1073 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
1074 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
1075 C-c C-l list killed newsgroups.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1076 s Save .newsrc file.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1077 z Suspend reading news.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1078 q Quit reading news.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1079 Q Quit reading news without saving .newsrc file.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1080 V Show the version number of this GNUS.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1081 ? Describe Group Mode commands briefly.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1082 C-h m Describe Group Mode.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1083 C-c C-i Read Info about Group Mode.
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1084 t Toggle displaying newsgroup descriptions.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1085
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1086 The name of the host running NNTP server is asked for if no default
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1087 host is specified. It is also possible to choose another NNTP server
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1088 even when the default server is defined by giving a prefix argument to
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1089 the command `\\[gnus]'.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1090
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1091 If the NNTP server name starts with a colon, as in `:Mail', the user's
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1092 own directory `~/Mail' is used as a news spool. This makes it
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1093 possible to read mail stored in MH folders or articles saved by GNUS.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1094 File names of mail or articles must consist of only numeric
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1095 characters. Otherwise, they are ignored.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1096
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1097 If there is a file named `~/.newsrc-SERVER', it is used as the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1098 startup file instead of standard one when talking to SERVER. It is
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1099 possible to talk to many hosts by using different startup files for
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1100 each.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1101
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1102 Option `-n' of the options line in the startup file is recognized
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1103 properly the same as the Bnews system. For example, if the options
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1104 line is `options -n !talk talk.rumors', newsgroups under the `talk'
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1105 hierarchy except for `talk.rumors' are ignored while checking new
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1106 newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1107
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1108 If there is a file named `~/.signature-DISTRIBUTION', it is used as
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1109 signature file instead of standard one when posting a news in
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1110 DISTRIBUTION.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1111
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1112 If an Info file generated from `gnus.texinfo' is installed, you can
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1113 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
1114 current major mode of GNUS by \\[gnus-info-find-node].
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1115
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1116 The variable `gnus-version', `nntp-version', `nnspool-version', and
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1117 `mhspool-version' have the version numbers of this version of gnus.el,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1118 nntp.el, nnspool.el, and mhspoo.el, respectively.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1119
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1120 User customizable variables:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1121 gnus-nntp-server
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1122 Specifies the name of the host running the NNTP server. If its
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1123 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
1124 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
1125 from the NNTPSERVER environment variable.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1126
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1127 gnus-nntp-service
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1128 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
1129 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
1130 `gnus-nntp-server' is set to the local host name.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1131
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1132 gnus-startup-file
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1133 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
1134 `.newsrc-SERVER', it's used instead when talking to SERVER. I
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1135 recommend you to use the server specific file, if you'd like to
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1136 talk to many servers. Especially if you'd like to read your
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1137 private directory, the name of the file must be
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1138 `.newsrc-:DIRECTORY'.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1139
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1140 gnus-signature-file
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1141 Specifies a signature file (.signature). If there is a file named
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1142 `.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
1143 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
1144 appending the file automatically. If you use an NNTP inews which
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1145 comes with the NNTP package, you may have to set the variable to
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1146 nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1147
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1148 gnus-use-cross-reference
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1149 Specifies what to do with cross references (Xref: field). If it
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1150 is nil, cross references are ignored. If it is t, articles in
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1151 subscribed newsgroups are only marked as read. Otherwise, if it
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1152 is not nil nor t, articles in all newsgroups are marked as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1153
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1154 gnus-use-followup-to
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1155 Specifies what to do with followup-to: field. If it is nil, its
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1156 value is ignored. If it is non-nil, its value is used as followup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1157 newsgroups. Especially, if it is t and field value is `poster',
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1158 your confirmation is required.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1159
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1160 gnus-author-copy
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1161 Specifies a file name to save a copy of article you posted using
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1162 FCC: field. If the first character of the value is `|', the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1163 contents of the article is piped out to a program specified by the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1164 rest of the value. The variable is initialized from the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1165 AUTHORCOPY environment variable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1166
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1167 gnus-author-copy-saver
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1168 Specifies a function to save an author copy. The function is
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1169 called with a file name. The default function `rmail-output'
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1170 saves in Unix mail format.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1171
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1172 gnus-kill-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1173 Use specified file name as a KILL file (default to `KILL').
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1174
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1175 gnus-novice-user
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1176 Non-nil means that you are a novice to USENET. If non-nil,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1177 verbose messages may be displayed or your confirmations may be
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1178 required.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1179
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1180 gnus-interactive-post
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1181 Non-nil means that newsgroup, subject and distribution are asked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1182 for interactively when posting a new article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1183
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1184 gnus-use-full-window
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1185 Non-nil means to take up the entire screen of Emacs.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1186
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1187 gnus-window-configuration
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1188 Specifies the configuration of Group, Summary, and Article
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1189 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
1190 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
1191 respectively. ACTION is `summary', `newsgroups', or `article'.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1192
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1193 gnus-subscribe-newsgroup-method
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1194 Specifies a function called with a newsgroup name when new
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1195 newsgroup is found. The default definition adds new newsgroup at
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1196 the beginning of other newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1197
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1198 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
1199
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1200 Various hooks for customization:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1201 gnus-group-mode-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1202 Entry to this mode calls the value with no arguments, if that
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1203 value is non-nil. This hook is called before GNUS is connected to
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1204 the NNTP server. So, you can change or define the NNTP server in
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1205 this hook.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1206
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1207 gnus-startup-hook
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1208 Called with no arguments after the NNTP server is selected. It is
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1209 possible to change the behavior of GNUS or initialize the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1210 variables according to the selected NNTP server.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1211
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1212 gnus-group-prepare-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1213 Called with no arguments after a newsgroup list is created in the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1214 Newsgroup buffer, if that value is non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1215
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1216 gnus-save-newsrc-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1217 Called with no arguments when saving newsrc file if that value is
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1218 non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1219
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1220 gnus-prepare-article-hook
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1221 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
1222 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
1223 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
1224 inserts a signature file.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1225
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1226 gnus-inews-article-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1227 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
1228 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
1229 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
1230
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1231 gnus-suspend-gnus-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1232 Called with no arguments when suspending (not exiting) GNUS, if
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1233 that value is non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1234
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1235 gnus-exit-gnus-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1236 Called with no arguments when exiting (not suspending) GNUS, if
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1237 that value is non-nil."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1238 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1239 (kill-all-local-variables)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1240 ;; Gee. Why don't you upgrade?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1241 (cond ((boundp 'mode-line-modified)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1242 (setq mode-line-modified "--- "))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1243 ((listp (default-value 'mode-line-format))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1244 (setq mode-line-format
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1245 (cons "--- " (cdr (default-value 'mode-line-format)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1246 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1247 (setq mode-line-format
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1248 "--- GNUS: List of Newsgroups %[(%m)%]----%3p-%-")))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1249 (setq major-mode 'gnus-group-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1250 (setq mode-name "Newsgroup")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1251 (setq mode-line-buffer-identification "GNUS: List of Newsgroups")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1252 (setq mode-line-process nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1253 (use-local-map gnus-group-mode-map)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1254 (buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1255 (setq buffer-read-only t) ;Disable modification
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1256 (run-hooks 'gnus-group-mode-hook))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1257
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1258 (defun gnus-mouse-pick-group (e)
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1259 (interactive "e")
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1260 (mouse-set-point e)
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1261 (gnus-group-read-group nil))
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1262
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1263 ;;;###autoload
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1264 (defun gnus (&optional confirm)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1265 "Read network news.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1266 If optional argument CONFIRM is non-nil, ask NNTP server."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1267 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1268 (unwind-protect
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1269 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1270 (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
1271 (gnus-group-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1272 (gnus-start-news-server confirm))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1273 (if (not (gnus-server-opened))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1274 (gnus-group-quit)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1275 ;; NNTP server is successfully open.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1276 (setq mode-line-process (format " {%s}" gnus-nntp-server))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1277 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1278 (erase-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1279 (gnus-group-startup-message)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1280 (sit-for 0))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1281 (run-hooks 'gnus-startup-hook)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1282 (gnus-setup-news)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1283 (if gnus-novice-user
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1284 (gnus-group-describe-briefly)) ;Show brief help message.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1285 (gnus-group-list-groups nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1286 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1287
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1288 (defun gnus-group-startup-message ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1289 "Insert startup message in current buffer."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1290 ;; Insert the message.
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
1291 (insert
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
1292 (format "
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
1293 %s
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1294
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1295 NNTP-based News Reader for GNU Emacs
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1296
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1297
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1298 If you have any trouble with this software, please let me
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1299 know. I will fix your problems in the next release.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1300
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1301 Comments, suggestions, and bug fixes are welcome.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1302
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1303 Masanobu UMEDA
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
1304 umerin@mse.kyutech.ac.jp" gnus-version))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1305 ;; And then hack it.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1306 ;; 57 is the longest line.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1307 (indent-rigidly (point-min) (point-max) (/ (max (- (window-width) 57) 0) 2))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1308 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1309 ;; +4 is fuzzy factor.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1310 (insert-char ?\n (/ (max (- (window-height) 18) 0) 2)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1311
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1312 (defun gnus-group-list-groups (show-all)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1313 "List newsgroups in the Newsgroup buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1314 If argument SHOW-ALL is non-nil, unsubscribed groups are also listed."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1315 (interactive "P")
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1316 (setq gnus-newsgroups-showall show-all)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1317 (let ((case-fold-search nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1318 (last-group ;Current newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1319 (gnus-group-group-name))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1320 (next-group ;Next possible newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1321 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1322 (gnus-group-search-forward nil nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1323 (gnus-group-group-name)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1324 (prev-group ;Previous possible newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1325 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1326 (gnus-group-search-forward t nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1327 (gnus-group-group-name))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1328 (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
1329 (gnus-group-prepare show-all)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1330 (if (zerop (buffer-size))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1331 (message "No news is good news")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1332 ;; Go to last newsgroup if possible. If cannot, try next and
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1333 ;; previous. If all fail, go to first unread newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1334 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1335 (or (and last-group
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1336 (re-search-forward (gnus-group-make-regexp last-group) nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1337 (and next-group
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1338 (re-search-forward (gnus-group-make-regexp next-group) nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1339 (and prev-group
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1340 (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
1341 (gnus-group-search-forward nil nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1342 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1343 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1344 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1345 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1346
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1347 (defun gnus-group-prepare (&optional all)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1348 "Prepare list of newsgroups in current buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1349 If optional argument ALL is non-nil, unsubscribed groups are also listed."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1350 (let ((buffer-read-only nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1351 (newsrc gnus-newsrc-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1352 (group-info nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1353 (group-name nil)
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1354 (group-description nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1355 (unread-count 0)
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1356 (nb-tab 0)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1357 ;; This specifies the format of Group buffer.
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1358 (cntl "%s%s%5d: %s"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1359 (erase-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1360 ;; List newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1361 (while newsrc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1362 (setq group-info (car newsrc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1363 (setq group-name (car group-info))
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1364 (if gnus-newsgroups-display
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1365 (progn (setq group-description (gnus-gethash group-name gnus-newsgroups-hashtb))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1366 (setq nb-tab (/ (- 38 (length group-name)) tab-width))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1367 (setq unread-count (nth 1 (gnus-gethash group-name gnus-unread-hashtb)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1368 (if (or all
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1369 (and (nth 1 group-info) ;Subscribed.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1370 (> unread-count 0))) ;There are unread articles.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1371 ;; Yes, I can use gnus-group-prepare-line, but this is faster.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1372 (insert
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1373 (format (concat cntl (make-string (if (> nb-tab 0) nb-tab 1) ?\t)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1374 "%s\n")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1375 ;; Subscribed or not.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1376 (if (nth 1 group-info) " " "U")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1377 ;; Has new news?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1378 (if (and (> unread-count 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1379 (>= 0
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1380 (- unread-count
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1381 (length
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1382 (cdr (gnus-gethash group-name
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1383 gnus-marked-hashtb))))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1384 "*" " ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1385 ;; Number of unread articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1386 unread-count
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1387 ;; Newsgroup name.
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1388 group-name
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1389 ;; Newsgroup description
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1390 (if group-description (cdr group-description) "")
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1391 ))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1392 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1393 (setq newsrc (cdr newsrc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1394 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1395 (setq gnus-have-all-newsgroups all)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1396 (goto-char (point-min))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1397 (run-hooks 'gnus-group-prepare-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1398 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1399
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1400 (defun gnus-group-prepare-line (info)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1401 "Return a string for the Newsgroup buffer from INFO.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1402 INFO is an element of `gnus-newsrc-assoc' or `gnus-killed-assoc'."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1403 (let* ((group-name (car info))
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1404 (group-description nil)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1405 (nb-tab 0)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1406 (unread-count
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1407 (or (nth 1 (gnus-gethash group-name gnus-unread-hashtb))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1408 ;; Not in hash table, so compute it now.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1409 (gnus-number-of-articles
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1410 (gnus-difference-of-range
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1411 (nth 2 (gnus-gethash group-name gnus-active-hashtb))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1412 (nthcdr 2 info)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1413 ;; This specifies the format of Group buffer.
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1414 (cntl "%s%s%5d: %s"))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1415 (if gnus-newsgroups-display
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1416 (progn
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1417 (setq group-description (gnus-gethash group-name gnus-newsgroups-hashtb))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1418 (setq nb-tab (/ (- 38 (length group-name)) tab-width))))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1419 (format (concat cntl (make-string (if (> nb-tab 0) nb-tab 1) ?\t)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1420 "%s\n")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1421 ;; Subscribed or not.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1422 (if (nth 1 info) " " "U")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1423 ;; Has new news?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1424 (if (and (> unread-count 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1425 (>= 0
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1426 (- unread-count
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1427 (length
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1428 (cdr (gnus-gethash group-name
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1429 gnus-marked-hashtb))))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1430 "*" " ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1431 ;; Number of unread articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1432 unread-count
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1433 ;; Newsgroup name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1434 group-name
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1435 ;; Newsgroup description
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1436 (if group-description (cdr group-description) "")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1437 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1438
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1439 (defun gnus-group-update-group (group &optional visible-only)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1440 "Update newsgroup info of GROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1441 If optional argument VISIBLE-ONLY is non-nil, non displayed group is ignored."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1442 (let ((buffer-read-only nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1443 (case-fold-search nil) ;appleIIgs vs. appleiigs
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1444 (regexp (gnus-group-make-regexp group))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1445 (visible nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1446 ;; Buffer may be narrowed.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1447 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1448 (widen)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1449 ;; 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
1450 ;; 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
1451 ;; 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
1452 ;; 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
1453 ;; the beginning. Otherwise, search from the end.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1454 (if (cond ((progn
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1455 (beginning-of-line)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1456 (looking-at regexp)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1457 ((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
1458 (progn
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1459 (goto-char (point-min))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1460 (re-search-forward regexp nil t))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1461 ((progn
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1462 (goto-char (point-max))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1463 (re-search-backward regexp nil t))))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1464 ;; GROUP is listed in current buffer. So, delete old line.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1465 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1466 (setq visible t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1467 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1468 (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
1469 )
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1470 ;; 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
1471 (goto-char (point-min)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1472 (if (or visible (not visible-only))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1473 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1474 (insert (gnus-group-prepare-line
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1475 (gnus-gethash group gnus-newsrc-hashtb)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1476 (forward-line -1) ;Move point on that line.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1477 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1478 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1479
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1480 (defun gnus-group-group-name ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1481 "Get newsgroup name around point."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1482 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1483 (beginning-of-line)
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
1484 (if (looking-at "^..[0-9 \t]+:[ \t]+\\([^ \t\n]+\\)\\([ \t].*\\|$\\)")
9550
5b91f8657de6 (gnus-group-group-name): Get rid of text properties.
Richard M. Stallman <rms@gnu.org>
parents: 8523
diff changeset
1485 (let ((group-name (buffer-substring (match-beginning 1) (match-end 1))))
5b91f8657de6 (gnus-group-group-name): Get rid of text properties.
Richard M. Stallman <rms@gnu.org>
parents: 8523
diff changeset
1486 (set-text-properties 0 (length group-name) nil group-name)
5b91f8657de6 (gnus-group-group-name): Get rid of text properties.
Richard M. Stallman <rms@gnu.org>
parents: 8523
diff changeset
1487 group-name))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1488
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1489 (defun gnus-group-make-regexp (newsgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1490 "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
1491 (concat "^.+: " (regexp-quote newsgroup) "\\([ \t].*\\|$\\)"))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1492
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1493 (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
1494 "Search for the next (or previous) newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1495 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
1496 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
1497 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
1498 (let ((case-fold-search nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1499 (func
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1500 (if backward
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1501 (function re-search-backward) (function re-search-forward)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1502 (regexp
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1503 (format "^%s[ \t]*\\(%s\\):"
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1504 (if norest ".." " [ \t]")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1505 (if norest "[0-9]+" "[1-9][0-9]*")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1506 (found nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1507 (if backward
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1508 (if heretoo
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1509 (end-of-line)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1510 (beginning-of-line))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1511 (if heretoo
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1512 (beginning-of-line)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1513 (end-of-line)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1514 (setq found (funcall func regexp nil t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1515 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1516 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1517 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1518 ;; Return T if found.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1519 found
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1520 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1521
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1522 ;; GNUS Group mode command
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1523
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1524 (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
1525 "Read news in this newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1526 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
1527 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
1528 (interactive "P")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1529 (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
1530 (if group
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1531 (gnus-summary-read-group
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1532 group
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1533 (or all
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1534 ;;(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
1535 (zerop
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1536 (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
1537 no-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1538 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1539 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1540
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1541 (defun gnus-group-select-group (all)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1542 "Select this newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1543 No article is selected automatically.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1544 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
1545 (interactive "P")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1546 (gnus-group-read-group all t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1547
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1548 (defun gnus-group-jump-to-group (group)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1549 "Jump to newsgroup GROUP."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1550 (interactive
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1551 (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
1552 (let ((case-fold-search nil))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1553 (goto-char (point-min))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1554 (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
1555 (if (gnus-gethash group gnus-newsrc-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1556 ;; Add GROUP entry, then seach again.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1557 (gnus-group-update-group group)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1558 ;; Adjust cursor point.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1559 (beginning-of-line)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1560 (search-forward ":" nil t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1561 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1562
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1563 (defun gnus-group-next-group (n)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1564 "Go to Nth following newsgroup."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1565 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1566 (while (and (> n 1)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1567 (gnus-group-search-forward nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1568 (setq n (1- n)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1569 (or (gnus-group-search-forward nil t)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1570 (message "No more newsgroups")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1571
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1572 (defun gnus-group-next-unread-group (n)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1573 "Go to Nth following unread newsgroup."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1574 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1575 (while (and (> n 1)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1576 (gnus-group-search-forward nil nil))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1577 (setq n (1- n)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1578 (or (gnus-group-search-forward nil nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1579 (message "No more unread newsgroups")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1580
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1581 (defun gnus-group-prev-group (n)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1582 "Go to Nth previous newsgroup."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1583 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1584 (while (and (> n 1)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1585 (gnus-group-search-forward t t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1586 (setq n (1- n)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1587 (or (gnus-group-search-forward t t)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1588 (message "No more newsgroups")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1589
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1590 (defun gnus-group-prev-unread-group (n)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1591 "Go to Nth previous unread newsgroup."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1592 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1593 (while (and (> n 1)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1594 (gnus-group-search-forward t nil))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1595 (setq n (1- n)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1596 (or (gnus-group-search-forward t nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1597 (message "No more unread newsgroups")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1598
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1599 (defun gnus-group-catchup (all)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1600 "Mark all articles not marked as unread in current newsgroup as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1601 If prefix argument ALL is non-nil, all articles are marked as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1602 Cross references (Xref: field) of articles are ignored."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1603 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1604 (let* ((group (gnus-group-group-name))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1605 (marked (if (not all)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1606 (cdr (gnus-gethash group gnus-marked-hashtb)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1607 (and group
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1608 (or (not gnus-interactive-catchup) ;Without confirmation?
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1609 (y-or-n-p
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1610 (if all
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1611 "Do you really want to mark everything as read? "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1612 "Delete all articles not marked as read? ")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1613 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1614 (message "") ;Clear "Yes or No" question.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1615 ;; Any marked articles will be preserved.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1616 (gnus-update-unread-articles group marked marked)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1617 (gnus-group-update-group group)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1618 (gnus-group-next-group 1)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1619 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1620
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1621 (defun gnus-group-catchup-all ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1622 "Mark all articles in current newsgroup as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1623 Cross references (Xref: field) of articles are ignored."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1624 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1625 (gnus-group-catchup t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1626
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1627 (defun gnus-group-unsubscribe-current-group ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1628 "Toggle subscribe from/to unsubscribe current group."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1629 (interactive)
7573
059281285df7 (gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents: 7560
diff changeset
1630 (let ((group (gnus-group-group-name)))
059281285df7 (gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents: 7560
diff changeset
1631 (if group
059281285df7 (gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents: 7560
diff changeset
1632 (progn
059281285df7 (gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents: 7560
diff changeset
1633 (gnus-group-unsubscribe-group group)
059281285df7 (gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents: 7560
diff changeset
1634 (gnus-group-next-group 1))
059281285df7 (gnus-group-unsubscribe-current-group):
Richard M. Stallman <rms@gnu.org>
parents: 7560
diff changeset
1635 (message "No Newsgroup found to \(un\)subscribe"))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1636
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1637 (defun gnus-group-unsubscribe-group (group)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1638 "Toggle subscribe from/to unsubscribe GROUP.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1639 \(If GROUP is new, it is added to `.newsrc' automatically.)"
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1640 (interactive
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1641 (list (completing-read "Newsgroup: "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1642 gnus-active-hashtb nil 'require-match)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1643 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1644 (cond ((not (null newsrc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1645 ;; Toggle subscription flag.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1646 (setcar (nthcdr 1 newsrc) (not (nth 1 newsrc)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1647 (gnus-update-newsrc-buffer group)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1648 (gnus-group-update-group group)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1649 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1650 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1651 (search-forward ":" nil t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1652 ((and (stringp group)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1653 (gnus-gethash group gnus-active-hashtb))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1654 ;; Add new newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1655 (gnus-add-newsgroup group)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1656 (gnus-group-update-group group)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1657 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1658 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1659 (search-forward ":" nil t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1660 (t (error "No such newsgroup: %s" group)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1661 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1662
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1663 (defun gnus-group-list-all-groups ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1664 "List all of newsgroups in the Newsgroup buffer."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1665 (interactive)
5510
d3e04700d190 (gnus-group-list-all-groups): Display a message in the echo area.
Richard M. Stallman <rms@gnu.org>
parents: 5313
diff changeset
1666 (message "Listing all groups...")
d3e04700d190 (gnus-group-list-all-groups): Display a message in the echo area.
Richard M. Stallman <rms@gnu.org>
parents: 5313
diff changeset
1667 (gnus-group-list-groups t)
d3e04700d190 (gnus-group-list-all-groups): Display a message in the echo area.
Richard M. Stallman <rms@gnu.org>
parents: 5313
diff changeset
1668 (message "Listing all groups...done"))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1669
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1670 (defun gnus-group-get-new-news ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1671 "Get newly arrived articles. In fact, read the active file again."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1672 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1673 (gnus-setup-news)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1674 (gnus-group-list-groups gnus-have-all-newsgroups))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1675
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1676 (defun gnus-group-restart ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1677 "Force GNUS to read the raw startup file."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1678 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1679 (gnus-save-newsrc-file)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1680 (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
1681 (gnus-group-list-groups gnus-have-all-newsgroups))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1682
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1683 (defun gnus-group-check-bogus-groups ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1684 "Check bogus newsgroups."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1685 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1686 (gnus-check-bogus-newsgroups t) ;Require confirmation.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1687 (gnus-group-list-groups gnus-have-all-newsgroups))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1688
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1689 (defun gnus-group-restrict-groups (start end)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1690 "Restrict visible newsgroups to the current region (START and END).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1691 Type \\[widen] to remove restriction."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1692 (interactive "r")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1693 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1694 (narrow-to-region (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1695 (goto-char start)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1696 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1697 (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1698 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1699 (goto-char end)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1700 (forward-line 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1701 (point))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1702 (message (substitute-command-keys "Type \\[widen] to remove restriction")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1703
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1704 (defun gnus-group-edit-global-kill ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1705 "Edit a global KILL file."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1706 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1707 (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
1708 (gnus-kill-file-edit-file nil) ;Nil stands for global KILL file.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1709 (message
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1710 (substitute-command-keys
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1711 "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
1712
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1713 (defun gnus-group-edit-local-kill ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1714 "Edit a local KILL file."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1715 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1716 (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
1717 (gnus-kill-file-edit-file (gnus-group-group-name))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1718 (message
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1719 (substitute-command-keys
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1720 "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
1721
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1722 (defun gnus-group-force-update ()
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1723 "Update `.newsrc' file."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1724 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1725 (gnus-save-newsrc-file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1726
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1727 (defun gnus-group-suspend ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1728 "Suspend the current GNUS session.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1729 In fact, cleanup buffers except for Group Mode buffer.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1730 The hook `gnus-suspend-gnus-hook' is called before actually suspending."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1731 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1732 (run-hooks 'gnus-suspend-gnus-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1733 ;; Kill GNUS buffers except for Group Mode buffer.
8382
425ac5eebc19 (gnus-group-suspend): Be sure to bury the right buffer.
Richard M. Stallman <rms@gnu.org>
parents: 8258
diff changeset
1734 (let ((buffers gnus-buffer-list)
425ac5eebc19 (gnus-group-suspend): Be sure to bury the right buffer.
Richard M. Stallman <rms@gnu.org>
parents: 8258
diff changeset
1735 (group-buf (get-buffer gnus-group-buffer)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1736 (while buffers
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1737 (and (not (eq (car buffers) gnus-group-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1738 (get-buffer (car buffers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1739 (kill-buffer (car buffers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1740 (setq buffers (cdr buffers))
8382
425ac5eebc19 (gnus-group-suspend): Be sure to bury the right buffer.
Richard M. Stallman <rms@gnu.org>
parents: 8258
diff changeset
1741 )
425ac5eebc19 (gnus-group-suspend): Be sure to bury the right buffer.
Richard M. Stallman <rms@gnu.org>
parents: 8258
diff changeset
1742 (bury-buffer group-buf)
425ac5eebc19 (gnus-group-suspend): Be sure to bury the right buffer.
Richard M. Stallman <rms@gnu.org>
parents: 8258
diff changeset
1743 (delete-windows-on group-buf t)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1744
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1745 (defun gnus-group-exit ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1746 "Quit reading news after updating `.newsrc'.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1747 The hook `gnus-exit-gnus-hook' is called before actually quitting."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1748 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1749 (if (or noninteractive ;For gnus-batch-kill
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1750 (zerop (buffer-size)) ;No news is good news.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1751 (not (gnus-server-opened)) ;NNTP connection closed.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1752 (not gnus-interactive-exit) ;Without confirmation
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1753 (y-or-n-p "Are you sure you want to quit reading news? "))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1754 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1755 (message "") ;Erase "Yes or No" question.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1756 (run-hooks 'gnus-exit-gnus-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1757 (gnus-save-newsrc-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1758 (gnus-clear-system)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1759 (gnus-close-server))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1760 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1761
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1762 (defun gnus-group-quit ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1763 "Quit reading news without updating `.newsrc'.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
1764 The hook `gnus-exit-gnus-hook' is called before actually quitting."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1765 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1766 (if (or noninteractive ;For gnus-batch-kill
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1767 (zerop (buffer-size))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1768 (not (gnus-server-opened))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1769 (yes-or-no-p
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1770 (format "Quit reading news without saving %s? "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1771 (file-name-nondirectory gnus-current-startup-file))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1772 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1773 (message "") ;Erase "Yes or No" question.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1774 (run-hooks 'gnus-exit-gnus-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1775 (gnus-clear-system)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1776 (gnus-close-server))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1777 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1778
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1779 (defun gnus-group-describe-briefly ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1780 "Describe Group mode commands briefly."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1781 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1782 (message
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1783 (concat
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1784 (substitute-command-keys "\\[gnus-group-read-group]:Select ")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1785 (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
1786 (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
1787 (substitute-command-keys "\\[gnus-group-exit]:Exit ")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1788 (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
1789 (substitute-command-keys "\\[gnus-group-describe-briefly]:This help")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1790 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1791
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1792
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1793 ;;;
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1794 ;;; GNUS Summary Mode
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1795 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1796
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1797 (if gnus-summary-mode-map
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1798 nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1799 (setq gnus-summary-mode-map (make-keymap))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1800 (suppress-keymap gnus-summary-mode-map)
7216
6ecee038c1c9 (gnus-summary-mode-map): Bind C-c C-v to gnus-uu-ctl-map.
Richard M. Stallman <rms@gnu.org>
parents: 6309
diff changeset
1801 (define-key gnus-summary-mode-map "\C-c\C-v" 'gnus-uu-ctl-map)
7228
14df71736eae (gnus-summary-mode-map): Bind # to gnus-uu-mark-article.
Richard M. Stallman <rms@gnu.org>
parents: 7216
diff changeset
1802 (define-key gnus-summary-mode-map "#" 'gnus-uu-mark-article)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1803 (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
1804 (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
1805 (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
1806 (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
1807 (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
1808 (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
1809 (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
1810 (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
1811 (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
1812 ;;(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
1813 ;;(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
1814 (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
1815 (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
1816 (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
1817 (define-key gnus-summary-mode-map "\C-p" 'gnus-summary-prev-subject)
7466
b48210278981 (gnus-group-mode-map, gnus-summary-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
1818 (define-key gnus-summary-mode-map [down] 'gnus-summary-next-subject)
b48210278981 (gnus-group-mode-map, gnus-summary-mode-map):
Richard M. Stallman <rms@gnu.org>
parents: 7300
diff changeset
1819 (define-key gnus-summary-mode-map [up] 'gnus-summary-prev-subject)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1820 (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
1821 (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
1822 ;;(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
1823 ;;(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
1824 (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
1825 ;;(define-key gnus-summary-mode-map "/" 'isearch-forward)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
1826 (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
1827 (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
1828 ;;(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
1829 (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
1830 (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
1831 (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
1832 (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
1833 ;;(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
1834 (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
1835 (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
1836 ;;(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
1837 (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
1838 (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
1839 (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
1840 (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
1841 (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
1842 (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
1843 (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
1844 (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
1845 (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
1846 (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
1847 (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
1848 (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
1849 (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
1850 (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
1851 (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
1852 (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
1853 (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
1854 (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
1855 ;;(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
1856 ;;(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
1857 (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
1858 ;;(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
1859 (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
1860 (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
1861 (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
1862 (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
1863 (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
1864 (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
1865 (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
1866 (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
1867 (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
1868 (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
1869 (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
1870 (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
1871 ;;(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
1872 (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
1873 (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
1874 (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
1875 (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
1876 (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
1877 ;;(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
1878 (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
1879 (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
1880 (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
1881 (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
1882 (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
1883 (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
1884 (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
1885 (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
1886 (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
1887 (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
1888 (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
1889 (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
1890 (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
1891 (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
1892 (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
1893 (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
1894 (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
1895 (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
1896 (define-key gnus-summary-mode-map "?" 'gnus-summary-describe-briefly)
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1897 (define-key gnus-summary-mode-map "\C-c\C-i" 'gnus-info-find-node)
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1898 (define-key gnus-summary-mode-map [mouse-2] 'gnus-mouse-pick-article)
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1899
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1900 (define-key gnus-summary-mode-map [menu-bar misc]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1901 (cons "Misc" (make-sparse-keymap "misc")))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1902
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1903 (define-key gnus-summary-mode-map [menu-bar misc caesar-message]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1904 '("Caesar Message" . gnus-summary-caesar-message))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1905 (define-key gnus-summary-mode-map [menu-bar misc cancel-article]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1906 '("Cancel Article" . gnus-summary-cancel-article))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1907 (define-key gnus-summary-mode-map [menu-bar misc edit-local-kill]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1908 '("Edit Kill File" . gnus-summary-edit-local-kill))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1909
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1910 (define-key gnus-summary-mode-map [menu-bar misc mark-as-unread]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1911 '("Mark as Unread" . gnus-summary-mark-as-unread-forward))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1912 (define-key gnus-summary-mode-map [menu-bar misc mark-as-read]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1913 '("Mark as Read" . gnus-summary-mark-as-read))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1914
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1915 (define-key gnus-summary-mode-map [menu-bar misc quit]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1916 '("Quit Group" . gnus-summary-quit))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1917 (define-key gnus-summary-mode-map [menu-bar misc exit]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1918 '("Exit Group" . gnus-summary-exit))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1919
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1920 (define-key gnus-summary-mode-map [menu-bar sort]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1921 (cons "Sort" (make-sparse-keymap "sort")))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1922
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1923 (define-key gnus-summary-mode-map [menu-bar sort sort-by-author]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1924 '("Sort by Author" . gnus-summary-sort-by-author))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1925 (define-key gnus-summary-mode-map [menu-bar sort sort-by-date]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1926 '("Sort by Date" . gnus-summary-sort-by-date))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1927 (define-key gnus-summary-mode-map [menu-bar sort sort-by-number]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1928 '("Sort by Number" . gnus-summary-sort-by-number))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1929 (define-key gnus-summary-mode-map [menu-bar sort sort-by-subject]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1930 '("Sort by Subject" . gnus-summary-sort-by-subject))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1931
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1932 (define-key gnus-summary-mode-map [menu-bar show/hide]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1933 (cons "Show/Hide" (make-sparse-keymap "show/hide")))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1934
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1935 (define-key gnus-summary-mode-map [menu-bar show/hide hide-all-threads]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1936 '("Hide All Threads" . gnus-summary-hide-all-threads))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1937 (define-key gnus-summary-mode-map [menu-bar show/hide hide-thread]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1938 '("Hide Thread" . gnus-summary-hide-thread))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1939 (define-key gnus-summary-mode-map [menu-bar show/hide show-all-threads]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1940 '("Show All Threads" . gnus-summary-show-all-threads))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1941 (define-key gnus-summary-mode-map [menu-bar show/hide show-all-headers]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1942 '("Show All Headers" . gnus-summary-show-all-headers))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1943 (define-key gnus-summary-mode-map [menu-bar show/hide show-thread]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1944 '("Show Thread" . gnus-summary-show-thread))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1945 (define-key gnus-summary-mode-map [menu-bar show/hide show-article]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1946 '("Show Article" . gnus-summary-show-article))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1947 (define-key gnus-summary-mode-map [menu-bar show/hide toggle-truncation]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1948 '("Toggle Truncation" . gnus-summary-toggle-truncation))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1949 (define-key gnus-summary-mode-map [menu-bar show/hide toggle-mime]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1950 '("Toggle Mime" . gnus-summary-toggle-mime))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1951 (define-key gnus-summary-mode-map [menu-bar show/hide toggle-header]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1952 '("Toggle Header" . gnus-summary-toggle-header))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1953
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1954 (define-key gnus-summary-mode-map [menu-bar action]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1955 (cons "Action" (make-sparse-keymap "action")))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1956
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1957 (define-key gnus-summary-mode-map [menu-bar action kill-same-subject]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1958 '("Kill Same Subject" . gnus-summary-kill-same-subject))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1959 (define-key gnus-summary-mode-map [menu-bar action kill-thread]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1960 '("Kill Thread" . gnus-summary-kill-thread))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1961 (define-key gnus-summary-mode-map [menu-bar action delete-marked-with]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1962 '("Delete Marked With" . gnus-summary-delete-marked-with))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1963 (define-key gnus-summary-mode-map [menu-bar action delete-marked-as-read]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1964 '("Delete Marked As Read" . gnus-summary-delete-marked-as-read))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1965 (define-key gnus-summary-mode-map [menu-bar action catchup-and-exit]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1966 '("Catchup And Exit" . gnus-summary-catchup-and-exit))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1967 (define-key gnus-summary-mode-map [menu-bar action catchup-to-here]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1968 '("Catchup to Here" . gnus-summary-catchup-to-here))
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1969
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1970 (define-key gnus-summary-mode-map [menu-bar action ignore]
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1971 '("---"))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1972
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1973 (define-key gnus-summary-mode-map [menu-bar action save-in-file]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1974 '("Save in File" . gnus-summary-save-in-file))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1975 (define-key gnus-summary-mode-map [menu-bar action save-article]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1976 '("Save Article" . gnus-summary-save-article))
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1977
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1978 (define-key gnus-summary-mode-map [menu-bar action lambda]
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1979 '("---"))
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1980
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1981 (define-key gnus-summary-mode-map [menu-bar action forward]
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1982 '("Forward" . gnus-summary-mail-forward))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1983 (define-key gnus-summary-mode-map [menu-bar action followup-with-original]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1984 '("Followup with Original" . gnus-summary-followup-with-original))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1985 (define-key gnus-summary-mode-map [menu-bar action followup]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1986 '("Followup" . gnus-summary-followup))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1987 (define-key gnus-summary-mode-map [menu-bar action reply-with-original]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1988 '("Reply with Original" . gnus-summary-reply-with-original))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1989 (define-key gnus-summary-mode-map [menu-bar action reply]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1990 '("Reply" . gnus-summary-reply))
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1991 (define-key gnus-summary-mode-map [menu-bar action post]
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1992 '("Post News" . gnus-summary-post-news))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1993
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1994 (define-key gnus-summary-mode-map [menu-bar move]
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1995 (cons "Move" (make-sparse-keymap "move")))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
1996
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1997 (define-key gnus-summary-mode-map [menu-bar move isearch-article]
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1998 '("Search in Article" . gnus-summary-isearch-article))
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
1999 (define-key gnus-summary-mode-map [menu-bar move search-through-articles]
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2000 '("Search through Articles" . gnus-summary-search-article-forward))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2001 (define-key gnus-summary-mode-map [menu-bar move down-thread]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2002 '("Down Thread" . gnus-summary-down-thread))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2003 (define-key gnus-summary-mode-map [menu-bar move prev-same-subject]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2004 '("Prev Same Subject" . gnus-summary-prev-same-subject))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2005 (define-key gnus-summary-mode-map [menu-bar move prev-group]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2006 '("Prev Group" . gnus-summary-prev-group))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2007 (define-key gnus-summary-mode-map [menu-bar move next-unread-same-subject]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2008 '("Next Unread Same Subject" . gnus-summary-next-unread-same-subject))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2009 (define-key gnus-summary-mode-map [menu-bar move next-unread-article]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2010 '("Next Unread Article" . gnus-summary-next-unread-article))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2011 (define-key gnus-summary-mode-map [menu-bar move next-thread]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2012 '("Next Thread" . gnus-summary-next-thread))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2013 (define-key gnus-summary-mode-map [menu-bar move next-group]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2014 '("Next Group" . gnus-summary-next-group))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2015 (define-key gnus-summary-mode-map [menu-bar move first-unread-article]
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2016 '("First Unread Article" . gnus-summary-first-unread-article))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2017 )
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2018
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2019
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2020 (defun gnus-summary-mode ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2021 "Major mode for reading articles in this newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2022 All normal editing commands are turned off.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2023 Instead, these commands are available:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2024
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2025 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
2026 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
2027 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
2028 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
2029 n Move to the next unread article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2030 p Move to the previous unread article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2031 N Move to the next article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2032 P Move to the previous article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2033 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
2034 current article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2035 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
2036 current article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2037 \\[gnus-summary-next-unread-same-subject]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2038 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
2039 current article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2040 \\[gnus-summary-prev-unread-same-subject]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2041 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
2042 the current article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2043 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
2044 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
2045 C-n Move to the next subject.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2046 C-p Move to the previous subject.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2047 ESC n Move to the next unread subject.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2048 ESC p Move to the previous unread subject.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2049 \\[gnus-summary-next-group]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2050 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
2051 \\[gnus-summary-prev-group]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2052 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
2053 . 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
2054 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
2055 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
2056 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
2057 < 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
2058 > 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
2059 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
2060 l Jump to the article you read last.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2061 ^ Refer to parent of the current article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2062 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
2063 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
2064 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
2065 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
2066 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
2067 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
2068 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
2069 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
2070 read, and then select the next unread article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2071 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
2072 read.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2073 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
2074 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
2075 ESC C-t Toggle showing conversation threads.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2076 ESC C-s Show thread subtrees.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2077 ESC C-h Hide thread subtrees.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2078 \\[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
2079 \\[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
2080 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
2081 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
2082 ESC C-d Go downward current thread.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2083 ESC C-u Go upward current thread.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2084 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
2085 & Execute a command for each article conditionally.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2086 \\[gnus-summary-catchup]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2087 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
2088 articles marked as unread.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2089 \\[gnus-summary-catchup-all]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2090 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
2091 \\[gnus-summary-catchup-and-exit]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2092 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
2093 current newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2094 \\[gnus-summary-catchup-all-and-exit]
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2095 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
2096 C-t Toggle truncations of subject lines.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2097 x Delete subject lines marked as read.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2098 X Delete subject lines with the specific marks.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2099 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
2100 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
2101 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
2102 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
2103 = Expand Summary window to show headers full window.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2104 C-x C-s Reselect the current newsgroup. Prefix argument means to select all.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2105 w Stop page breaking by linefeed.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2106 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
2107 g Force to show the current article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2108 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
2109 vice versa.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2110 ESC-t Toggle MIME processing.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2111 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
2112 a Post a new article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2113 f Post a reply article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2114 F Post a reply article with original article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2115 C Cancel the current article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2116 r Mail a message to the author.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2117 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
2118 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
2119 m Mail a message in other window.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2120 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
2121 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
2122 | 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
2123 q Quit reading news in the current newsgroup.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2124 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
2125 V Show the version number of this GNUS.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2126 ? Describe Summary mode commands briefly.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2127 C-h m Describe Summary mode.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2128 C-c C-i Read Info about Summary mode.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2129
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2130 User customizable variables:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2131 gnus-large-newsgroup
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2132 The number of articles which indicates a large newsgroup. If the
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2133 number of articles in a newsgroup is greater than the value, the
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2134 number of articles to be selected is asked for. If the given value
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2135 N is positive, the last N articles is selected. If N is negative,
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2136 the first N articles are selected. An empty string means to select
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2137 all articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2138
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2139 gnus-use-long-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2140 Non-nil means that a newsgroup name is used as a default file name
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2141 to save articles to. If it's nil, the directory form of a
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2142 newsgroup is used instead.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2143
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2144 gnus-default-article-saver
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2145 Specifies your favorite article saver which is interactively
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2146 funcallable. Following functions are available:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2147
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2148 gnus-summary-save-in-rmail (in Rmail format)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2149 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
2150 gnus-summary-save-in-folder (in MH folder)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2151 gnus-summary-save-in-file (in article format).
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2152
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2153 gnus-rmail-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2154 gnus-mail-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2155 gnus-folder-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2156 gnus-file-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2157 Specifies a function generating a file name to save articles in
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2158 specified format. The function is called with NEWSGROUP, HEADERS,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2159 and optional LAST-FILE. Access macros to the headers are defined
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2160 as `nntp-header-FIELD', and functions are defined as
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2161 `gnus-header-FIELD'.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2162
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2163 gnus-article-save-directory
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2164 Specifies a directory name to save articles to using the commands
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2165 `gnus-summary-save-in-rmail', `gnus-summary-save-in-mail' and
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2166 `gnus-summary-save-in-file'. The variable is initialized from the
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2167 SAVEDIR environment variable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2168
8444
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
2169 gnus-kill-files-directory
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
2170 Specifies a directory name to save KILL files to using the commands
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2171 `gnus-edit-global-kill', and `gnus-edit-local-kill'. The variable is
8444
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
2172 initialized from the SAVEDIR environment variable.
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
2173
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2174 gnus-show-all-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2175 Non-nil means that all headers of an article are shown.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2176
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2177 gnus-save-all-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2178 Non-nil means that all headers of an article are saved in a file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2179
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2180 gnus-show-mime
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2181 Non-nil means that show a MIME message.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2182
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2183 gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2184 Non-nil means that conversation threads are shown in tree structure.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2185
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2186 gnus-thread-hide-subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2187 Non-nil means that subjects for thread subtrees are hidden.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2188
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2189 gnus-thread-hide-subtree
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2190 Non-nil means that thread subtrees are hidden initially.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2191
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2192 gnus-thread-hide-killed
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2193 Non-nil means that killed thread subtrees are hidden automatically.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2194
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2195 gnus-thread-ignore-subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2196 Non-nil means that subject differences are ignored in constructing
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2197 thread trees.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2198
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2199 gnus-thread-indent-level
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2200 Indentation of thread subtrees.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2201
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2202 gnus-optional-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2203 Specifies a function which generates an optional string displayed
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2204 in the Summary buffer. The function is called with an article
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2205 HEADERS. The result must be a string excluding `[' and `]'. The
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2206 default function returns a string like NNN:AUTHOR, where NNN is
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2207 the number of lines in an article and AUTHOR is the name of the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2208 author.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2209
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2210 gnus-auto-extend-newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2211 Non-nil means visible articles are extended to forward and
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2212 backward automatically if possible.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2213
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2214 gnus-auto-select-first
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2215 Non-nil means the first unread article is selected automagically
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2216 when a newsgroup is selected normally (by `gnus-group-read-group').
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2217 If you'd like to prevent automatic selection of the first unread
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2218 article in some newsgroups, set the variable to nil in
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2219 `gnus-select-group-hook' or `gnus-apply-kill-hook'.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2220
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2221 gnus-auto-select-next
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2222 Non-nil means the next newsgroup is selected automagically at the
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2223 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
2224 empty (no unread articles), GNUS will exit Summary mode and go
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2225 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
2226 exit Summary mode but select the following unread newsgroup.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2227 Especially, if the value is the symbol `quietly', the next unread
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2228 newsgroup will be selected without any confirmations.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2229
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2230 gnus-auto-select-same
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2231 Non-nil means an article with the same subject as the current
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2232 article is selected automagically like `rn -S'.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2233
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2234 gnus-auto-center-summary
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2235 Non-nil means the point of Summary Mode window is always kept
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2236 centered.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2237
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2238 gnus-break-pages
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2239 Non-nil means an article is broken into pages at page delimiters.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2240 This may not work with some versions of GNU Emacs earlier than
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2241 version 18.50.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2242
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2243 gnus-page-delimiter
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2244 Specifies a regexp describing line-beginnings that separate pages
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2245 of news article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2246
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2247 gnus-digest-show-summary
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2248 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
2249 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
2250 command.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2251
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2252 gnus-digest-separator
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2253 Specifies a regexp separating messages in a digest article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2254
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2255 gnus-mail-reply-method
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2256 gnus-mail-other-window-method
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2257 Specifies a function to begin composing mail message using
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2258 commands `gnus-summary-reply' and `gnus-summary-mail-other-window'.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2259 Functions `gnus-mail-reply-using-mail' and `gnus-mail-reply-using-mhe'
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2260 are available for the value of `gnus-mail-reply-method'. And
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2261 functions `gnus-mail-other-window-using-mail' and
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2262 `gnus-mail-other-window-using-mhe' are available for the value of
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2263 `gnus-mail-other-window-method'.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2264
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2265 gnus-mail-send-method
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2266 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
2267 as an article. The message must have To: or Cc: field. The value
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2268 of the variable `send-mail-function' is the default function, which
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2269 uses sendmail mail program.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2270
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2271 Various hooks for customization:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2272 gnus-summary-mode-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2273 Entry to this mode calls the value with no arguments, if that
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2274 value is non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2275
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2276 gnus-select-group-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2277 Called with no arguments when newsgroup is selected, if that value
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2278 is non-nil. It is possible to sort subjects in this hook. See the
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2279 documentation of this variable for more information.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2280
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2281 gnus-summary-prepare-hook
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2282 Called with no arguments after a summary list is created in the
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2283 Summary buffer, if that value is non-nil. If you'd like to modify
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2284 the buffer, you can use this hook.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2285
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2286 gnus-select-article-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2287 Called with no arguments when an article is selected, if that
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2288 value is non-nil. See the documentation of this variable for more
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2289 information.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2290
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2291 gnus-select-digest-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2292 Called with no arguments when reading digest messages using Rmail,
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2293 if that value is non-nil. This hook can be used to modify an
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2294 article so that Rmail can work with it. See the documentation of
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2295 the variable for more information.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2296
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2297 gnus-rmail-digest-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2298 Called with no arguments when reading digest messages using Rmail,
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2299 if that value is non-nil. This hook is intended to customize Rmail
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2300 mode.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2301
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2302 gnus-apply-kill-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2303 Called with no arguments when a newsgroup is selected and the
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2304 Summary buffer is prepared. This hook is intended to apply a KILL
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2305 file to the selected newsgroup. The format of KILL file is
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2306 completely different from that of version 3.8. You have to rewrite
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2307 them in the new format. See the documentation of Kill file mode
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2308 for more information.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2309
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2310 gnus-mark-article-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2311 Called with no arguments when an article is selected at the first
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2312 time. The hook is intended to mark an article as read (or unread)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2313 automatically when it is selected. See the documentation of the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2314 variable for more information.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2315
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2316 gnus-exit-group-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2317 Called with no arguments when exiting the current newsgroup, if
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2318 that value is non-nil. If your machine is so slow that exiting
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2319 from Summary mode takes very long time, inhibit marking articles
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2320 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
2321 gnus-use-cross-reference to nil in this hook."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2322 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2323 (kill-all-local-variables)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2324 ;; Gee. Why don't you upgrade?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2325 (cond ((boundp 'mode-line-modified)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2326 (setq mode-line-modified "--- "))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2327 ((listp (default-value 'mode-line-format))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2328 (setq mode-line-format
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2329 (cons "--- " (cdr (default-value 'mode-line-format))))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2330 ;; To disable display-time facility.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2331 ;;(make-local-variable 'global-mode-string)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2332 ;;(setq global-mode-string nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2333 (setq major-mode 'gnus-summary-mode)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2334 (setq mode-name "Summary")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2335 ;;(setq mode-line-process '(" " gnus-newsgroup-name))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2336 (make-local-variable 'minor-mode-alist)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2337 (or (assq 'gnus-show-threads minor-mode-alist)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2338 (setq minor-mode-alist
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2339 (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
2340 (gnus-summary-set-mode-line)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2341 (use-local-map gnus-summary-mode-map)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2342 (buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2343 (setq buffer-read-only t) ;Disable modification
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2344 (setq truncate-lines t) ;Stop line folding
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2345 (setq selective-display t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2346 (setq selective-display-ellipses t) ;Display `...'
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2347 ;;(setq case-fold-search t)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2348 (run-hooks 'gnus-summary-mode-hook))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2349
8258
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2350 (defun gnus-mouse-pick-article (e)
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2351 (interactive "e")
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2352 (mouse-set-point e)
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2353 (gnus-summary-next-page nil))
44773d8bee3e Clean up menu item string format.
Richard M. Stallman <rms@gnu.org>
parents: 8162
diff changeset
2354
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2355 (defun gnus-summary-setup-buffer ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2356 "Initialize Summary buffer."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2357 (if (get-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2358 (set-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2359 (set-buffer (get-buffer-create gnus-summary-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2360 (gnus-summary-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2361 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2362
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2363 (defun gnus-summary-read-group (group &optional show-all no-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2364 "Start reading news in newsgroup GROUP.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2365 If optional 1st argument SHOW-ALL is non-nil, already read articles are
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2366 also listed.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2367 If optional 2nd argument NO-ARTICLE is non-nil, no article is selected
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2368 initially."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2369 (message "Retrieving newsgroup: %s..." group)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2370 (if (gnus-select-newsgroup group show-all)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2371 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2372 ;; Don't switch-to-buffer to prevent displaying old contents
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2373 ;; of the buffer until new subjects list is created.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2374 ;; Suggested by Juha Heinanen <jh@tut.fi>
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2375 (gnus-summary-setup-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2376 ;; 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
2377 (run-hooks 'gnus-select-group-hook)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2378 (gnus-summary-prepare)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2379 ;; 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
2380 (run-hooks 'gnus-apply-kill-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2381 (if (zerop (buffer-size))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2382 ;; This newsgroup is empty.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2383 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2384 (gnus-summary-catchup-and-exit nil t) ;Without confirmations.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2385 (message "No unread news"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2386 ;; 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
2387 ;; gnus-summary-prepare-hook since kill processing may not
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2388 ;; work with hidden articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2389 (and gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2390 gnus-thread-hide-subtree
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2391 (gnus-summary-hide-all-threads))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2392 ;; Show first unread article if requested.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2393 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2394 (if (and (not no-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2395 gnus-auto-select-first
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2396 (gnus-summary-first-unread-article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2397 ;; Window is configured automatically.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2398 ;; 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
2399 ;; evaluation, especially by gnus-summary-rmail-digest
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2400 ;; 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
2401 (if (eq (current-buffer) (get-buffer gnus-summary-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2402 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2403 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2404 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2405 (search-forward ":" nil t)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2406 (gnus-configure-windows 'summary)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2407 (pop-to-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2408 (gnus-summary-set-mode-line)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2409 ;; 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
2410 (if (get-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2411 (if (get-buffer-window gnus-article-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2412 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2413 (set-buffer gnus-article-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2414 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2415 (erase-buffer)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2416 (kill-buffer gnus-article-buffer)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2417 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2418 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2419 (search-forward ":" nil t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2420 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2421 ;; Cannot select newsgroup GROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2422 (if (gnus-gethash group gnus-active-hashtb)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2423 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2424 ;; If NNTP is used, nntp_access file may not be installed
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2425 ;; properly. Otherwise, may be active file problem.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2426 (ding)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2427 (message
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2428 (gnus-nntp-message
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2429 (format "Cannot select %s. May be security or active file problem." group)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2430 (sit-for 0))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2431 ;; Check bogus newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2432 ;; We must be in Group Mode buffer.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2433 (gnus-group-check-bogus-groups))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2434 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2435
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2436 (defun gnus-summary-prepare ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2437 "Prepare summary list of current newsgroup in Summary buffer."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2438 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2439 ;; 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
2440 ;; want it can define them in gnus-select-group-hook.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2441 ;; Print verbose messages if too many articles are selected.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2442 ;; (and (numberp gnus-large-newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2443 ;; (> (length gnus-newsgroup-headers) gnus-large-newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2444 ;; (message "Preparing headers..."))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2445 (erase-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2446 (gnus-summary-prepare-threads
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2447 (if gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2448 (gnus-make-threads gnus-newsgroup-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2449 gnus-newsgroup-headers) 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2450 ;; Erase header retrieval message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2451 (message "")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2452 ;; Call hooks for modifying Summary buffer.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2453 ;; Suggested by sven@tde.LTH.Se (Sven Mattisson).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2454 (goto-char (point-min))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2455 (run-hooks 'gnus-summary-prepare-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2456 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2457
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2458 ;; 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
2459 ;; 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
2460
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2461 (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
2462 "Prepare Summary buffer from THREADS and indentation LEVEL.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2463 THREADS is a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...]).'
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2464 Optional PARENT-SUBJECT specifies the subject of the parent."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2465 (let ((thread nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2466 (header nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2467 (number nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2468 (subject nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2469 (child-subject nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2470 (parent-subject (or parent-subject ""))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2471 ;; `M Indent NUM: [OPT] SUBJECT'
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2472 (cntl (format "%%s %%s%%%dd: [%%s] %%s\n"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2473 (length (prin1-to-string gnus-newsgroup-end)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2474 (while threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2475 (setq thread (car threads))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2476 (setq threads (cdr threads))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2477 ;; If thread is a cons, hierarchical threads is given.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2478 ;; Otherwise, thread itself is header.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2479 (if (consp thread)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2480 (setq header (car thread))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2481 (setq header thread))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2482 ;; Print valid header only.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2483 (if (vectorp header) ;Depends on nntp.el.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2484 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2485 (setq number (nntp-header-number header))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2486 (setq subject (nntp-header-subject header))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2487 (setq child-subject (gnus-simplify-subject subject 're-only))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2488 (insert
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2489 (format cntl
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2490 ;; Read or not.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2491 (cond ((memq number gnus-newsgroup-marked) "-")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2492 ((memq number gnus-newsgroup-unreads) " ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2493 (t "D"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2494 ;; Thread level.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2495 (make-string (* level gnus-thread-indent-level) ? )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2496 ;; Article number.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2497 number
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2498 ;; Optional headers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2499 (or (and gnus-optional-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2500 (funcall gnus-optional-headers header)) "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2501 ;; Its subject string.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2502 (concat (if (or (zerop level)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2503 (not gnus-thread-hide-subject)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2504 ;; Subject is different from the parent.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2505 (not (string-equal
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2506 parent-subject child-subject)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2507 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2508 (make-string (window-width) ? ))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2509 subject)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2510 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2511 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2512 ;; Print subthreads.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2513 (and (consp thread)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2514 (cdr thread)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2515 (gnus-summary-prepare-threads
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2516 (cdr thread) (1+ level) child-subject))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2517 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2518
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2519 ;;(defun gnus-summary-set-mode-line ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2520 ;; "Set Summary mode line string."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2521 ;; ;; 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
2522 ;; (let ((subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2523 ;; (if gnus-current-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2524 ;; (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
2525 ;; (setq mode-line-buffer-identification
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2526 ;; (concat "GNUS: "
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2527 ;; subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2528 ;; ;; Enough spaces to pad subject to 17 positions.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2529 ;; (make-string (max 0 (- 17 (length subject))) ? ))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2530 ;; (set-buffer-modified-p t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2531
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2532 ;; New implementation in gnus 3.14.3
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2533
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2534 (defun gnus-summary-set-mode-line ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2535 "Set Summary mode line string.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2536 If you don't like it, define your own `gnus-summary-set-mode-line'."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2537 (let ((unmarked
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2538 (- (length gnus-newsgroup-unreads)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2539 (length (gnus-intersection
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2540 gnus-newsgroup-unreads gnus-newsgroup-marked))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2541 (unselected
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2542 (- (length gnus-newsgroup-unselected)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2543 (length (gnus-intersection
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2544 gnus-newsgroup-unselected gnus-newsgroup-marked)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2545 (setq mode-line-buffer-identification
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2546 (list 17
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2547 (format "GNUS: %s%s %s"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2548 gnus-newsgroup-name
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2549 (if gnus-current-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2550 (format "/%d" gnus-current-article) "")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2551 ;; Basic ideas by tale@pawl.rpi.edu.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2552 (cond ((and (zerop unmarked)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2553 (zerop unselected))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2554 "")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2555 ((zerop unselected)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2556 (format "{%d more}" unmarked))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2557 (t
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2558 (format "{%d(+%d) more}" unmarked unselected)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2559 ))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2560 (set-buffer-modified-p t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2561
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2562 ;; GNUS Summary mode command.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2563
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2564 (defun gnus-summary-search-group (&optional backward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2565 "Search for next unread newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2566 If optional argument BACKWARD is non-nil, search backward instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2567 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2568 (set-buffer gnus-group-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2569 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2570 ;; 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
2571 (if (gnus-group-search-forward backward nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2572 (gnus-group-group-name))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2573 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2574
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2575 (defun gnus-summary-search-subject (backward unread subject)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2576 "Search for article forward.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2577 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
2578 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
2579 If 3rd argument SUBJECT is non-nil, the article which has
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2580 the same subject will be searched for."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2581 (let ((func
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2582 (if backward
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2583 (function re-search-backward) (function re-search-forward)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2584 (article nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2585 ;; We have to take care of hidden lines.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2586 (regexp
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2587 (format "^%s[ \t]+\\([0-9]+\\):.\\[[^]\r\n]*\\][ \t]+%s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2588 ;;(if unread " " ".")
6309
9217f29851c2 Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents: 5911
diff changeset
2589 (cond ((eq unread t) " ") (unread "[- ]") (t "."))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2590 (if subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2591 (concat "\\([Rr][Ee]:[ \t]+\\)*"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2592 (regexp-quote (gnus-simplify-subject subject))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2593 ;; Ignore words in parentheses.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2594 "\\([ \t]*([^\r\n]*)\\)*[ \t]*\\(\r\\|$\\)")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2595 "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2596 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2597 (if backward
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2598 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2599 (end-of-line))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2600 (if (funcall func regexp nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2601 (setq article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2602 (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2603 (buffer-substring (match-beginning 1) (match-end 1)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2604 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2605 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2606 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2607 ;; This is the result.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2608 article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2609 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2610
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2611 (defun gnus-summary-search-forward (&optional unread subject)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2612 "Search for article forward.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2613 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
2614 If 2nd optional argument SUBJECT is non-nil, the article which has
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2615 the same subject will be searched for."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2616 (gnus-summary-search-subject nil unread subject))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2617
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2618 (defun gnus-summary-search-backward (&optional unread subject)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2619 "Search for article backward.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2620 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
2621 If 2nd optional argument SUBJECT is non-nil, the article which has
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2622 the same subject will be searched for."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2623 (gnus-summary-search-subject t unread subject))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2624
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2625 (defun gnus-summary-article-number ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2626 "Return the Article number around point.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2627 If none, return current article number."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2628 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2629 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2630 (if (looking-at ".[ \t]+\\([0-9]+\\):")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2631 (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2632 (buffer-substring (match-beginning 1) (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2633 ;; If search fail, return current article number.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2634 gnus-current-article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2635 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2636
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2637 (defun gnus-summary-subject-string ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2638 "Return current subject string or nil if nothing."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2639 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2640 ;; 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
2641 ;; `gnus-summary-article-number' and `gnus-newsgroup-headers'.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2642 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2643 ;; We have to take care of hidden lines.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2644 (if (looking-at ".[ \t]+[0-9]+:.\\[[^]\r\n]*\\][ \t]+\\([^\r\n]*\\)[\r\n]")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2645 (buffer-substring (match-beginning 1) (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2646 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2647
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2648 (defun gnus-summary-goto-subject (article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2649 "Move point to ARTICLE's subject."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2650 (interactive
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2651 (list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2652 (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2653 (completing-read "Article number: "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2654 (mapcar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2655 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2656 (lambda (headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2657 (list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2658 (int-to-string (nntp-header-number headers)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2659 gnus-newsgroup-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2660 nil 'require-match))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2661 (let ((current (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2662 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2663 (or (and article (re-search-forward (format "^.[ \t]+%d:" article) nil t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2664 (progn (goto-char current) nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2665 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2666
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2667 (defun gnus-summary-recenter ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2668 "Center point in Summary window."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2669 ;; Scroll window so as to cursor comes center of Summary window
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2670 ;; only when article is displayed.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2671 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2672 ;; Recenter only when requested.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2673 ;; Subbested by popovich@park.cs.columbia.edu
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2674 (and gnus-auto-center-summary
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2675 (get-buffer-window gnus-article-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2676 (< (/ (- (window-height) 1) 2)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2677 (count-lines (point) (point-max)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2678 (recenter (/ (- (window-height) 2) 2))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2679
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2680 ;; Walking around Group mode buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2681
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2682 (defun gnus-summary-jump-to-group (newsgroup)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2683 "Move point to NEWSGROUP in Group mode buffer."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2684 ;; Keep update point of Group mode buffer if visible.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2685 (if (eq (current-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2686 (get-buffer gnus-group-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2687 (save-window-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2688 ;; Take care of tree window mode.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2689 (if (get-buffer-window gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2690 (pop-to-buffer gnus-group-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2691 (gnus-group-jump-to-group newsgroup))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2692 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2693 ;; Take care of tree window mode.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2694 (if (get-buffer-window gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2695 (pop-to-buffer gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2696 (set-buffer gnus-group-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2697 (gnus-group-jump-to-group newsgroup))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2698
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2699 (defun gnus-summary-next-group (no-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2700 "Exit current newsgroup and then select next unread newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2701 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2702 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2703 ;; 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
2704 (gnus-summary-jump-to-group gnus-newsgroup-name)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2705 (let ((group (gnus-summary-search-group)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2706 (if (null group)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2707 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2708 (message "Exiting %s..." gnus-newsgroup-name)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2709 (gnus-summary-exit)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2710 (message ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2711 (message "Selecting %s..." group)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2712 (gnus-summary-exit t) ;Exit Summary mode temporary.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2713 ;; We are now in Group mode buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2714 ;; 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
2715 (gnus-summary-jump-to-group group)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2716 (gnus-summary-read-group group nil no-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2717 (or (eq (current-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2718 (get-buffer gnus-summary-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2719 (eq gnus-auto-select-next t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2720 ;; Expected newsgroup has nothing to read since the articles
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2721 ;; are marked as read by cross-referencing. So, try next
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2722 ;; newsgroup. (Make sure we are in Group mode buffer now.)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2723 (and (eq (current-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2724 (get-buffer gnus-group-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2725 (gnus-group-group-name)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2726 (gnus-summary-read-group
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2727 (gnus-group-group-name) nil no-article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2728 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2729 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2730
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2731 (defun gnus-summary-prev-group (no-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2732 "Exit current newsgroup and then select previous unread newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2733 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2734 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2735 ;; 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
2736 (gnus-summary-jump-to-group gnus-newsgroup-name)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2737 (let ((group (gnus-summary-search-group t)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2738 (if (null group)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2739 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2740 (message "Exiting %s..." gnus-newsgroup-name)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2741 (gnus-summary-exit)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2742 (message ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2743 (message "Selecting %s..." group)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2744 (gnus-summary-exit t) ;Exit Summary mode temporary.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2745 ;; We are now in Group mode buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2746 ;; We have to adjust point of Group mode buffer because current
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2747 ;; 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
2748 (gnus-summary-jump-to-group group)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2749 (gnus-summary-read-group group nil no-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2750 (or (eq (current-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2751 (get-buffer gnus-summary-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2752 (eq gnus-auto-select-next t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2753 ;; Expected newsgroup has nothing to read since the articles
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2754 ;; are marked as read by cross-referencing. So, try next
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2755 ;; newsgroup. (Make sure we are in Group mode buffer now.)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2756 (and (eq (current-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2757 (get-buffer gnus-group-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2758 (gnus-summary-search-group t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2759 (gnus-summary-read-group
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2760 (gnus-summary-search-group t) nil no-article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2761 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2762 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2763
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2764 ;; Walking around summary lines.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2765
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2766 (defun gnus-summary-next-subject (n &optional unread)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2767 "Go to Nth following summary line.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2768 If optional argument UNREAD is non-nil, only unread article is selected."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2769 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2770 (while (and (> n 1)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2771 (gnus-summary-search-forward unread))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2772 (setq n (1- n)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2773 (cond ((gnus-summary-search-forward unread)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2774 (gnus-summary-recenter))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2775 (unread
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2776 (message "No more unread articles"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2777 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2778 (message "No more articles"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2779 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2780
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2781 (defun gnus-summary-next-unread-subject (n)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2782 "Go to Nth following unread summary line."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2783 (interactive "p")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2784 (gnus-summary-next-subject n t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2785
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2786 (defun gnus-summary-prev-subject (n &optional unread)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2787 "Go to Nth previous summary line.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2788 If optional argument UNREAD is non-nil, only unread article is selected."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2789 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2790 (while (and (> n 1)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2791 (gnus-summary-search-backward unread))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2792 (setq n (1- n)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2793 (cond ((gnus-summary-search-backward unread)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2794 (gnus-summary-recenter))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2795 (unread
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2796 (message "No more unread articles"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2797 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2798 (message "No more articles"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2799 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2800
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2801 (defun gnus-summary-prev-unread-subject (n)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
2802 "Go to Nth previous unread summary line."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2803 (interactive "p")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2804 (gnus-summary-prev-subject n t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2805
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2806 ;; Walking around summary lines with displaying articles.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2807
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2808 (defun gnus-summary-expand-window ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2809 "Expand Summary window to show headers full window."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2810 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2811 (gnus-configure-windows 'summary)
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
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2814 (defun gnus-summary-display-article (article &optional all-header)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2815 "Display ARTICLE in Article buffer."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2816 (if (null article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2817 nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2818 (gnus-configure-windows 'article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2819 (pop-to-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2820 (gnus-article-prepare article all-header)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2821 (gnus-summary-recenter)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2822 (gnus-summary-set-mode-line)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2823 (run-hooks 'gnus-select-article-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2824 ;; Successfully display article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2825 t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2826 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2827
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2828 (defun gnus-summary-select-article (&optional all-headers force)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2829 "Select the current article.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2830 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
2831 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
2832 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
2833 (let ((article (gnus-summary-article-number))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2834 (all-headers (not (not all-headers)))) ;Must be T or NIL.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2835 (if (or (null gnus-current-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2836 (/= article gnus-current-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2837 (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
2838 ;; 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
2839 (gnus-summary-display-article article all-headers)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2840 (gnus-configure-windows 'article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2841 (pop-to-buffer gnus-summary-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2842 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2843
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2844 (defun gnus-summary-set-current-mark (&optional current-mark)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2845 "Put `+' at the current article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2846 Optional argument specifies CURRENT-MARK instead of `+'."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2847 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2848 (set-buffer gnus-summary-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2849 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2850 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2851 ;; First of all clear mark at last article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2852 (if (re-search-forward "^.[ \t]+[0-9]+:[^ \t]" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2853 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2854 (delete-char -1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2855 (insert " ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2856 (goto-char (point-min))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2857 (if (re-search-forward (format "^.[ \t]+%d:" gnus-current-article) nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2858 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2859 (delete-char 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2860 (insert (or current-mark "+"))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2861 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2862
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2863 ;;(defun gnus-summary-next-article (unread &optional subject)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2864 ;; "Select article after current one.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2865 ;;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
2866 ;; (interactive "P")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2867 ;; (cond ((gnus-summary-display-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2868 ;; (gnus-summary-search-forward unread subject)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2869 ;; (unread
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2870 ;; (message "No more unread articles"))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2871 ;; (t
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2872 ;; (message "No more articles"))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2873 ;; ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2874
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2875 (defun gnus-summary-next-article (unread &optional subject)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2876 "Select article after current one.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2877 If argument UNREAD is non-nil, only unread article is selected."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2878 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2879 (let ((header nil))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2880 (cond ((gnus-summary-display-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2881 (gnus-summary-search-forward unread subject)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2882 ((and subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2883 gnus-auto-select-same
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2884 (gnus-set-difference gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2885 gnus-newsgroup-marked)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2886 (memq this-command
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2887 '(gnus-summary-next-unread-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2888 gnus-summary-next-page
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2889 gnus-summary-kill-same-subject-and-select
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2890 ;;gnus-summary-next-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2891 ;;gnus-summary-next-same-subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2892 ;;gnus-summary-next-unread-same-subject
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2893 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2894 ;; 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
2895 ;; Hook function, such as gnus-summary-rmail-digest, may
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2896 ;; change current buffer, so need check.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2897 (let ((buffer (current-buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2898 (last-point (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2899 ;; No more articles with same subject, so jump to the first
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2900 ;; unread article.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2901 (gnus-summary-first-unread-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2902 ;;(and (eq buffer (current-buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2903 ;; (= (point) last-point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2904 ;; ;; Ignore given SUBJECT, and try again.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2905 ;; (gnus-summary-next-article unread nil))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2906 (and (eq buffer (current-buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2907 (< (point) last-point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2908 (message "Wrapped"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2909 ))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2910 ((and gnus-auto-extend-newsgroup
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2911 (not unread) ;Not unread only
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2912 (not subject) ;Only if subject is not specified.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2913 (setq header (gnus-more-header-forward)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2914 ;; Extend to next article if possible.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2915 ;; Basic ideas by himacdonald@watdragon.waterloo.edu
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2916 (gnus-extend-newsgroup header nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2917 ;; Threads feature must be turned off.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2918 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2919 (goto-char (point-max))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2920 (gnus-summary-prepare-threads (list header) 0))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2921 (gnus-summary-goto-article gnus-newsgroup-end))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2922 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2923 ;; Select next newsgroup automatically if requested.
7974
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2924 (let ((cmd (aref (this-command-keys) 0))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2925 (group (gnus-summary-search-group))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2926 (auto-select
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2927 (and gnus-auto-select-next
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2928 ;;(null (gnus-set-difference gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2929 ;; gnus-newsgroup-marked))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2930 (memq this-command
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2931 '(gnus-summary-next-unread-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2932 gnus-summary-next-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2933 gnus-summary-next-page
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2934 gnus-summary-next-same-subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2935 gnus-summary-next-unread-same-subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2936 gnus-summary-kill-same-subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2937 gnus-summary-kill-same-subject-and-select
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2938 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2939 ;; Ignore characters typed ahead.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2940 (not (input-pending-p))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2941 )))
7974
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2942 ;; Keep just the event type of CMD.
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2943 (if (listp cmd)
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2944 (setq cmd (car cmd)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2945 (message "No more%s articles%s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2946 (if unread " unread" "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2947 (if (and auto-select
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2948 (not (eq gnus-auto-select-next 'quietly)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2949 (if group
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2950 (format " (Type %s for %s [%d])"
7974
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2951 (single-key-description cmd)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2952 group
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2953 (nth 1 (gnus-gethash group
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2954 gnus-unread-hashtb)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2955 (format " (Type %s to exit %s)"
7974
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2956 (single-key-description cmd)
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2957 gnus-newsgroup-name))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2958 ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2959 ;; Select next unread newsgroup automagically.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2960 (cond ((and auto-select
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2961 (eq gnus-auto-select-next 'quietly))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2962 ;; Select quietly.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2963 (gnus-summary-next-group nil))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2964 (auto-select
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2965 ;; Confirm auto selection.
7974
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2966 (let* ((event (read-event))
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2967 (type
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2968 (if (listp event)
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2969 (car event)
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2970 event)))
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
2971 (if (and (eq event type) (eq event cmd))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2972 (gnus-summary-next-group nil)
7974
de3b4f95a9db (gnus-summary-next-article): Handle non-character events.
Richard M. Stallman <rms@gnu.org>
parents: 7793
diff changeset
2973 (setq unread-command-events (list event)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2974 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2975 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2976 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2977
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2978 (defun gnus-summary-next-unread-article ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2979 "Select unread article after current one."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2980 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2981 (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
2982 (gnus-summary-subject-string))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2983
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2984 (defun gnus-summary-prev-article (unread &optional subject)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2985 "Select article before current one.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2986 If argument UNREAD is non-nil, only unread article is selected."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2987 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2988 (let ((header nil))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2989 (cond ((gnus-summary-display-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2990 (gnus-summary-search-backward unread subject)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2991 ((and subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2992 gnus-auto-select-same
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2993 (gnus-set-difference gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2994 gnus-newsgroup-marked)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2995 (memq this-command
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2996 '(gnus-summary-prev-unread-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2997 ;;gnus-summary-prev-page
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2998 ;;gnus-summary-prev-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
2999 ;;gnus-summary-prev-same-subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3000 ;;gnus-summary-prev-unread-same-subject
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3001 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3002 ;; Ignore given SUBJECT, and try again.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3003 (gnus-summary-prev-article unread nil))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3004 (unread
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3005 (message "No more unread articles"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3006 ((and gnus-auto-extend-newsgroup
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3007 (not subject) ;Only if subject is not specified.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3008 (setq header (gnus-more-header-backward)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3009 ;; Extend to previous article if possible.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3010 ;; Basic ideas by himacdonald@watdragon.waterloo.edu
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3011 (gnus-extend-newsgroup header t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3012 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3013 (goto-char (point-min))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3014 (gnus-summary-prepare-threads (list header) 0))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3015 (gnus-summary-goto-article gnus-newsgroup-begin))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3016 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3017 (message "No more articles"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3018 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3019
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3020 (defun gnus-summary-prev-unread-article ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3021 "Select unread article before current one."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3022 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3023 (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
3024 (gnus-summary-subject-string))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3025
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3026 (defun gnus-summary-next-page (lines)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3027 "Show next page of selected article.
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3496
diff changeset
3028 If end of article, select next article.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3029 Argument LINES specifies lines to be scrolled up."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3030 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3031 (let ((article (gnus-summary-article-number))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3032 (endp nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3033 (if (or (null gnus-current-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3034 (/= article gnus-current-article))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3035 ;; 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
3036 (gnus-summary-display-article article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3037 (gnus-configure-windows 'article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3038 (pop-to-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3039 (gnus-eval-in-buffer-window gnus-article-buffer
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3040 (setq endp (gnus-article-next-page lines)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3041 (cond ((and endp lines)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3042 (message "End of message"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3043 ((and endp (null lines))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3044 (gnus-summary-next-unread-article)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3045 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3046
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3047 (defun gnus-summary-prev-page (lines)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3048 "Show previous page of selected article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3049 Argument LINES specifies lines to be scrolled down."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3050 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3051 (let ((article (gnus-summary-article-number)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3052 (if (or (null gnus-current-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3053 (/= article gnus-current-article))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3054 ;; 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
3055 (gnus-summary-display-article article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3056 (gnus-configure-windows 'article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3057 (pop-to-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3058 (gnus-eval-in-buffer-window gnus-article-buffer
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3059 (gnus-article-prev-page lines))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3060 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3061
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3062 (defun gnus-summary-scroll-up (lines)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3063 "Scroll up (or down) one line current article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3064 Argument LINES specifies lines to be scrolled up (or down if negative)."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3065 (interactive "p")
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
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3068 (cond ((> lines 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3069 (if (gnus-article-next-page lines)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3070 (message "End of message")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3071 ((< lines 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3072 (gnus-article-prev-page (- 0 lines))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3073 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3074
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3075 (defun gnus-summary-next-same-subject ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3076 "Select next article which has the same subject as current one."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3077 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3078 (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
3079
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3080 (defun gnus-summary-prev-same-subject ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3081 "Select previous article which has the same subject as current one."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3082 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3083 (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
3084
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3085 (defun gnus-summary-next-unread-same-subject ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3086 "Select next unread article which has the same subject as current one."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3087 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3088 (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
3089
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3090 (defun gnus-summary-prev-unread-same-subject ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3091 "Select previous unread article which has the same subject as current one."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3092 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3093 (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
3094
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3095 (defun gnus-summary-refer-parent-article (child)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3096 "Refer parent article of current article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3097 If a prefix argument CHILD is non-nil, go back to the child article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3098 using internally maintained articles history.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3099 NOTE: This command may not work with `nnspool.el'."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3100 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3101 (gnus-summary-select-article t t) ;Request all headers.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3102 (let ((referenced-id nil)) ;Message-id of parent or child article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3103 (if child
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3104 ;; Go back to child article using history.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3105 (gnus-summary-refer-article nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3106 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3107 ;; Look for parent Message-ID.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3108 ;; 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
3109 ;; because we may be looking at parent or referred article.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3110 (let ((references (gnus-fetch-field "References")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3111 ;; Get the last message-id in the references.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3112 (and references
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3113 (string-match "\\(<[^<>]+>\\)[^>]*\\'" references)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3114 (setq referenced-id
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3115 (substring references
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3116 (match-beginning 1) (match-end 1))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3117 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3118 (if (stringp referenced-id)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3119 (gnus-summary-refer-article referenced-id)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3120 (error "No more parents"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3121 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3122
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3123 (defun gnus-summary-refer-article (message-id)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3124 "Refer article specified by MESSAGE-ID.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3125 If the MESSAGE-ID is nil or an empty string, Message-ID is poped from
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3126 internally maintained articles history.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3127 NOTE: This command may not work with `nnspool.el' nor `mhspool.el'."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3128 (interactive "sMessage-ID: ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3129 ;; Make sure that this command depends on the fact that article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3130 ;; related information is not updated when an article is retrieved
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3131 ;; by Message-ID.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3132 (gnus-summary-select-article t t) ;Request all headers.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3133 (if (and (stringp message-id)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3134 (> (length message-id) 0))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3135 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3136 ;; Construct the correct Message-ID if necessary.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3137 ;; Suggested by tale@pawl.rpi.edu.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3138 (or (string-match "^<" message-id)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3139 (setq message-id (concat "<" message-id)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3140 (or (string-match ">$" message-id)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3141 (setq message-id (concat message-id ">")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3142 ;; Push current message-id on history.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3143 ;; 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
3144 ;; message-id because we may be looking at parent or referred
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3145 ;; article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3146 (let ((current (gnus-fetch-field "Message-ID")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3147 (or (equal current message-id) ;Nothing to do.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3148 (equal current (car gnus-current-history))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3149 (setq gnus-current-history
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3150 (cons current gnus-current-history)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3151 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3152 ;; Pop message-id from history.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3153 (setq message-id (car gnus-current-history))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3154 (setq gnus-current-history (cdr gnus-current-history)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3155 (if (stringp message-id)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3156 ;; 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
3157 ;; nnspool nor mhspool.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3158 (gnus-article-prepare message-id t)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3159 (error "No such references"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3160 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3161
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3162 (defun gnus-summary-next-digest (n)
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3163 "Move to head of Nth next digested message."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3164 (interactive "p")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3165 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3166 (gnus-eval-in-buffer-window gnus-article-buffer
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3167 (gnus-article-next-digest (or n 1))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3168 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3169
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3170 (defun gnus-summary-prev-digest (n)
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3171 "Move to head of Nth previous digested message."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3172 (interactive "p")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3173 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3174 (gnus-eval-in-buffer-window gnus-article-buffer
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3175 (gnus-article-prev-digest (or n 1))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3176
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3177 (defun gnus-summary-first-unread-article ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3178 "Select first unread article. Return non-nil if successfully selected."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3179 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3180 (let ((begin (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3181 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3182 (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
3183 (gnus-summary-display-article (gnus-summary-article-number))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3184 ;; If there is no unread articles, stay there.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3185 (goto-char begin)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3186 ;;(gnus-summary-display-article (gnus-summary-article-number))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3187 (message "No more unread articles")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3188 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3189 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3190 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3191
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3192 (defun gnus-summary-isearch-article ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3193 "Do incremental search forward on current article."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3194 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3195 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3196 (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
3197 (isearch-forward)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3198
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3199 (defun gnus-summary-search-article-forward (regexp)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3200 "Search for an article containing REGEXP forward.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3201 `gnus-select-article-hook' is not called for articles examined
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3202 by searching search."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3203 (interactive
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3204 (list (read-string
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3205 (concat "Search forward (regexp): "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3206 (if gnus-last-search-regexp
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3207 (concat "(default " gnus-last-search-regexp ") "))))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3208 (if (string-equal regexp "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3209 (setq regexp (or gnus-last-search-regexp ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3210 (setq gnus-last-search-regexp regexp))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3211 (if (gnus-summary-search-article regexp nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3212 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3213 (recenter 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3214 ;;(sit-for 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3215 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3216 (error "Search failed: \"%s\"" regexp)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3217 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3218
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3219 (defun gnus-summary-search-article-backward (regexp)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3220 "Search for an article containing REGEXP backward.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3221 `gnus-select-article-hook' is not called for articles examined
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3222 by searching search."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3223 (interactive
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3224 (list (read-string
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3225 (concat "Search backward (regexp): "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3226 (if gnus-last-search-regexp
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3227 (concat "(default " gnus-last-search-regexp ") "))))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3228 (if (string-equal regexp "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3229 (setq regexp (or gnus-last-search-regexp ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3230 (setq gnus-last-search-regexp regexp))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3231 (if (gnus-summary-search-article regexp t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3232 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3233 (recenter 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3234 ;;(sit-for 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3235 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3236 (error "Search failed: \"%s\"" regexp)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3237 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3238
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3239 (defun gnus-summary-search-article (regexp &optional backward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3240 "Search for an article containing REGEXP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3241 Optional argument BACKWARD means do search for backward.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3242 `gnus-select-article-hook' is not called for articles examined
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3243 by searching search."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3244 (let ((gnus-select-article-hook nil) ;Disable hook.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3245 (gnus-mark-article-hook nil) ;Inhibit marking as read.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3246 (re-search
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3247 (if backward
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3248 (function re-search-backward) (function re-search-forward)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3249 (found nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3250 (last nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3251 ;; 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
3252 (gnus-summary-show-all-threads)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3253 ;; First of all, search current article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3254 ;; We don't want to read article again from NNTP server nor reset
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3255 ;; current point.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3256 (gnus-summary-select-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3257 (message "Searching article: %d..." gnus-current-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3258 (setq last gnus-current-article)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3259 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3260 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3261 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3262 ;; Begin search from current point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3263 (setq found (funcall re-search regexp nil t))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3264 ;; Then search next articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3265 (while (and (not found)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3266 (gnus-summary-display-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3267 (gnus-summary-search-subject backward nil nil)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3268 (message "Searching article: %d..." gnus-current-article)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3269 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3270 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3271 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3272 (goto-char (if backward (point-max) (point-min)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3273 (setq found (funcall re-search regexp nil t)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3274 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3275 (message "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3276 ;; Adjust article pointer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3277 (or (eq last gnus-current-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3278 (setq gnus-last-article last))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3279 ;; Return T if found such article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3280 found
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3281 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3282
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3283 (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
3284 "If FIELD of article header matches REGEXP, execute a COMMAND string.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3285 If FIELD is an empty string (or nil), entire article body is searched for.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3286 If optional (prefix) argument BACKWARD is non-nil, do backward instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3287 (interactive
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3288 (list (let ((completion-ignore-case t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3289 (completing-read "Field name: "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3290 '(("Number")("Subject")("From")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3291 ("Lines")("Date")("Id")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3292 ("Xref")("References"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3293 nil 'require-match))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3294 (read-string "Regexp: ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3295 (read-key-sequence "Command: ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3296 current-prefix-arg))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3297 ;; 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
3298 (gnus-summary-show-all-threads)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3299 ;; We don't want to change current point nor window configuration.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3300 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3301 (save-window-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3302 (message "Executing %s..." (key-description command))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3303 ;; We'd like to execute COMMAND interactively so as to give arguments.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3304 (gnus-execute field regexp
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3305 (` (lambda ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3306 (call-interactively '(, (key-binding command)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3307 backward)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3308 (message "Executing %s...done" (key-description command)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3309
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3310 (defun gnus-summary-beginning-of-article ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3311 "Go to beginning of article body."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3312 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3313 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3314 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3315 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3316 (beginning-of-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3317 (if gnus-break-pages
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3318 (gnus-narrow-to-page))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3319 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3320
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3321 (defun gnus-summary-end-of-article ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3322 "Go to end of article body."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3323 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3324 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3325 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3326 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3327 (end-of-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3328 (if gnus-break-pages
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3329 (gnus-narrow-to-page))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3330 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3331
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3332 (defun gnus-summary-goto-article (article &optional all-headers)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3333 "Read article number ARTICLE if it exists.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3334 Optional argument ALL-HEADERS means show the full header."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3335 (interactive
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3336 (list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3337 (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3338 (completing-read "Article number: "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3339 (mapcar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3340 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3341 (lambda (headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3342 (list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3343 (int-to-string (nntp-header-number headers)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3344 gnus-newsgroup-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3345 nil 'require-match))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3346 (if (gnus-summary-goto-subject article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3347 (gnus-summary-display-article article all-headers)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3348
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3349 (defun gnus-summary-goto-last-article ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3350 "Go to last subject line."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3351 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3352 (if gnus-last-article
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3353 (gnus-summary-goto-article gnus-last-article)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3354
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3355 (defun gnus-summary-show-article ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3356 "Force to show current article."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3357 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3358 ;; The following is a trick to force to read the current article again.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3359 (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
3360 (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
3361
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3362 (defun gnus-summary-toggle-header (arg)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3363 "Show original header if pruned header currently shown, or vice versa.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3364 With arg, show original header iff arg is positive."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3365 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3366 ;; Variable gnus-show-all-headers must be NIL to toggle really.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3367 (let ((gnus-show-all-headers nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3368 (all-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3369 (if (null arg) (not gnus-have-all-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3370 (> (prefix-numeric-value arg) 0))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3371 (gnus-summary-select-article all-headers t)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3372
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3373 (defun gnus-summary-show-all-headers ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3374 "Show original article header."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3375 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3376 (gnus-summary-select-article t t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3377
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3378 (defun gnus-summary-toggle-mime (arg)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3379 "Toggle MIME processing.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3380 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
3381 (interactive "P")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3382 (setq gnus-show-mime
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3383 (if (null arg) (not gnus-show-mime)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3384 (> (prefix-numeric-value arg) 0)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3385 ;; 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
3386 (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
3387 (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
3388
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3389 (defun gnus-summary-stop-page-breaking ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3390 "Stop page breaking by linefeed temporary (widen article buffer)."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3391 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3392 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3393 (gnus-eval-in-buffer-window gnus-article-buffer
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3394 (widen)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3395 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3396
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3397 (defun gnus-summary-kill-same-subject-and-select (unmark)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3398 "Mark articles which has the same subject as read, and then select next.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3399 If argument UNMARK is positive, remove any kinds of marks.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3400 If argument UNMARK is negative, mark articles as unread instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3401 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3402 (if unmark
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3403 (setq unmark (prefix-numeric-value unmark)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3404 (let ((count
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3405 (gnus-summary-mark-same-subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3406 (gnus-summary-subject-string) unmark)))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3407 ;; Select next unread article. If auto-select-same mode, should
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3408 ;; select the first unread article.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3409 (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
3410 (gnus-summary-subject-string)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3411 (message "%d articles are marked as %s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3412 count (if unmark "unread" "read"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3413 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3414
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3415 (defun gnus-summary-kill-same-subject (unmark)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3416 "Mark articles which has the same subject as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3417 If argument UNMARK is positive, remove any kinds of marks.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3418 If argument UNMARK is negative, mark articles as unread instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3419 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3420 (if unmark
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3421 (setq unmark (prefix-numeric-value unmark)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3422 (let ((count
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3423 (gnus-summary-mark-same-subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3424 (gnus-summary-subject-string) unmark)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3425 ;; If marked as read, go to next unread subject.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3426 (if (null unmark)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3427 ;; Go to next unread subject.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3428 (gnus-summary-next-subject 1 t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3429 (message "%d articles are marked as %s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3430 count (if unmark "unread" "read"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3431 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3432
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3433 (defun gnus-summary-mark-same-subject (subject &optional unmark)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3434 "Mark articles with same SUBJECT as read, and return marked number.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3435 If optional argument UNMARK is positive, remove any kinds of marks.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3436 If optional argument UNMARK is negative, mark articles as unread instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3437 (let ((count 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3438 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3439 (cond ((null unmark)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3440 (gnus-summary-mark-as-read nil "K"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3441 ((> unmark 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3442 (gnus-summary-mark-as-unread nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3443 (t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3444 (gnus-summary-mark-as-unread)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3445 (while (and subject
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3446 (gnus-summary-search-forward nil subject))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3447 (cond ((null unmark)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3448 (gnus-summary-mark-as-read nil "K"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3449 ((> unmark 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3450 (gnus-summary-mark-as-unread nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3451 (t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3452 (gnus-summary-mark-as-unread)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3453 (setq count (1+ count))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3454 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3455 ;; Hide killed thread subtrees. Does not work properly always.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3456 ;;(and (null unmark)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3457 ;; gnus-thread-hide-killed
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3458 ;; (gnus-summary-hide-thread))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3459 ;; Return number of articles marked as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3460 count
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3461 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3462
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3463 (defun gnus-summary-mark-as-unread-forward (count)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3464 "Mark current article as unread, and then go forward.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3465 Argument COUNT specifies number of articles marked as unread."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3466 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3467 (while (> count 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3468 (gnus-summary-mark-as-unread nil nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3469 (gnus-summary-next-subject 1 nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3470 (setq count (1- count))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3471
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3472 (defun gnus-summary-mark-as-unread-backward (count)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3473 "Mark current article as unread, and then go backward.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3474 Argument COUNT specifies number of articles marked as unread."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3475 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3476 (while (> count 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3477 (gnus-summary-mark-as-unread nil nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3478 (gnus-summary-prev-subject 1 nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3479 (setq count (1- count))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3480
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3481 (defun gnus-summary-mark-as-unread (&optional article clear-mark)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3482 "Mark current article as unread.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3483 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
3484 Optional 2nd argument CLEAR-MARK remove any kinds of mark."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3485 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3486 (set-buffer gnus-summary-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3487 ;; First of all, show hidden thread subtrees.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3488 (gnus-summary-show-thread)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3489 (let* ((buffer-read-only nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3490 (current (gnus-summary-article-number))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3491 (article (or article current)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3492 (gnus-mark-article-as-unread article clear-mark)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3493 (if (or (eq article current)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3494 (gnus-summary-goto-subject article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3495 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3496 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3497 (delete-char 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3498 (insert (if clear-mark " " "-"))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3499 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3500
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3501 (defun gnus-summary-mark-as-read-forward (count)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3502 "Mark current article as read, and then go forward.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3503 Argument COUNT specifies number of articles marked as read."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3504 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3505 (while (> count 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3506 (gnus-summary-mark-as-read)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3507 (gnus-summary-next-subject 1 'unread-only)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3508 (setq count (1- count))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3509
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3510 (defun gnus-summary-mark-as-read-backward (count)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3511 "Mark current article as read, and then go backward.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3512 Argument COUNT specifies number of articles marked as read."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3513 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3514 (while (> count 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3515 (gnus-summary-mark-as-read)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3516 (gnus-summary-prev-subject 1 'unread-only)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3517 (setq count (1- count))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3518
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3519 (defun gnus-summary-mark-as-read (&optional article mark)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3520 "Mark current article as read.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3521 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
3522 Optional 2nd argument MARK specifies a string inserted at beginning of line.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3523 Any kind of string (length 1) except for a space and `-' is ok."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3524 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3525 (set-buffer gnus-summary-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3526 ;; First of all, show hidden thread subtrees.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3527 (gnus-summary-show-thread)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3528 (let* ((buffer-read-only nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3529 (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
3530 (current (gnus-summary-article-number))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3531 (article (or article current)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3532 (gnus-mark-article-as-read article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3533 (if (or (eq article current)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3534 (gnus-summary-goto-subject article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3535 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3536 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3537 (delete-char 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3538 (insert mark)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3539 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3540
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3541 (defun gnus-summary-clear-mark-forward (count)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3542 "Remove current article's mark, and go forward.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3543 Argument COUNT specifies number of articles unmarked."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3544 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3545 (while (> count 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3546 (gnus-summary-mark-as-unread nil t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3547 (gnus-summary-next-subject 1 nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3548 (setq count (1- count))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3549
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3550 (defun gnus-summary-clear-mark-backward (count)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3551 "Remove current article's mark, and go backward.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3552 Argument COUNT specifies number of articles unmarked."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3553 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3554 (while (> count 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3555 (gnus-summary-mark-as-unread nil t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3556 (gnus-summary-prev-subject 1 nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3557 (setq count (1- count))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3558
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3559 (defun gnus-summary-delete-marked-as-read ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3560 "Delete summary lines for articles that are marked as read."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3561 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3562 (if gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3563 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3564 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3565 (goto-char (point-min))
6309
9217f29851c2 Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents: 5911
diff changeset
3566 (delete-non-matching-lines "^[- ]"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3567 ;; Adjust point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3568 (if (eobp)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3569 (gnus-summary-prev-subject 1)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3570 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3571 (search-forward ":" nil t)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3572 ;; It is not so good idea to make the buffer empty.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3573 (message "All articles are marked as read")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3574 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3575
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3576 (defun gnus-summary-delete-marked-with (marks)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3577 "Delete lines which are marked with MARKS (e.g. \"DK\")."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3578 (interactive "sMarks: ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3579 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3580 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3581 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3582 (delete-matching-lines (concat "^[" marks "]")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3583 ;; Adjust point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3584 (or (zerop (buffer-size))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3585 (if (eobp)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3586 (gnus-summary-prev-subject 1)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3587 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3588 (search-forward ":" nil t)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3589 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3590
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3591 ;; Thread-based commands.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3592
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3593 (defun gnus-summary-toggle-threads (arg)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3594 "Toggle showing conversation threads.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3595 With arg, turn showing conversation threads on iff arg is positive."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3596 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3597 (let ((current (gnus-summary-article-number)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3598 (setq gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3599 (if (null arg) (not gnus-show-threads)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3600 (> (prefix-numeric-value arg) 0)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3601 (gnus-summary-prepare)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3602 (gnus-summary-goto-subject current)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3603 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3604
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3605 (defun gnus-summary-show-all-threads ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3606 "Show all thread subtrees."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3607 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3608 (if gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3609 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3610 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3611 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3612 ))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3613
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3614 (defun gnus-summary-show-thread ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3615 "Show thread subtrees."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3616 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3617 (if gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3618 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3619 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3620 (subst-char-in-region (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3621 (beginning-of-line) (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3622 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3623 (end-of-line) (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3624 ?\^M ?\n t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3625 ))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3626
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3627 (defun gnus-summary-hide-all-threads ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3628 "Hide all thread subtrees."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3629 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3630 (if gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3631 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3632 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3633 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3634 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3635 (let ((level (current-column)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3636 (gnus-summary-hide-thread)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3637 (while (gnus-summary-search-forward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3638 (and (>= level (current-column))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3639 (gnus-summary-hide-thread)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3640 ))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3641
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3642 (defun gnus-summary-hide-thread ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3643 "Hide thread subtrees."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3644 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3645 (if gnus-show-threads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3646 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3647 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3648 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3649 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3650 (let ((buffer-read-only nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3651 (init (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3652 (last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3653 (level (current-column)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3654 (while (and (gnus-summary-search-forward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3655 (< level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3656 ;; Interested in lower levels.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3657 (if (< level (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3658 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3659 (setq last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3660 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3661 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3662 (subst-char-in-region init last ?\n ?\^M t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3663 ))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3664
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3665 (defun gnus-summary-next-thread (n)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3666 "Go to the same level next thread.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3667 Argument N specifies the number of threads."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3668 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3669 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3670 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3671 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3672 (let ((init (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3673 (last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3674 (level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3675 (while (and (> n 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3676 (gnus-summary-search-forward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3677 (<= level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3678 ;; We have to skip lower levels.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3679 (if (= level (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3680 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3681 (setq last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3682 (setq n (1- n))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3683 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3684 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3685 ;; Return non-nil if successfully move to the next.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3686 (prog1 (not (= init last))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3687 (goto-char last))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3688 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3689
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3690 (defun gnus-summary-prev-thread (n)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3691 "Go to the same level previous thread.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3692 Argument N specifies the number of threads."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3693 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3694 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3695 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3696 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3697 (let ((init (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3698 (last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3699 (level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3700 (while (and (> n 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3701 (gnus-summary-search-backward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3702 (<= level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3703 ;; We have to skip lower levels.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3704 (if (= level (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3705 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3706 (setq last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3707 (setq n (1- n))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3708 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3709 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3710 ;; Return non-nil if successfully move to the previous.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3711 (prog1 (not (= init last))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3712 (goto-char last))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3713 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3714
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3715 (defun gnus-summary-down-thread (d)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3716 "Go downward current thread.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3717 Argument D specifies the depth goes down."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3718 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3719 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3720 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3721 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3722 (let ((last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3723 (level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3724 (while (and (> d 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3725 (gnus-summary-search-forward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3726 (<= level (current-column))) ;<= can be <. Which do you like?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3727 ;; We have to skip the same levels.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3728 (if (< level (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3729 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3730 (setq last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3731 (setq level (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3732 (setq d (1- d))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3733 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3734 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3735 (goto-char last)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3736 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3737
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3738 (defun gnus-summary-up-thread (d)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3739 "Go upward current thread.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3740 Argument D specifies the depth goes up."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3741 (interactive "p")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3742 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3743 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3744 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3745 (let ((last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3746 (level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3747 (while (and (> d 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3748 (gnus-summary-search-backward))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3749 ;; We have to skip the same levels.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3750 (if (> level (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3751 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3752 (setq last (point))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3753 (setq level (current-column))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3754 (setq d (1- d))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3755 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3756 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3757 (goto-char last)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3758 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3759
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3760 (defun gnus-summary-kill-thread (unmark)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3761 "Mark articles under current thread as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3762 If argument UNMARK is positive, remove any kinds of marks.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3763 If argument UNMARK is negative, mark articles as unread instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3764 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3765 (if unmark
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3766 (setq unmark (prefix-numeric-value unmark)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3767 ;; Adjust cursor point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3768 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3769 (search-forward ":" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3770 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3771 (let ((level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3772 ;; Mark current article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3773 (cond ((null unmark)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3774 (gnus-summary-mark-as-read nil "K"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3775 ((> unmark 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3776 (gnus-summary-mark-as-unread nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3777 (t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3778 (gnus-summary-mark-as-unread))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3779 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3780 ;; Mark following articles.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3781 (while (and (gnus-summary-search-forward)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3782 (< level (current-column)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3783 (cond ((null unmark)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3784 (gnus-summary-mark-as-read nil "K"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3785 ((> unmark 0)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3786 (gnus-summary-mark-as-unread nil t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3787 (t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3788 (gnus-summary-mark-as-unread))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3789 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3790 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3791 ;; Hide killed subtrees.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3792 (and (null unmark)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3793 gnus-thread-hide-killed
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3794 (gnus-summary-hide-thread))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3795 ;; If marked as read, go to next unread subject.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3796 (if (null unmark)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3797 ;; Go to next unread subject.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3798 (gnus-summary-next-subject 1 t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3799 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3800
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3801 (defun gnus-summary-toggle-truncation (arg)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3802 "Toggle truncation of summary lines.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3803 With arg, turn line truncation on iff arg is positive."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3804 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3805 (setq truncate-lines
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3806 (if (null arg) (not truncate-lines)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3807 (> (prefix-numeric-value arg) 0)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3808 (redraw-display))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3809
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3810 (defun gnus-summary-sort-by-number (reverse)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3811 "Sort Summary buffer by article number.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3812 Argument REVERSE means reverse order."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3813 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3814 (gnus-summary-keysort-summary
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3815 (function <)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3816 (function
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3817 (lambda (a)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3818 (nntp-header-number a)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3819 reverse
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3820 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3821
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3822 (defun gnus-summary-sort-by-author (reverse)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3823 "Sort Summary buffer by author name alphabetically.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3824 If case-fold-search is non-nil, case of letters is ignored.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3825 Argument REVERSE means reverse order."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3826 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3827 (gnus-summary-keysort-summary
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3828 (function string-lessp)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3829 (function
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3830 (lambda (a)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3831 (if case-fold-search
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3832 (downcase (nntp-header-from a))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3833 (nntp-header-from a))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3834 reverse
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3835 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3836
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3837 (defun gnus-summary-sort-by-subject (reverse)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3838 "Sort Summary buffer by subject alphabetically. `Re:'s are ignored.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3839 If case-fold-search is non-nil, case of letters is ignored.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3840 Argument REVERSE means reverse order."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3841 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3842 (gnus-summary-keysort-summary
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3843 (function string-lessp)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3844 (function
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3845 (lambda (a)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3846 (if case-fold-search
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3847 (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
3848 (gnus-simplify-subject (nntp-header-subject a) 're-only))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3849 reverse
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3850 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3851
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3852 (defun gnus-summary-sort-by-date (reverse)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3853 "Sort Summary buffer by date.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3854 Argument REVERSE means reverse order."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3855 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3856 (gnus-summary-keysort-summary
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3857 (function string-lessp)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3858 (function
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3859 (lambda (a)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3860 (gnus-sortable-date (nntp-header-date a))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3861 reverse
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3862 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3863
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3864 (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
3865 "Sort Summary buffer by PREDICATE using a value passed by KEY.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3866 Optional argument REVERSE means reverse order."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3867 (let ((current (gnus-summary-article-number)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3868 (gnus-keysort-headers predicate key reverse)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3869 (gnus-summary-prepare)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3870 (gnus-summary-goto-subject current)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3871 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3872
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3873 (defun gnus-summary-sort-summary (predicate &optional reverse)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3874 "Sort Summary buffer by PREDICATE.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3875 Optional argument REVERSE means reverse order."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3876 (let ((current (gnus-summary-article-number)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3877 (gnus-sort-headers predicate reverse)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3878 (gnus-summary-prepare)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3879 (gnus-summary-goto-subject current)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3880 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3881
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3882 (defun gnus-summary-reselect-current-group (show-all)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3883 "Once exit and then reselect the current newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3884 Prefix argument SHOW-ALL means to select all articles."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3885 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3886 (let ((current-subject (gnus-summary-article-number)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3887 (gnus-summary-exit t)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3888 ;; We have to adjust the point of Group mode buffer because the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3889 ;; current point was moved to the next unread newsgroup by
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3890 ;; exiting.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3891 (gnus-summary-jump-to-group gnus-newsgroup-name)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3892 (gnus-group-read-group show-all t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3893 (gnus-summary-goto-subject current-subject)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3894 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3895
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3896 (defun gnus-summary-caesar-message (rotnum)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3897 "Caesar rotates all letters of current message by 13/47 places.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3898 With prefix arg, specifies the number of places to rotate each letter forward.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3899 Caesar rotates Japanese letters by 47 places in any case."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3900 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3901 (gnus-summary-select-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3902 (gnus-overload-functions)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3903 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3904 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3905 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3906 ;; We don't want to jump to the beginning of the message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3907 ;; `save-excursion' does not do its job.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3908 (move-to-window-line 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3909 (let ((last (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3910 (news-caesar-buffer-body rotnum)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3911 (goto-char last)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3912 (recenter 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3913 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3914 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3915
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3916 (defun gnus-summary-rmail-digest ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3917 "Run RMAIL on current digest article.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3918 `gnus-select-digest-hook' will be called with no arguments, if that
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3919 value is non-nil. It is possible to modify the article so that Rmail
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3920 can work with it.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3921 `gnus-rmail-digest-hook' will be called with no arguments, if that value
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
3922 is non-nil. The hook is intended to customize Rmail mode."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3923 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3924 (gnus-summary-select-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3925 (require 'rmail)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3926 (let ((artbuf gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3927 (digbuf (get-buffer-create gnus-digest-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3928 (mail-header-separator ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3929 (set-buffer digbuf)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3930 (buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3931 (setq buffer-read-only nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3932 (erase-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3933 (insert-buffer-substring artbuf)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3934 (run-hooks 'gnus-select-digest-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3935 (gnus-convert-article-to-rmail)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3936 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3937 ;; Rmail initializations.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3938 (rmail-insert-rmail-file-header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3939 (rmail-mode)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3940 (rmail-set-message-counters)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3941 (rmail-show-message)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3942 (condition-case ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3943 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3944 (undigestify-rmail-message)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3945 (rmail-expunge) ;Delete original message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3946 ;; File name is meaningless but `save-buffer' requires it.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3947 (setq buffer-file-name "GNUS Digest")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3948 (setq mode-line-buffer-identification
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3949 (concat "Digest: "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3950 (nntp-header-subject gnus-current-headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3951 ;; There is no need to write this buffer to a file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3952 (make-local-variable 'write-file-hooks)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3953 (setq write-file-hooks
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3954 (list (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3955 (lambda ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3956 (set-buffer-modified-p nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3957 (message "(No changes need to be saved)")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3958 'no-need-to-write-this-buffer))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3959 ;; Default file name saving digest messages.
7560
e63efa2d587c rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents: 7524
diff changeset
3960 (setq rmail-default-rmail-file
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3961 (funcall gnus-rmail-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3962 gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3963 gnus-current-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3964 gnus-newsgroup-last-rmail
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3965 ))
7560
e63efa2d587c rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents: 7524
diff changeset
3966 (setq rmail-default-file
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3967 (funcall gnus-mail-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3968 gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3969 gnus-current-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3970 gnus-newsgroup-last-mail
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3971 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3972 ;; Prevent generating new buffer named ***<N> each time.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3973 (setq rmail-summary-buffer
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3974 (get-buffer-create gnus-digest-summary-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3975 (run-hooks 'gnus-rmail-digest-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3976 ;; Take all windows safely.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3977 (gnus-configure-windows '(1 0 0))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3978 (pop-to-buffer gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3979 ;; Use Summary Article windows for Digest summary and
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3980 ;; Digest buffers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3981 (if gnus-digest-show-summary
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3982 (let ((gnus-summary-buffer gnus-digest-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3983 (gnus-article-buffer gnus-digest-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3984 (gnus-configure-windows 'article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3985 (pop-to-buffer gnus-digest-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3986 (rmail-summary)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3987 (pop-to-buffer gnus-digest-summary-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3988 (message (substitute-command-keys
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3989 "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
3990 (let ((gnus-summary-buffer gnus-digest-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3991 (gnus-configure-windows 'summary)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3992 (pop-to-buffer gnus-digest-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3993 (message (substitute-command-keys
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3994 "Type \\[rmail-quit] to return to GNUS")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3995 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3996 ;; 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
3997 (bury-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3998 (bury-buffer gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
3999 (bury-buffer gnus-digest-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4000 (bury-buffer gnus-digest-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4001 (error (set-buffer-modified-p nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4002 (kill-buffer digbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4003 ;; This command should not signal an error because the
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4004 ;; command is called from hooks.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4005 (ding) (message "Article is not a digest")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4006 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4007
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4008 (defun gnus-summary-save-article ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4009 "Save this article using default saver function.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4010 The variable `gnus-default-article-saver' specifies the saver function."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4011 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4012 (gnus-summary-select-article gnus-save-all-headers gnus-save-all-headers)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4013 (if gnus-default-article-saver
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4014 (call-interactively gnus-default-article-saver)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4015 (error "No default saver is defined.")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4016
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4017 (defun gnus-summary-save-in-rmail (&optional filename)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4018 "Append this article to Rmail file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4019 Optional argument FILENAME specifies file name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4020 Directory to save to is default to `gnus-article-save-directory' which
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4021 is initialized from the SAVEDIR environment variable."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4022 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4023 (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
4024 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4025 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4026 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4027 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4028 (let ((default-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4029 (funcall gnus-rmail-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4030 gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4031 gnus-current-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4032 gnus-newsgroup-last-rmail
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4033 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4034 (or filename
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4035 (setq filename
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4036 (read-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4037 (concat "Save article in Rmail file: (default "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4038 (file-name-nondirectory default-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4039 ") ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4040 (file-name-directory default-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4041 default-name)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4042 (gnus-make-directory (file-name-directory filename))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4043 (gnus-output-to-rmail filename)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4044 ;; Remember the directory name to save articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4045 (setq gnus-newsgroup-last-rmail filename)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4046 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4047 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4048
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4049 (defun gnus-summary-save-in-mail (&optional filename)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4050 "Append this article to Unix mail file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4051 Optional argument FILENAME specifies file name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4052 Directory to save to is default to `gnus-article-save-directory' which
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4053 is initialized from the SAVEDIR environment variable."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4054 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4055 (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
4056 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4057 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4058 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4059 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4060 (let ((default-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4061 (funcall gnus-mail-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4062 gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4063 gnus-current-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4064 gnus-newsgroup-last-mail
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4065 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4066 (or filename
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4067 (setq filename
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4068 (read-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4069 (concat "Save article in Unix mail file: (default "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4070 (file-name-nondirectory default-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4071 ") ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4072 (file-name-directory default-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4073 default-name)))
5052
b605cd28d596 (gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents: 5012
diff changeset
4074 (setq filename
b605cd28d596 (gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents: 5012
diff changeset
4075 (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
4076 (and default-name
b605cd28d596 (gnus-summary-save-in-mail): Don't use rmail-output.
Richard M. Stallman <rms@gnu.org>
parents: 5012
diff changeset
4077 (file-name-directory default-name))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4078 (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
4079 (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
4080 (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
4081 (rmail-output filename 1 t t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4082 ;; Remember the directory name to save articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4083 (setq gnus-newsgroup-last-mail filename)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4084 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4085 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4086
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4087 (defun gnus-summary-save-in-file (&optional filename)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4088 "Append this article to file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4089 Optional argument FILENAME specifies file name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4090 Directory to save to is default to `gnus-article-save-directory' which
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4091 is initialized from the SAVEDIR environment variable."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4092 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4093 (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
4094 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4095 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4096 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4097 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4098 (let ((default-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4099 (funcall gnus-file-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4100 gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4101 gnus-current-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4102 gnus-newsgroup-last-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4103 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4104 (or filename
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4105 (setq filename
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4106 (read-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4107 (concat "Save article in file: (default "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4108 (file-name-nondirectory default-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4109 ") ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4110 (file-name-directory default-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4111 default-name)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4112 (gnus-make-directory (file-name-directory filename))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4113 (gnus-output-to-file filename)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4114 ;; Remember the directory name to save articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4115 (setq gnus-newsgroup-last-file filename)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4116 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4117 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4118
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4119 (defun gnus-summary-save-in-folder (&optional folder)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4120 "Save this article to MH folder (using `rcvstore' in MH library).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4121 Optional argument FOLDER specifies folder name."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4122 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4123 (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
4124 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4125 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4126 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4127 ;; Thanks to yuki@flab.Fujitsu.JUNET and ohm@kaba.junet.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4128 (mh-find-path)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4129 (let ((folder
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4130 (or folder
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4131 (mh-prompt-for-folder "Save article in"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4132 (funcall gnus-folder-save-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4133 gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4134 gnus-current-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4135 gnus-newsgroup-last-folder
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4136 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4137 t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4138 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4139 (errbuf (get-buffer-create " *GNUS rcvstore*")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4140 (unwind-protect
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4141 (call-process-region (point-min) (point-max)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4142 (expand-file-name "rcvstore" mh-lib)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4143 nil errbuf nil folder)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4144 (set-buffer errbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4145 (if (zerop (buffer-size))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4146 (message "Article saved in folder: %s" folder)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4147 (message "%s" (buffer-string)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4148 (kill-buffer errbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4149 (setq gnus-newsgroup-last-folder folder))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4150 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4151 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4152
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4153 (defun gnus-summary-pipe-output ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4154 "Pipe this article to subprocess."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4155 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4156 ;; 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
4157 ;;(gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4158 ;; Huuum. Is this right?
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4159 (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
4160 (gnus-eval-in-buffer-window gnus-article-buffer
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4161 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4162 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4163 (let ((command (read-string "Shell command on article: "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4164 gnus-last-shell-command)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4165 (if (string-equal command "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4166 (setq command gnus-last-shell-command))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4167 (shell-command-on-region (point-min) (point-max) command nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4168 (setq gnus-last-shell-command command)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4169 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4170 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4171
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4172 (defun gnus-summary-catchup (all &optional quietly)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4173 "Mark all articles not marked as unread in this newsgroup as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4174 If prefix argument ALL is non-nil, all articles are marked as read."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4175 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4176 (if (or quietly
7705
b10cc49f6c37 (gnus-summary-catchup): Check gnus-interactive-catchup.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
4177 (not gnus-interactive-catchup) ;Without confirmation?
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4178 (y-or-n-p
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4179 (if all
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4180 "Do you really want to mark everything as read? "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4181 "Delete all articles not marked as unread? ")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4182 (let ((unmarked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4183 (gnus-set-difference gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4184 (if (not all) gnus-newsgroup-marked))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4185 (message "") ;Erase "Yes or No" question.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4186 ;; Hidden thread subtrees must be searched for ,too.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4187 (gnus-summary-show-all-threads)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4188 (while unmarked
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4189 (gnus-summary-mark-as-read (car unmarked) "C")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4190 (setq unmarked (cdr unmarked))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4191 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4192 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4193
8046
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4194 (defun gnus-summary-catchup-to-here ()
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4195 "Mark all articles before the current one in this newsgroup as read."
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4196 (interactive)
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4197 (beginning-of-line)
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4198 (let ((current (gnus-summary-article-number)))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4199 (beginning-of-buffer)
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4200 (while (not (= (gnus-summary-article-number) current))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4201 (gnus-summary-mark-as-read)
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4202 (gnus-summary-next-subject 1))))
4fca34ed47e4 (gnus-summary-mode-map): Add menu bar menus.
Richard M. Stallman <rms@gnu.org>
parents: 7974
diff changeset
4203
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4204 (defun gnus-summary-catchup-all (&optional quietly)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4205 "Mark all articles in this newsgroup as read."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4206 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4207 (gnus-summary-catchup t quietly))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4208
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4209 (defun gnus-summary-catchup-and-exit (all &optional quietly)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4210 "Mark all articles not marked as unread in this newsgroup as read, then exit.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4211 If prefix argument ALL is non-nil, all articles are marked as read."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4212 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4213 (if (or quietly
7705
b10cc49f6c37 (gnus-summary-catchup): Check gnus-interactive-catchup.
Richard M. Stallman <rms@gnu.org>
parents: 7639
diff changeset
4214 (not gnus-interactive-catchup) ;Without confirmation?
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4215 (y-or-n-p
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4216 (if all
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4217 "Do you really want to mark everything as read? "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4218 "Delete all articles not marked as unread? ")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4219 (let ((unmarked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4220 (gnus-set-difference gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4221 (if (not all) gnus-newsgroup-marked))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4222 (message "") ;Erase "Yes or No" question.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4223 (while unmarked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4224 (gnus-mark-article-as-read (car unmarked))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4225 (setq unmarked (cdr unmarked)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4226 ;; Select next newsgroup or exit.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4227 (cond ((eq gnus-auto-select-next 'quietly)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4228 ;; Select next newsgroup quietly.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4229 (gnus-summary-next-group nil))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4230 (t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4231 (gnus-summary-exit)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4232 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4233
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4234 (defun gnus-summary-catchup-all-and-exit (&optional quietly)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4235 "Mark all articles in this newsgroup as read, and then exit."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4236 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4237 (gnus-summary-catchup-and-exit t quietly))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4238
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4239 (defun gnus-summary-edit-global-kill ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4240 "Edit a global KILL file."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4241 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4242 (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
4243 (gnus-kill-file-edit-file nil) ;Nil stands for global KILL file.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4244 (message
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4245 (substitute-command-keys
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4246 "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
4247
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4248 (defun gnus-summary-edit-local-kill ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4249 "Edit a local KILL file applied to the current newsgroup."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4250 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4251 (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
4252 (gnus-kill-file-edit-file gnus-newsgroup-name)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4253 (message
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4254 (substitute-command-keys
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4255 "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
4256
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4257 (defun gnus-summary-exit (&optional temporary)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4258 "Exit reading current newsgroup, and then return to group selection mode.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4259 `gnus-exit-group-hook' is called with no arguments if that value is non-nil."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4260 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4261 (let ((updated nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4262 (gnus-newsgroup-headers gnus-newsgroup-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4263 (gnus-newsgroup-unreads gnus-newsgroup-unreads)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4264 (gnus-newsgroup-unselected gnus-newsgroup-unselected)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4265 (gnus-newsgroup-marked gnus-newsgroup-marked))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4266 ;; 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
4267 ;; Summary buffer even if hook changes them.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4268 (run-hooks 'gnus-exit-group-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4269 (gnus-update-unread-articles gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4270 (append gnus-newsgroup-unselected
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4271 gnus-newsgroup-unreads)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4272 gnus-newsgroup-marked)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4273 ;; T means ignore unsubscribed newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4274 (if gnus-use-cross-reference
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4275 (setq updated
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4276 (gnus-mark-as-read-by-xref gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4277 gnus-newsgroup-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4278 gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4279 (eq gnus-use-cross-reference t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4280 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4281 ;; 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
4282 (set-buffer gnus-group-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4283 ;; Update cross referenced group info.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4284 (while updated
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4285 (gnus-group-update-group (car updated) t) ;Ignore invisible group.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4286 (setq updated (cdr updated)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4287 (gnus-group-update-group gnus-newsgroup-name))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4288 ;; 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
4289 (gnus-group-jump-to-group gnus-newsgroup-name)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4290 (gnus-group-next-unread-group 1)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4291 (if temporary
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4292 ;; If exiting temporary, caller should adjust Group mode
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4293 ;; buffer point by itself.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4294 nil ;Nothing to do.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4295 ;; Return to Group mode buffer.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4296 (if (get-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4297 (bury-buffer gnus-summary-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4298 (if (get-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4299 (bury-buffer gnus-article-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4300 (gnus-configure-windows 'newsgroups)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4301 (pop-to-buffer gnus-group-buffer)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4302
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4303 (defun gnus-summary-quit ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4304 "Quit reading current newsgroup without updating read article info."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4305 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4306 (if (y-or-n-p "Do you really wanna quit reading this group? ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4307 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4308 (message "") ;Erase "Yes or No" question.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4309 ;; Return to Group selection mode.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4310 (if (get-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4311 (bury-buffer gnus-summary-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4312 (if (get-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4313 (bury-buffer gnus-article-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4314 (gnus-configure-windows 'newsgroups)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4315 (pop-to-buffer gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4316 (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
4317 (gnus-group-next-group 1) ;(gnus-group-next-unread-group 1)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4318 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4319
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4320 (defun gnus-summary-describe-briefly ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4321 "Describe Summary mode commands briefly."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4322 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4323 (message
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4324 (concat
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4325 (substitute-command-keys "\\[gnus-summary-next-page]:Select ")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4326 (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
4327 (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
4328 (substitute-command-keys "\\[gnus-summary-exit]:Exit ")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4329 (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
4330 (substitute-command-keys "\\[gnus-summary-describe-briefly]:This help")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4331 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4332
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4333
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4334 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4335 ;;; GNUS Article Mode
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4336 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4337
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4338 (if gnus-article-mode-map
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4339 nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4340 (setq gnus-article-mode-map (make-keymap))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4341 (suppress-keymap gnus-article-mode-map)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4342 (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
4343 (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
4344 (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
4345 (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
4346 (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
4347 (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
4348 (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
4349 (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
4350
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4351 (defun gnus-article-mode ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4352 "Major mode for browsing through an article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4353 All normal editing commands are turned off.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4354 Instead, these commands are available:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4355 \\{gnus-article-mode-map}
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4356
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4357 Various hooks for customization:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4358 gnus-article-mode-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4359 Entry to this mode calls the value with no arguments, if that
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4360 value is non-nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4361
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4362 gnus-article-prepare-hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4363 Called with no arguments after an article is prepared for reading,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4364 if that value is non-nil."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4365 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4366 (kill-all-local-variables)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4367 ;; Gee. Why don't you upgrade?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4368 (cond ((boundp 'mode-line-modified)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4369 (setq mode-line-modified "--- "))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4370 ((listp (default-value 'mode-line-format))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4371 (setq mode-line-format
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4372 (cons "--- " (cdr (default-value 'mode-line-format))))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4373 ;; To disable display-time facility.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4374 ;;(make-local-variable 'global-mode-string)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4375 ;;(setq global-mode-string nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4376 (setq major-mode 'gnus-article-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4377 (setq mode-name "Article")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4378 (make-local-variable 'minor-mode-alist)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4379 (or (assq 'gnus-show-mime minor-mode-alist)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4380 (setq minor-mode-alist
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4381 (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
4382 (gnus-article-set-mode-line)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4383 (use-local-map gnus-article-mode-map)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4384 (make-local-variable 'page-delimiter)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4385 (setq page-delimiter gnus-page-delimiter)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4386 (make-local-variable 'mail-header-separator)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4387 (setq mail-header-separator "") ;For caesar function.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4388 (buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4389 (setq buffer-read-only t) ;Disable modification
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4390 (run-hooks 'gnus-article-mode-hook))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4391
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4392 (defun gnus-article-setup-buffer ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4393 "Initialize Article mode buffer."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4394 (or (get-buffer gnus-article-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4395 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4396 (set-buffer (get-buffer-create gnus-article-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4397 (gnus-article-mode))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4398 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4399
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4400 (defun gnus-article-prepare (article &optional all-headers)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4401 "Prepare ARTICLE in Article mode buffer.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4402 ARTICLE can be either a article number or Message-ID.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4403 If optional argument ALL-HEADERS is non-nil,
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4404 include the article's whole original header."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4405 ;; 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
4406 (if (not (gnus-server-opened))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4407 (progn
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4408 (gnus-start-news-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4409 (gnus-request-group gnus-newsgroup-name)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4410 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4411 (set-buffer gnus-article-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4412 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4413 (erase-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4414 ;; 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
4415 ;; 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
4416 ;; nnspool too.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4417 ;; 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
4418 ;; 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
4419 ;; in the following.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4420 (if (let* ((header
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4421 (and (stringp article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4422 (gnus-get-header-by-id article)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4423 (article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4424 (if header
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4425 (nntp-header-number header) article)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4426 (gnus-request-article article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4427 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4428 ;; Prepare article buffer
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4429 (insert-buffer-substring nntp-server-buffer)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4430 ;; 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
4431 (setq gnus-have-all-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4432 (not (not (or all-headers gnus-show-all-headers))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4433 (if (and (numberp article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4434 (not (eq article gnus-current-article)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4435 ;; Seems me that a new article has been selected.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4436 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4437 ;; gnus-current-article must be an article number.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4438 (setq gnus-last-article gnus-current-article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4439 (setq gnus-current-article article)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4440 ;; (setq gnus-current-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4441 ;; (gnus-find-header-by-number gnus-newsgroup-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4442 ;; gnus-current-article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4443 (setq gnus-current-headers
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4444 (gnus-get-header-by-number gnus-current-article))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4445 (run-hooks 'gnus-mark-article-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4446 ))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4447 ;; Clear article history only when the article is
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4448 ;; retrieved by the article number.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4449 (if (numberp article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4450 (setq gnus-current-history nil))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4451 ;; Hooks for modifying contents of the article. This hook
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4452 ;; must be called before being narrowed.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4453 (run-hooks 'gnus-article-prepare-hook)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4454 ;; Decode MIME message.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4455 (if (and gnus-show-mime
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4456 (gnus-fetch-field "Mime-Version"))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4457 (funcall gnus-show-mime-method))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4458 ;; Delete unnecessary headers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4459 (or gnus-have-all-headers
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4460 (gnus-article-delete-headers))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4461 ;; Do page break.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4462 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4463 (if gnus-break-pages
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4464 (gnus-narrow-to-page))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4465 ;; Next function must be called after setting
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4466 ;; `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
4467 (gnus-article-set-mode-line)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4468 )
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4469 ;; There is no such article.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4470 (if (numberp article)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4471 (gnus-summary-mark-as-read article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4472 (ding) (message "No such article (may be canceled)"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4473 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4474
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4475 (defun gnus-article-show-all-headers ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4476 "Show all article headers in Article mode buffer."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4477 (or gnus-have-all-headers
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4478 (gnus-article-prepare gnus-current-article t)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4479
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4480 ;;(defun gnus-article-set-mode-line ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4481 ;; "Set Article mode line string."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4482 ;; (setq mode-line-buffer-identification
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4483 ;; (list 17
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4484 ;; (format "GNUS: %s {%d-%d} %d"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4485 ;; gnus-newsgroup-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4486 ;; gnus-newsgroup-begin
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4487 ;; gnus-newsgroup-end
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4488 ;; gnus-current-article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4489 ;; )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4490 ;; (set-buffer-modified-p t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4491
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4492 ;;(defun gnus-article-set-mode-line ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4493 ;; "Set Article mode line string."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4494 ;; (let ((unmarked
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4495 ;; (- (length gnus-newsgroup-unreads)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4496 ;; (length (gnus-intersection
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4497 ;; gnus-newsgroup-unreads gnus-newsgroup-marked))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4498 ;; (unselected
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4499 ;; (- (length gnus-newsgroup-unselected)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4500 ;; (length (gnus-intersection
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4501 ;; gnus-newsgroup-unselected gnus-newsgroup-marked)))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4502 ;; (setq mode-line-buffer-identification
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4503 ;; (list 17
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4504 ;; (format "GNUS: %s{%d} %s"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4505 ;; gnus-newsgroup-name
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4506 ;; gnus-current-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4507 ;; ;; This is proposed by tale@pawl.rpi.edu.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4508 ;; (cond ((and (zerop unmarked)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4509 ;; (zerop unselected))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4510 ;; " ")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4511 ;; ((zerop unselected)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4512 ;; (format "%d more" unmarked))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4513 ;; (t
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4514 ;; (format "%d(+%d) more" unmarked unselected)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4515 ;; ))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4516 ;; (set-buffer-modified-p t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4517
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4518 ;; New implementation in gnus 3.14.3
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4519
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4520 (defun gnus-article-set-mode-line ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4521 "Set Article mode line string.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4522 If you don't like it, define your own `gnus-article-set-mode-line'."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4523 (let ((maxlen 15) ;Maximum subject length
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4524 (subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4525 (if gnus-current-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4526 (nntp-header-subject gnus-current-headers) "")))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4527 ;; The value must be a string to escape %-constructs because of subject.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4528 (setq mode-line-buffer-identification
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4529 (format "GNUS: %s%s %s%s%s"
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4530 gnus-newsgroup-name
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4531 (if gnus-current-article
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4532 (format "/%d" gnus-current-article) "")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4533 (substring subject 0 (min (length subject) maxlen))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4534 (if (> (length subject) maxlen) "..." "")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4535 (make-string (max 0 (- 17 (length subject))) ? )
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4536 )))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4537 (set-buffer-modified-p t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4538
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4539 (defun gnus-article-delete-headers ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4540 "Delete unnecessary headers."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4541 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4542 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4543 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4544 (narrow-to-region (point-min)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4545 (progn (search-forward "\n\n" nil 'move) (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4546 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4547 (and (stringp gnus-ignored-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4548 (while (re-search-forward gnus-ignored-headers nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4549 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4550 (delete-region (point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4551 (progn (re-search-forward "\n[^ \t]")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4552 (forward-char -1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4553 (point)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4554 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4555
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4556 ;; Working on article's buffer
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4557
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4558 (defun gnus-article-next-page (lines)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4559 "Show next page of current article.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4560 If end of article, return non-nil. Otherwise return nil.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4561 Argument LINES specifies lines to be scrolled up."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4562 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4563 (move-to-window-line -1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4564 ;; Fixed by enami@ptgd.sony.co.jp (enami tsugutomo)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4565 (if (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4566 (end-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4567 (and (pos-visible-in-window-p) ;Not continuation line.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4568 (eobp)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4569 ;; Nothing in this page.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4570 (if (or (not gnus-break-pages)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4571 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4572 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4573 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4574 t ;Nothing more.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4575 (gnus-narrow-to-page 1) ;Go to next page.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4576 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4577 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4578 ;; More in this page.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4579 (condition-case ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4580 (scroll-up lines)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4581 (end-of-buffer
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4582 ;; Long lines may cause an end-of-buffer error.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4583 (goto-char (point-max))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4584 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4585 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4586
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4587 (defun gnus-article-prev-page (lines)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4588 "Show previous page of current article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4589 Argument LINES specifies lines to be scrolled down."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4590 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4591 (move-to-window-line 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4592 (if (and gnus-break-pages
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4593 (bobp)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4594 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4595 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4596 (gnus-narrow-to-page -1) ;Go to previous page.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4597 (goto-char (point-max))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4598 (recenter -1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4599 (scroll-down lines)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4600
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4601 (defun gnus-article-next-digest (nth)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4602 "Move to head of NTH next digested message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4603 Set mark at end of digested message."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4604 ;; Stop page breaking in digest mode.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4605 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4606 (end-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4607 ;; Skip NTH - 1 digest.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4608 ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4609 ;; Digest separator is customizable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4610 ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4611 (while (and (> nth 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4612 (re-search-forward gnus-digest-separator nil 'move))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4613 (setq nth (1- nth)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4614 (if (re-search-forward gnus-digest-separator nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4615 (let ((begin (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4616 ;; Search for end of this message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4617 (end-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4618 (if (re-search-forward gnus-digest-separator nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4619 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4620 (search-backward "\n\n") ;This may be incorrect.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4621 (forward-line 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4622 (goto-char (point-max)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4623 (push-mark) ;Set mark at end of digested message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4624 (goto-char begin)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4625 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4626 ;; Show From: and Subject: fields.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4627 (recenter 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4628 (message "End of message")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4629 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4630
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4631 (defun gnus-article-prev-digest (n)
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4632 "Move to head of Nth previous digested message."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4633 ;; Stop page breaking in digest mode.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4634 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4635 (beginning-of-line)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4636 ;; Skip N - 1 digest.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4637 ;; Suggested by Khalid Sattar <admin@cs.exeter.ac.uk>.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4638 ;; Digest separator is customizable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4639 ;; Suggested by Skip Montanaro <montanaro@sprite.crd.ge.com>.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4640 (while (and (> n 1)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4641 (re-search-backward gnus-digest-separator nil 'move))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4642 (setq n (1- n)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4643 (if (re-search-backward gnus-digest-separator nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4644 (let ((begin (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4645 ;; Search for end of this message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4646 (end-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4647 (if (re-search-forward gnus-digest-separator nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4648 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4649 (search-backward "\n\n") ;This may be incorrect.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4650 (forward-line 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4651 (goto-char (point-max)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4652 (push-mark) ;Set mark at end of digested message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4653 (goto-char begin)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4654 ;; Show From: and Subject: fields.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4655 (recenter 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4656 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4657 (message "Top of message")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4658 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4659
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4660 (defun gnus-article-refer-article ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4661 "Read article specified by message-id around point."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4662 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4663 (save-window-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4664 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4665 (re-search-forward ">" nil t) ;Move point to end of "<....>".
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4666 (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4667 (let ((message-id
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4668 (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
4669 (set-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4670 (gnus-summary-refer-article message-id))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4671 (error "No references around point"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4672 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4673
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4674 (defun gnus-article-pop-article ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4675 "Pop up article history."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4676 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4677 (save-window-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4678 (set-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4679 (gnus-summary-refer-article nil)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4680
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4681 (defun gnus-article-show-summary ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4682 "Reconfigure windows to show Summary buffer."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4683 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4684 (gnus-configure-windows 'article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4685 (pop-to-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4686 (gnus-summary-goto-subject gnus-current-article))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4687
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4688 (defun gnus-article-describe-briefly ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4689 "Describe Article mode commands briefly."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4690 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4691 (message
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4692 (concat
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4693 (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
4694 (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
4695 (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
4696 (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
4697 (substitute-command-keys "\\[gnus-article-describe-briefly]:This help")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4698 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4699
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4700
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4701 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4702 ;;; GNUS KILL-File Mode
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4703 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4704
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4705 (if gnus-kill-file-mode-map
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4706 nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4707 (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
4708 (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
4709 (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
4710 (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
4711 (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
4712 (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
4713 (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
4714
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4715 (defun gnus-kill-file-mode ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4716 "Major mode for editing KILL file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4717
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4718 In addition to Emacs-Lisp Mode, the following commands are available:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4719
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4720 \\[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
4721 \\[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
4722 \\[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
4723 \\[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
4724 \\[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
4725 \\[gnus-info-find-node] Read Info about KILL file.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4726
8444
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4727 A KILL file contains Lisp expressions to be applied to a selected
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4728 newsgroup. The purpose is to mark articles as read on the basis of
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4729 some set of regexps. A global KILL file is applied to every newsgroup,
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4730 and a local KILL file is applied to a specified newsgroup. Since a
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4731 global KILL file is applied to every newsgroup, for better performance
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4732 use a local one.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4733
8444
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4734 A KILL file can contain any kind of Emacs Lisp expressions expected
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4735 to be evaluated in the Summary buffer. Writing Lisp programs for this
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4736 purpose is not so easy because the internal working of GNUS must be
8444
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4737 well-known. For this reason, GNUS provides a general function which
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4738 does this easily for non-Lisp programmers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4739
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4740 The `gnus-kill' function executes commands available in Summary Mode
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4741 by their key sequences. `gnus-kill' should be called with FIELD,
8444
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4742 REGEXP and optional COMMAND and ALL. FIELD is a string representing
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4743 the header field or an empty string. If FIELD is an empty string, the
841f2c8ae5bb Doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 8439
diff changeset
4744 entire article body is searched for. REGEXP is a string which is
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4745 compared with FIELD value. COMMAND is a string representing a valid
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4746 key sequence in Summary mode or Lisp expression. COMMAND defaults to
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4747 \(gnus-summary-mark-as-read nil \"X\"). Make sure that COMMAND is
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4748 executed in the Summary buffer. If the second optional argument ALL
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4749 is non-nil, the COMMAND is applied to articles which are already
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4750 marked as read or unread. Articles which are marked are skipped over
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4751 by default.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4752
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4753 For example, if you want to mark articles of which subjects contain
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4754 the string `AI' as read, a possible KILL file may look like:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4755
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4756 (gnus-kill \"Subject\" \"AI\")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4757
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4758 If you want to mark articles with `D' instead of `X', you can use
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4759 the following expression:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4760
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4761 (gnus-kill \"Subject\" \"AI\" \"d\")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4762
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4763 \(Here we assume the command `gnus-summary-mark-as-read-forward' is
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4764 assigned to `d' in Summary Mode.)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4765
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4766 It is possible to delete unnecessary headers which are marked with
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4767 `X' in a KILL file as follows:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4768
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4769 (gnus-expunge \"X\")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4770
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4771 If the Summary buffer is empty after applying KILL files, GNUS will
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4772 exit the selected newsgroup normally. If headers which are marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4773 with `D' are deleted in a KILL file, it is impossible to read articles
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4774 which are marked as read in the previous GNUS sessions. Marks other
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4775 than `D' should be used for articles which should really be deleted.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4776
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4777 Entry to this mode calls `emacs-lisp-mode-hook' and
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
4778 `gnus-kill-file-mode-hook' with no arguments, if that value is non-nil."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4779 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4780 (kill-all-local-variables)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4781 (use-local-map gnus-kill-file-mode-map)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4782 (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
4783 (setq major-mode 'gnus-kill-file-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4784 (setq mode-name "KILL-File")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4785 (lisp-mode-variables nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4786 (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
4787
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4788 (defun gnus-kill-file-edit-file (newsgroup)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4789 "Begin editing a KILL file of NEWSGROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4790 If NEWSGROUP is nil, the global KILL file is selected."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4791 (interactive "sNewsgroup: ")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4792 (let ((file (gnus-newsgroup-kill-file newsgroup)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4793 (gnus-make-directory (file-name-directory file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4794 ;; Save current window configuration if this is first invocation.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4795 (or (and (get-file-buffer file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4796 (get-buffer-window (get-file-buffer file)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4797 (setq gnus-winconf-kill-file (current-window-configuration)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4798 ;; Hack windows.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4799 (let ((buffer (find-file-noselect file)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4800 (cond ((get-buffer-window buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4801 (pop-to-buffer buffer))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4802 ((eq major-mode 'gnus-group-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4803 (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
4804 (pop-to-buffer gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4805 (let ((gnus-summary-buffer buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4806 (gnus-configure-windows '(1 1 0)) ;Split into two.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4807 (pop-to-buffer buffer)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4808 ((eq major-mode 'gnus-summary-mode)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4809 (gnus-configure-windows 'article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4810 (pop-to-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4811 (bury-buffer gnus-article-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4812 (switch-to-buffer buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4813 (t ;No good rules.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4814 (find-file-other-window file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4815 ))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4816 (gnus-kill-file-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4817 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4818
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4819 (defun gnus-kill-file-kill-by-subject ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4820 "Insert KILL command for current subject."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4821 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4822 (insert
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4823 (format "(gnus-kill \"Subject\" %s)\n"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4824 (prin1-to-string
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4825 (if gnus-current-kill-article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4826 (regexp-quote
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4827 (nntp-header-subject
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4828 ;; No need to speed up this command.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4829 ;;(gnus-get-header-by-number gnus-current-kill-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4830 (gnus-find-header-by-number gnus-newsgroup-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4831 gnus-current-kill-article)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4832 "")))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4833
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4834 (defun gnus-kill-file-kill-by-author ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4835 "Insert KILL command for current author."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4836 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4837 (insert
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4838 (format "(gnus-kill \"From\" %s)\n"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4839 (prin1-to-string
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4840 (if gnus-current-kill-article
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4841 (regexp-quote
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4842 (nntp-header-from
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4843 ;; No need to speed up this command.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4844 ;;(gnus-get-header-by-number gnus-current-kill-article)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4845 (gnus-find-header-by-number gnus-newsgroup-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4846 gnus-current-kill-article)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4847 "")))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4848
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4849 (defun gnus-kill-file-apply-buffer ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4850 "Apply current buffer to current newsgroup."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4851 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4852 (if (and gnus-current-kill-article
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4853 (get-buffer gnus-summary-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4854 ;; Assume newsgroup is selected.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4855 (let ((string (concat "(progn \n" (buffer-string) "\n)" )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4856 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4857 (save-window-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4858 (pop-to-buffer gnus-summary-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4859 (eval (car (read-from-string string))))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4860 (ding) (message "No newsgroup is selected.")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4861
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4862 (defun gnus-kill-file-apply-last-sexp ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4863 "Apply sexp before point in current buffer to current newsgroup."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4864 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4865 (if (and gnus-current-kill-article
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4866 (get-buffer gnus-summary-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4867 ;; Assume newsgroup is selected.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4868 (let ((string
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4869 (buffer-substring
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4870 (save-excursion (forward-sexp -1) (point)) (point))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4871 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4872 (save-window-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4873 (pop-to-buffer gnus-summary-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4874 (eval (car (read-from-string string))))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4875 (ding) (message "No newsgroup is selected.")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4876
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4877 (defun gnus-kill-file-exit ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4878 "Save a KILL file, then return to the previous buffer."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4879 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4880 (save-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4881 (let ((killbuf (current-buffer)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4882 ;; 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
4883 (and (get-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4884 (bury-buffer (get-buffer gnus-article-buffer)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4885 ;; Delete the KILL file windows.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4886 (delete-windows-on killbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4887 ;; Restore last window configuration if available.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4888 (and gnus-winconf-kill-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4889 (set-window-configuration gnus-winconf-kill-file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4890 (setq gnus-winconf-kill-file nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4891 ;; Kill the KILL file buffer. Suggested by tale@pawl.rpi.edu.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4892 (kill-buffer killbuf)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4893
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4894
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4895 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4896 ;;; Utility functions
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4897 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4898
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4899 ;; Basic ideas by emv@math.lsa.umich.edu (Edward Vielmetti)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4900
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4901 (defun gnus-batch-kill ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4902 "Run batched KILL.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4903 Usage: emacs -batch -l gnus -f gnus-batch-kill NEWSGROUP ..."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4904 (if (not noninteractive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4905 (error "gnus-batch-kill is to be used only with -batch"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4906 (let* ((group nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4907 (subscribed nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4908 (newsrc nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4909 (yes-and-no
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4910 (gnus-parse-n-options
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4911 (apply (function concat)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4912 (mapcar (function (lambda (g) (concat g " ")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4913 command-line-args-left))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4914 (yes (car yes-and-no))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4915 (no (cdr yes-and-no))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4916 ;; Disable verbose message.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4917 (gnus-novice-user nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4918 (gnus-large-newsgroup nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4919 (nntp-large-newsgroup nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4920 ;; Eat all arguments.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4921 (setq command-line-args-left nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4922 ;; Startup GNUS.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4923 (gnus)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4924 ;; Apply kills to specified newsgroups in command line arguments.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4925 (setq newsrc (copy-sequence gnus-newsrc-assoc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4926 (while newsrc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4927 (setq group (car (car newsrc)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4928 (setq subscribed (nth 1 (car newsrc)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4929 (setq newsrc (cdr newsrc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4930 (if (and subscribed
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4931 (not (zerop (nth 1 (gnus-gethash group gnus-unread-hashtb))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4932 (if yes
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4933 (string-match yes group) t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4934 (or (null no)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4935 (not (string-match no group))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4936 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4937 (gnus-summary-read-group group nil t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4938 (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
4939 (gnus-summary-exit t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4940 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4941 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4942 ;; Finally, exit Emacs.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4943 (set-buffer gnus-group-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4944 (gnus-group-exit)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4945 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4946
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4947 ;; For saving articles
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4948
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4949 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4950 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4951 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group/num.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4952 Otherwise, it is like ~/News/news/group/num."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4953 (let ((default
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4954 (expand-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4955 (concat (if gnus-use-long-file-name
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4956 (gnus-capitalize-newsgroup newsgroup)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4957 (gnus-newsgroup-directory-form newsgroup))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4958 "/" (int-to-string (nntp-header-number headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4959 (or gnus-article-save-directory "~/News"))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4960 (if (and last-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4961 (string-equal (file-name-directory default)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4962 (file-name-directory last-file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4963 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4964 default
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4965 (or last-file default))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4966
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4967 (defun gnus-numeric-save-name (newsgroup headers &optional last-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4968 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4969 If variable `gnus-use-long-file-name' is nil, it is ~/News/news.group/num.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4970 Otherwise, it is like ~/News/news/group/num."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4971 (let ((default
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4972 (expand-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4973 (concat (if gnus-use-long-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4974 newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4975 (gnus-newsgroup-directory-form newsgroup))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4976 "/" (int-to-string (nntp-header-number headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4977 (or gnus-article-save-directory "~/News"))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4978 (if (and last-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4979 (string-equal (file-name-directory default)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4980 (file-name-directory last-file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4981 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4982 default
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4983 (or last-file default))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4984
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4985 (defun gnus-Plain-save-name (newsgroup headers &optional last-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4986 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4987 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4988 Otherwise, it is like ~/News/news/group/news."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4989 (or last-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4990 (expand-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4991 (if gnus-use-long-file-name
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
4992 (gnus-capitalize-newsgroup newsgroup)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4993 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4994 (or gnus-article-save-directory "~/News"))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4995
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4996 (defun gnus-plain-save-name (newsgroup headers &optional last-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4997 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4998 If variable `gnus-use-long-file-name' is nil, it is ~/News/news.group.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4999 Otherwise, it is like ~/News/news/group/news."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5000 (or last-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5001 (expand-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5002 (if gnus-use-long-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5003 newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5004 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5005 (or gnus-article-save-directory "~/News"))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5006
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5007 (defun gnus-Folder-save-name (newsgroup headers &optional last-folder)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5008 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5009 If variable `gnus-use-long-file-name' is nil, it is +News.group.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5010 Otherwise, it is like +news/group."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5011 (or last-folder
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5012 (concat "+"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5013 (if gnus-use-long-file-name
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5014 (gnus-capitalize-newsgroup newsgroup)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5015 (gnus-newsgroup-directory-form newsgroup)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5016
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5017 (defun gnus-folder-save-name (newsgroup headers &optional last-folder)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5018 "Generate folder name from NEWSGROUP, HEADERS, and optional LAST-FOLDER.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5019 If variable `gnus-use-long-file-name' is nil, it is +news.group.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5020 Otherwise, it is like +news/group."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5021 (or last-folder
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5022 (concat "+"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5023 (if gnus-use-long-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5024 newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5025 (gnus-newsgroup-directory-form newsgroup)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5026
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5027 ;; For KILL files
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5028
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5029 (defun gnus-apply-kill-file ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5030 "Apply KILL file to the current newsgroup."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5031 ;; Apply the global KILL file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5032 (load (gnus-newsgroup-kill-file nil) t nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5033 ;; And then apply the local KILL file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5034 (load (gnus-newsgroup-kill-file gnus-newsgroup-name) t nil t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5035
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5036 (defun gnus-Newsgroup-kill-file (newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5037 "Return the name of a KILL file of NEWSGROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5038 If NEWSGROUP is nil, return the global KILL file instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5039 (cond ((or (null newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5040 (string-equal newsgroup ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5041 ;; The global KILL file is placed at top of the directory.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5042 (expand-file-name gnus-kill-file-name
8439
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
5043 (or gnus-kill-files-directory "~/News")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5044 (gnus-use-long-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5045 ;; Append ".KILL" to capitalized newsgroup name.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5046 (expand-file-name (concat (gnus-capitalize-newsgroup newsgroup)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5047 "." gnus-kill-file-name)
8439
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
5048 (or gnus-kill-files-directory "~/News")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5049 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5050 ;; Place "KILL" under the hierarchical directory.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5051 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5052 "/" gnus-kill-file-name)
8439
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
5053 (or gnus-kill-files-directory "~/News")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5054 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5055
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5056 (defun gnus-newsgroup-kill-file (newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5057 "Return the name of a KILL file of NEWSGROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5058 If NEWSGROUP is nil, return the global KILL file instead."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5059 (cond ((or (null newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5060 (string-equal newsgroup ""))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5061 ;; The global KILL file is placed at top of the directory.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5062 (expand-file-name gnus-kill-file-name
8439
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
5063 (or gnus-kill-files-directory "~/News")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5064 (gnus-use-long-file-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5065 ;; Append ".KILL" to newsgroup name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5066 (expand-file-name (concat newsgroup "." gnus-kill-file-name)
8439
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
5067 (or gnus-kill-files-directory "~/News")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5068 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5069 ;; Place "KILL" under the hierarchical directory.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5070 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5071 "/" gnus-kill-file-name)
8439
e3040f870f4f (gnus-kill-files-directory): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 8413
diff changeset
5072 (or gnus-kill-files-directory "~/News")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5073 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5074
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5075 ;; For subscribing new newsgroup
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5076
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5077 (defun gnus-subscribe-randomly (newsgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5078 "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
5079 (gnus-subscribe-newsgroup newsgroup
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5080 (car (car gnus-newsrc-assoc))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5081
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5082 (defun gnus-subscribe-alphabetically (newgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5083 "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
5084 ;; 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
5085 (let ((groups gnus-newsrc-assoc)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5086 (before nil))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5087 (while (and (not before) groups)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5088 (if (string< newgroup (car (car groups)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5089 (setq before (car (car groups)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5090 (setq groups (cdr groups))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5091 (gnus-subscribe-newsgroup newgroup before)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5092 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5093
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5094 (defun gnus-subscribe-hierarchically (newgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5095 "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
5096 ;; 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
5097 (save-excursion
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5098 (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
5099 (let ((groupkey newgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5100 (before nil))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5101 (while (and (not before) groupkey)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5102 (goto-char (point-min))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5103 (let ((groupkey-re
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5104 (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]")))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5105 (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
5106 (progn
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5107 (setq before (buffer-substring
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5108 (match-beginning 1) (match-end 1)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5109 (string< before newgroup)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5110 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5111 ;; 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
5112 (setq groupkey
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5113 (if (string-match "^\\(.*\\)\\.[^.]+$" groupkey)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5114 (substring groupkey (match-beginning 1) (match-end 1)))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5115 (gnus-subscribe-newsgroup newgroup before)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5116 )))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5117
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5118 (defun gnus-subscribe-interactively (newsgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5119 "Subscribe new NEWSGROUP interactively.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5120 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
5121 Unless, it is killed."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5122 (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
5123 (gnus-subscribe-hierarchically newsgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5124 ;; Save in kill-ring
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5125 (gnus-subscribe-newsgroup newsgroup)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5126 (gnus-kill-newsgroup newsgroup)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5127
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5128 (defun gnus-subscribe-newsgroup (newsgroup &optional next)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5129 "Subscribe new NEWSGROUP.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5130 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
5131 (gnus-insert-newsgroup (list newsgroup t) next)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5132 (message "Subscribe newsgroup: %s" newsgroup))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5133
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5134 ;; For directories
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5135
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5136 (defun gnus-newsgroup-directory-form (newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5137 "Make hierarchical directory name from NEWSGROUP name."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5138 (let ((newsgroup (substring newsgroup 0)) ;Copy string.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5139 (len (length newsgroup))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5140 (idx 0))
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3496
diff changeset
5141 ;; Replace all occurrences of `.' with `/'.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5142 (while (< idx len)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5143 (if (= (aref newsgroup idx) ?.)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5144 (aset newsgroup idx ?/))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5145 (setq idx (1+ idx)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5146 newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5147 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5148
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5149 (defun gnus-make-directory (directory)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5150 "Make DIRECTORY recursively."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5151 (let ((directory (expand-file-name directory default-directory)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5152 (or (file-exists-p directory)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5153 (gnus-make-directory-1 "" directory))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5154 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5155
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5156 (defun gnus-make-directory-1 (head tail)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5157 (cond ((string-match "^/\\([^/]+\\)" tail)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5158 ;; ange-ftp interferes with calling match-* after
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5159 ;; calling file-name-as-directory.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5160 (let ((beg (match-beginning 1))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5161 (end (match-end 1)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5162 (setq head (concat (file-name-as-directory head)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5163 (substring tail beg end)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5164 (or (file-exists-p head)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5165 (call-process "mkdir" nil nil nil head))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5166 (gnus-make-directory-1 head (substring tail end))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5167 ((string-equal tail "") t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5168 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5169
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5170 (defun gnus-capitalize-newsgroup (newsgroup)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5171 "Capitalize NEWSGROUP name with treating `.' and `-' as part of words."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5172 ;; 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
5173 (let ((current-syntax-table (syntax-table)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5174 (unwind-protect
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5175 (progn
5313
3189e46001fd (gnus-capitalize-newsgroup): Modify a new temporary
Richard M. Stallman <rms@gnu.org>
parents: 5057
diff changeset
5176 (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
5177 (modify-syntax-entry ?- "w")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5178 (modify-syntax-entry ?. "w")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5179 (capitalize newsgroup))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5180 (set-syntax-table current-syntax-table))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5181
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5182 (defun gnus-simplify-subject (subject &optional re-only)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5183 "Remove `Re:' and words in parentheses.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5184 If optional argument RE-ONLY is non-nil, strip `Re:' only."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5185 (let ((case-fold-search t)) ;Ignore case.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5186 ;; Remove `Re:' and `Re^N:'.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5187 (if (string-match "\\`\\(re\\(\\^[0-9]+\\)?:[ \t]+\\)+" subject)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5188 (setq subject (substring subject (match-end 0))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5189 ;; Remove words in parentheses from end.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5190 (or re-only
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5191 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5192 (setq subject (substring subject 0 (match-beginning 0)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5193 ;; Return subject string.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5194 subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5195 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5196
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5197 (defun gnus-optional-lines-and-from (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5198 "Return a string like `NNN:AUTHOR' from HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5199 (let ((name-length (length "umerin@photon")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5200 (substring (format "%3d:%s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5201 ;; Lines of the article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5202 ;; Suggested by dana@bellcore.com.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5203 (nntp-header-lines header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5204 ;; Its author.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5205 (concat (mail-strip-quoted-names
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5206 (nntp-header-from header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5207 (make-string name-length ? )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5208 ;; 4 stands for length of `NNN:'.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5209 0 (+ 4 name-length))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5210
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5211 (defun gnus-optional-lines (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5212 "Return a string like `NNN' from HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5213 (format "%4d" (nntp-header-lines header)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5214
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5215 ;; 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
5216
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5217 (defun gnus-keysort-headers (predicate key &optional reverse)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5218 "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
5219 *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
5220 Optional argument REVERSE means reverse order."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5221 (let ((inhibit-quit t))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5222 (setq gnus-newsgroup-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5223 (if reverse
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5224 (nreverse
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5225 (gnus-keysort (nreverse gnus-newsgroup-headers) predicate key))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5226 (gnus-keysort gnus-newsgroup-headers predicate key)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5227 ;; Make sure we don't have to call
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5228 ;; 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
5229 ;; 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
5230 ;; 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
5231 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5232
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5233 (defun gnus-keysort (list predicate key)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5234 "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
5235 (mapcar (function cdr)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5236 (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
5237 (function (lambda (a b)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5238 (funcall predicate (car a) (car b)))))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5239
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5240 (defun gnus-sort-headers (predicate &optional reverse)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5241 "Sort current headers by PREDICATE safely.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5242 *Safely* means C-g quitting is disabled during sort.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5243 Optional argument REVERSE means reverse order."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5244 (let ((inhibit-quit t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5245 (setq gnus-newsgroup-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5246 (if reverse
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5247 (nreverse (sort (nreverse gnus-newsgroup-headers) predicate))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5248 (sort gnus-newsgroup-headers predicate)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5249 ;; Make sure we don't have to call
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5250 ;; 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
5251 ;; 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
5252 ;; entry is added to nor deleted from the variable.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5253 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5254
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5255 (defun gnus-string-lessp (a b)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5256 "Return T if first arg string is less than second in lexicographic order.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5257 If `case-fold-search' is non-nil, case of letters is ignored."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5258 (if case-fold-search
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5259 (string-lessp (downcase a) (downcase b))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5260 (string-lessp a b)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5261
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5262 (defun gnus-date-lessp (date1 date2)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5263 "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
5264 (string-lessp (gnus-sortable-date date1)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5265 (gnus-sortable-date date2)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5266
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5267 (defun gnus-sortable-date (date)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5268 "Convert DATE into a string that can be sorted with `string-lessp'.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5269 Timezone package is used."
8413
aa772e9e5f86 (gnus-sortable-date): Use timezone-make-time-string.
Richard M. Stallman <rms@gnu.org>
parents: 8382
diff changeset
5270 (let* ((date (timezone-fix-time date nil nil)) ;[Y M D H M S]
aa772e9e5f86 (gnus-sortable-date): Use timezone-make-time-string.
Richard M. Stallman <rms@gnu.org>
parents: 8382
diff changeset
5271 (year (aref date 0))
aa772e9e5f86 (gnus-sortable-date): Use timezone-make-time-string.
Richard M. Stallman <rms@gnu.org>
parents: 8382
diff changeset
5272 (month (aref date 1))
aa772e9e5f86 (gnus-sortable-date): Use timezone-make-time-string.
Richard M. Stallman <rms@gnu.org>
parents: 8382
diff changeset
5273 (day (aref date 2)))
aa772e9e5f86 (gnus-sortable-date): Use timezone-make-time-string.
Richard M. Stallman <rms@gnu.org>
parents: 8382
diff changeset
5274 (timezone-make-sortable-date year month day
aa772e9e5f86 (gnus-sortable-date): Use timezone-make-time-string.
Richard M. Stallman <rms@gnu.org>
parents: 8382
diff changeset
5275 (timezone-make-time-string
aa772e9e5f86 (gnus-sortable-date): Use timezone-make-time-string.
Richard M. Stallman <rms@gnu.org>
parents: 8382
diff changeset
5276 (aref date 3) (aref date 4) (aref date 5)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5277 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5278
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5279 ;;(defun gnus-sortable-date (date)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5280 ;; "Make sortable string by string-lessp from DATE."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5281 ;; (let ((month '(("JAN" . " 1")("FEB" . " 2")("MAR" . " 3")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5282 ;; ("APR" . " 4")("MAY" . " 5")("JUN" . " 6")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5283 ;; ("JUL" . " 7")("AUG" . " 8")("SEP" . " 9")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5284 ;; ("OCT" . "10")("NOV" . "11")("DEC" . "12")))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5285 ;; (date (or date "")))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5286 ;; ;; Can understand the following styles:
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5287 ;; ;; (1) 14 Apr 89 03:20:12 GMT
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5288 ;; ;; (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
5289 ;; (if (string-match
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5290 ;; "\\([0-9]+\\) \\([^ ,]+\\) \\([0-9]+\\) \\([0-9:]+\\)" date)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5291 ;; (concat
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5292 ;; ;; Year
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5293 ;; (substring date (match-beginning 3) (match-end 3))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5294 ;; ;; Month
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5295 ;; (cdr
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5296 ;; (assoc
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5297 ;; (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
5298 ;; ;; Day
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5299 ;; (format "%2d" (string-to-int
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5300 ;; (substring date
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5301 ;; (match-beginning 1) (match-end 1))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5302 ;; ;; Time
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5303 ;; (substring date (match-beginning 4) (match-end 4)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5304 ;; ;; Cannot understand DATE string.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5305 ;; date
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5306 ;; )
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5307 ;; ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5308
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5309 (defun gnus-fetch-field (field)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5310 "Return the value of the header FIELD of current article."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5311 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5312 (save-restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5313 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5314 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5315 (narrow-to-region (point-min)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5316 (progn (search-forward "\n\n" nil 'move) (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5317 (mail-fetch-field field))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5318
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5319 (fset 'gnus-expunge 'gnus-summary-delete-marked-with)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5320
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5321 (defun gnus-kill (field regexp &optional command all)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5322 "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
5323 Optional 1st argument COMMAND is default to
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5324 (gnus-summary-mark-as-read nil \"X\").
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5325 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
5326 If FIELD is an empty string (or nil), entire article body is searched for.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5327 COMMAND must be a Lisp expression or a string representing a key sequence."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5328 ;; We don't want to change current point nor window configuration.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5329 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5330 (save-window-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5331 ;; Selected window must be Summary buffer to execute keyboard
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5332 ;; macros correctly. See command_loop_1.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5333 (switch-to-buffer gnus-summary-buffer 'norecord)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5334 (goto-char (point-min)) ;From the beginning.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5335 (if (null command)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5336 (setq command '(gnus-summary-mark-as-read nil "X")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5337 (gnus-execute field regexp command nil (not all))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5338 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5339
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5340 (defun gnus-execute (field regexp form &optional backward ignore-marked)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5341 "If FIELD of article header matches REGEXP, execute lisp FORM (or a string).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5342 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
5343 If optional 1st argument BACKWARD is non-nil, do backward instead.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5344 If optional 2nd argument IGNORE-MARKED is non-nil, ignore articles
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5345 marked as read or unread."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5346 (let ((function nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5347 (header nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5348 (article nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5349 (if (string-equal field "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5350 (setq field nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5351 (if (null field)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5352 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5353 (or (stringp field)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5354 (setq field (symbol-name field)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5355 ;; Get access function of header filed.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5356 (setq function (intern-soft (concat "gnus-header-" (downcase field))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5357 (if (and function (fboundp function))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5358 (setq function (symbol-function function))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5359 (error "Unknown header field: \"%s\"" field)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5360 ;; Make FORM funcallable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5361 (if (and (listp form) (not (eq (car form) 'lambda)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5362 (setq form (list 'lambda nil form)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5363 ;; Starting from the current article.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5364 (or (and ignore-marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5365 ;; 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
5366 (setq article (gnus-summary-article-number))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5367 (or (not (memq article gnus-newsgroup-unreads)) ;Marked as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5368 (memq article gnus-newsgroup-marked) ;Marked as unread.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5369 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5370 (gnus-execute-1 function regexp form))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5371 (while (gnus-summary-search-subject backward ignore-marked nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5372 (gnus-execute-1 function regexp form))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5373 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5374
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5375 (defun gnus-execute-1 (function regexp form)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5376 (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5377 ;; 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
5378 (let ((article (gnus-summary-article-number)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5379 (if (null article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5380 nil ;Nothing to do.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5381 (if function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5382 ;; Compare with header field.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5383 (let (;;(header (gnus-find-header-by-number
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5384 ;; gnus-newsgroup-headers article))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5385 (header (gnus-get-header-by-number article))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5386 (value nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5387 (and header
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5388 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5389 (setq value (funcall function header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5390 ;; Number (Lines:) or symbol must be converted to string.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5391 (or (stringp value)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5392 (setq value (prin1-to-string value)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5393 (string-match regexp value))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5394 (if (stringp form) ;Keyboard macro.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5395 (execute-kbd-macro form)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5396 (funcall form))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5397 ;; Search article body.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5398 (let ((gnus-current-article nil) ;Save article pointer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5399 (gnus-last-article nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5400 (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
5401 (gnus-mark-article-hook nil)) ;Inhibit marking as read.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5402 (message "Searching for article: %d..." article)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5403 (gnus-article-setup-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5404 (gnus-article-prepare article t)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5405 (if (save-excursion
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5406 (set-buffer gnus-article-buffer)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5407 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5408 (re-search-forward regexp nil t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5409 (if (stringp form) ;Keyboard macro.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5410 (execute-kbd-macro form)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5411 (funcall form))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5412 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5413 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5414
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5415 ;;; caesar-region written by phr@prep.ai.mit.edu Nov 86
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5416 ;;; modified by tower@prep Nov 86
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5417 ;;; Modified by umerin@flab.flab.Fujitsu.JUNET for ROT47.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5418
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5419 (defun gnus-caesar-region (&optional n)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5420 "Caesar rotation of region by N, default 13, for decrypting netnews.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5421 ROT47 will be performed for Japanese text in any case."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5422 (interactive (if current-prefix-arg ; Was there a prefix arg?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5423 (list (prefix-numeric-value current-prefix-arg))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5424 (list nil)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5425 (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
5426 (t (setq n (mod n 26)))) ;canonicalize N
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5427 (if (not (zerop n)) ; no action needed for a rot of 0
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5428 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5429 (if (or (not (boundp 'caesar-translate-table))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5430 (/= (aref caesar-translate-table ?a) (+ ?a n)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5431 (let ((i 0) (lower "abcdefghijklmnopqrstuvwxyz") upper)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5432 (message "Building caesar-translate-table...")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5433 (setq caesar-translate-table (make-vector 256 0))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5434 (while (< i 256)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5435 (aset caesar-translate-table i i)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5436 (setq i (1+ i)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5437 (setq lower (concat lower lower) upper (upcase lower) i 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5438 (while (< i 26)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5439 (aset caesar-translate-table (+ ?a i) (aref lower (+ i n)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5440 (aset caesar-translate-table (+ ?A i) (aref upper (+ i n)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5441 (setq i (1+ i)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5442 ;; ROT47 for Japanese text.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5443 ;; Thanks to ichikawa@flab.fujitsu.junet.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5444 (setq i 161)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5445 (let ((t1 (logior ?O 128))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5446 (t2 (logior ?! 128))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5447 (t3 (logior ?~ 128)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5448 (while (< i 256)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5449 (aset caesar-translate-table i
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5450 (let ((v (aref caesar-translate-table i)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5451 (if (<= v t1) (if (< v t2) v (+ v 47))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5452 (if (<= v t3) (- v 47) v))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5453 (setq i (1+ i))))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5454 (message "Building caesar-translate-table...done")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5455 (let ((from (region-beginning))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5456 (to (region-end))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5457 (i 0) str len)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5458 (setq str (buffer-substring from to))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5459 (setq len (length str))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5460 (while (< i len)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5461 (aset str i (aref caesar-translate-table (aref str i)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5462 (setq i (1+ i)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5463 (goto-char from)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5464 (delete-region from to)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5465 (insert str)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5466
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5467 ;; Functions accessing headers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5468 ;; Functions are more convenient than macros in some case.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5469
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5470 (defun gnus-header-number (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5471 "Return article number in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5472 (nntp-header-number header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5473
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5474 (defun gnus-header-subject (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5475 "Return subject string in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5476 (nntp-header-subject header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5477
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5478 (defun gnus-header-from (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5479 "Return author string in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5480 (nntp-header-from header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5481
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5482 (defun gnus-header-xref (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5483 "Return xref string in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5484 (nntp-header-xref header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5485
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5486 (defun gnus-header-lines (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5487 "Return lines in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5488 (nntp-header-lines header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5489
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5490 (defun gnus-header-date (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5491 "Return date in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5492 (nntp-header-date header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5493
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5494 (defun gnus-header-id (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5495 "Return Id in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5496 (nntp-header-id header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5497
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5498 (defun gnus-header-references (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5499 "Return references in HEADER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5500 (nntp-header-references header))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5501
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5502
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5503 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5504 ;;; Article savers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5505 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5506
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5507 (defun gnus-output-to-rmail (file-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5508 "Append the current article to an Rmail file named FILE-NAME."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5509 (require 'rmail)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5510 ;; Most of these codes are borrowed from rmailout.el.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5511 (setq file-name (expand-file-name file-name))
7560
e63efa2d587c rmail-default-file renamed from rmail-last-file,
Richard M. Stallman <rms@gnu.org>
parents: 7524
diff changeset
5512 (setq rmail-default-rmail-file file-name)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5513 (let ((artbuf (current-buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5514 (tmpbuf (get-buffer-create " *GNUS-output*")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5515 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5516 (or (get-file-buffer file-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5517 (file-exists-p file-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5518 (if (yes-or-no-p
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5519 (concat "\"" file-name "\" does not exist, create it? "))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5520 (let ((file-buffer (create-file-buffer file-name)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5521 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5522 (set-buffer file-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5523 (rmail-insert-rmail-file-header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5524 (let ((require-final-newline nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5525 (write-region (point-min) (point-max) file-name t 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5526 (kill-buffer file-buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5527 (error "Output file does not exist")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5528 (set-buffer tmpbuf)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5529 (buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5530 (erase-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5531 (insert-buffer-substring artbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5532 (gnus-convert-article-to-rmail)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5533 ;; Decide whether to append to a file or to an Emacs buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5534 (let ((outbuf (get-file-buffer file-name)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5535 (if (not outbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5536 (append-to-file (point-min) (point-max) file-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5537 ;; File has been visited, in buffer OUTBUF.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5538 (set-buffer outbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5539 (let ((buffer-read-only nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5540 (msg (and (boundp 'rmail-current-message)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5541 rmail-current-message)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5542 ;; If MSG is non-nil, buffer is in RMAIL mode.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5543 (if msg
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5544 (progn (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5545 (narrow-to-region (point-max) (point-max))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5546 (insert-buffer-substring tmpbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5547 (if msg
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5548 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5549 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5550 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5551 (search-backward "\^_")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5552 (narrow-to-region (point) (point-max))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5553 (goto-char (1+ (point-min)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5554 (rmail-count-new-messages t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5555 (rmail-show-message msg))))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5556 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5557 (kill-buffer tmpbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5558 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5559
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5560 (defun gnus-output-to-file (file-name)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5561 "Append the current article to a file named FILE-NAME."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5562 (setq file-name (expand-file-name file-name))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5563 (let ((artbuf (current-buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5564 (tmpbuf (get-buffer-create " *GNUS-output*")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5565 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5566 (set-buffer tmpbuf)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5567 (buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5568 (erase-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5569 (insert-buffer-substring artbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5570 ;; Append newline at end of the buffer as separator, and then
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5571 ;; save it to file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5572 (goto-char (point-max))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5573 (insert "\n")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5574 (append-to-file (point-min) (point-max) file-name))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5575 (kill-buffer tmpbuf)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5576 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5577
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5578 (defun gnus-convert-article-to-rmail ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5579 "Convert article in current buffer to Rmail message format."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5580 (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5581 ;; Convert article directly into Babyl format.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5582 ;; Suggested by Rob Austein <sra@lcs.mit.edu>
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5583 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5584 (insert "\^L\n0, unseen,,\n*** EOOH ***\n")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5585 (while (search-forward "\n\^_" nil t) ;single char
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5586 (replace-match "\n^_")) ;2 chars: "^" and "_"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5587 (goto-char (point-max))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5588 (insert "\^_")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5589
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5590 ;;(defun gnus-convert-article-to-rmail ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5591 ;; "Convert article in current buffer to Rmail message format."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5592 ;; (let ((buffer-read-only nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5593 ;; ;; Insert special header of Unix mail.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5594 ;; (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5595 ;; (insert "From "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5596 ;; (or (mail-strip-quoted-names (mail-fetch-field "from"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5597 ;; "unknown")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5598 ;; " " (current-time-string) "\n")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5599 ;; ;; Stop quoting `From' since this seems unnecessary in most cases.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5600 ;; ;; ``Quote'' "\nFrom " as "\n>From "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5601 ;; ;;(while (search-forward "\nFrom " nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5602 ;; ;; (forward-char -5)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5603 ;; ;; (insert ?>))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5604 ;; ;; Convert article to babyl format.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5605 ;; (rmail-convert-to-babyl-format)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5606 ;; ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5607
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5608
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5609 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5610 ;;; Internal functions.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5611 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5612
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5613 (defun gnus-start-news-server (&optional confirm)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5614 "Open network stream to remote NNTP server.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5615 If optional argument CONFIRM is non-nil, ask you host that NNTP server
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5616 is running even if it is defined.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5617 Run `gnus-open-server-hook' just before opening news server."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5618 (if (gnus-server-opened)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5619 ;; Stream is already opened.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5620 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5621 ;; Open NNTP server.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5622 (if (or confirm
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5623 (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
5624 ;; 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
5625 ;; 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
5626 (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
5627 (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
5628 ;; 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
5629 (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
5630 (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
5631 (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
5632 gnus-secondary-servers)
d701e7af5ba5 * gnus.el (gnus-start-news-server): If no server has been
Jim Blandy <jimb@redhat.com>
parents: 3610
diff changeset
5633 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
5634 (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
5635 (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
5636 (setq gnus-nntp-server "")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5637 ;; 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
5638 (if (or (string-equal gnus-nntp-server "")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5639 (string-equal gnus-nntp-server "::")) ;RMS preference.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5640 (setq gnus-nntp-server (system-name)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5641 ;; 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
5642 ;; 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
5643 ;; gnus-nntp-server.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5644 (cond ((and (null gnus-nntp-service)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5645 (string-equal gnus-nntp-server (system-name)))
716
f11e7af7c0d9 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 711
diff changeset
5646 (require 'nnspool)
f11e7af7c0d9 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 711
diff changeset
5647 (gnus-define-access-method 'nnspool)
f11e7af7c0d9 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 711
diff changeset
5648 (message "Looking up local news spool..."))
f11e7af7c0d9 *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 711
diff changeset
5649 ((string-match ":" gnus-nntp-server)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5650 ;; :DIRECTORY
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5651 (require 'mhspool)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5652 (gnus-define-access-method 'mhspool)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5653 (message "Looking up private directory..."))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5654 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5655 (gnus-define-access-method 'nntp)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5656 (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
5657 (run-hooks 'gnus-open-server-hook)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5658 (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
5659 (message ""))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5660 ((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
5661 (message ""))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5662 (t
8481
b4c5b7658550 (gnus-start-news-server): Fix the call to `error'.
Richard M. Stallman <rms@gnu.org>
parents: 8470
diff changeset
5663 (error "%s"
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5664 (gnus-nntp-message
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5665 (format "Cannot open NNTP server on %s" gnus-nntp-server)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5666 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5667
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5668 ;; Dummy functions used only once. Should return nil.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5669 (defun gnus-server-opened () nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5670 (defun gnus-close-server () nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5671
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5672 (defun gnus-nntp-message (&optional message)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5673 "Return a message returned from NNTP server.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5674 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
5675 (let ((status (gnus-status-message))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5676 (message (or message "")))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5677 (if (and (stringp status)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5678 (> (length status) 0))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5679 status message)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5680
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5681 (defun gnus-define-access-method (method &optional access-methods)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5682 "Define access functions for the access METHOD.
3591
507f64624555 Apply typo patches from Paul Eggert.
Jim Blandy <jimb@redhat.com>
parents: 3496
diff changeset
5683 Methods definition is taken from optional argument ACCESS-METHODS or
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5684 the variable `gnus-access-methods'."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5685 (let ((bindings
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5686 (cdr (assoc method (or access-methods gnus-access-methods)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5687 (if (null bindings)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5688 (error "Unknown access method: %s" method)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5689 ;; Should not use symbol-function here since overload does not work.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5690 (while bindings
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5691 ;; 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
5692 (fset (car (car bindings)) (car (cdr (car bindings))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5693 (setq bindings (cdr bindings)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5694 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5695
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5696 (defun gnus-select-newsgroup (group &optional show-all)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5697 "Select newsgroup GROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5698 If optional argument SHOW-ALL is non-nil, all of articles in the group
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5699 are selected."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5700 ;; 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
5701 (gnus-start-news-server)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5702 (if (gnus-request-group group)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5703 (let ((articles nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5704 (setq gnus-newsgroup-name group)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5705 (setq gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5706 (gnus-uncompress-sequence
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5707 (nthcdr 2 (gnus-gethash group gnus-unread-hashtb))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5708 (cond (show-all
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5709 ;; Select all active articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5710 (setq articles
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5711 (gnus-uncompress-sequence
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5712 (nthcdr 2 (gnus-gethash group gnus-active-hashtb)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5713 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5714 ;; Select unread articles only.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5715 (setq articles gnus-newsgroup-unreads)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5716 ;; Require confirmation if selecting large newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5717 (setq gnus-newsgroup-unselected nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5718 (if (not (numberp gnus-large-newsgroup))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5719 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5720 (let ((selected nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5721 (number (length articles)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5722 (if (> number gnus-large-newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5723 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5724 (condition-case ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5725 (let ((input
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5726 (read-string
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5727 (format
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5728 "How many articles from %s (default %d): "
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5729 gnus-newsgroup-name number))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5730 (setq selected
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5731 (if (string-equal input "")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5732 number (string-to-int input))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5733 (quit
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5734 (setq selected 0)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5735 (cond ((and (> selected 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5736 (< selected number))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5737 ;; Select last N articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5738 (setq articles (nthcdr (- number selected) articles)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5739 ((and (< selected 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5740 (< (- 0 selected) number))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5741 ;; Select first N articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5742 (setq selected (- 0 selected))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5743 (setq articles (copy-sequence articles))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5744 (setcdr (nthcdr (1- selected) articles) nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5745 ((zerop selected)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5746 (setq articles nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5747 ;; Otherwise select all.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5748 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5749 ;; Get unselected unread articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5750 (setq gnus-newsgroup-unselected
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5751 (gnus-set-difference gnus-newsgroup-unreads articles))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5752 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5753 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5754 ;; Get headers list.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5755 (setq gnus-newsgroup-headers (gnus-retrieve-headers articles))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5756 ;; UNREADS may contain expired articles, so we have to remove
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5757 ;; them from the list.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5758 (setq gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5759 (gnus-intersection gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5760 (mapcar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5761 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5762 (lambda (header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5763 (nntp-header-number header)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5764 gnus-newsgroup-headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5765 ;; Marked article must be a subset of unread articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5766 (setq gnus-newsgroup-marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5767 (gnus-intersection (append gnus-newsgroup-unselected
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5768 gnus-newsgroup-unreads)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5769 (cdr
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5770 (gnus-gethash group gnus-marked-hashtb))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5771 ;; First and last article in this newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5772 (setq gnus-newsgroup-begin
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5773 (if gnus-newsgroup-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5774 (nntp-header-number (car gnus-newsgroup-headers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5775 0
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5776 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5777 (setq gnus-newsgroup-end
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5778 (if gnus-newsgroup-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5779 (nntp-header-number
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5780 (gnus-last-element gnus-newsgroup-headers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5781 0
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5782 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5783 ;; File name that an article was saved last.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5784 (setq gnus-newsgroup-last-rmail nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5785 (setq gnus-newsgroup-last-mail nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5786 (setq gnus-newsgroup-last-folder nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5787 (setq gnus-newsgroup-last-file nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5788 ;; Reset article pointer etc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5789 (setq gnus-current-article nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5790 (setq gnus-current-headers nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5791 (setq gnus-current-history nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5792 (setq gnus-have-all-headers nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5793 (setq gnus-last-article nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5794 ;; 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
5795 (gnus-clear-hashtables-for-newsgroup-headers)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5796 ;; GROUP is successfully selected.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5797 t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5798 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5799 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5800
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5801 ;; Hacking for making header search much faster.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5802
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5803 (defun gnus-get-header-by-number (number)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5804 "Return a header specified by a NUMBER.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5805 If you update the variable `gnus-newsgroup-headers', you must set the
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5806 hash table `gnus-newsgroup-headers-hashtb-by-number' to nil to indicate
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5807 rehash is necessary."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5808 (or gnus-newsgroup-headers-hashtb-by-number
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5809 (gnus-make-headers-hashtable-by-number))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5810 (gnus-gethash (int-to-string number)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5811 gnus-newsgroup-headers-hashtb-by-number))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5812
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5813 (defun gnus-get-header-by-id (id)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5814 "Return a header specified by an ID.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5815 If you update the variable `gnus-newsgroup-headers', you must set the
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5816 hash table `gnus-newsgroup-headers-hashtb-by-id' to nil to indicate
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5817 rehash is necessary."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5818 (or gnus-newsgroup-headers-hashtb-by-id
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5819 (gnus-make-headers-hashtable-by-id))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5820 (and (stringp id)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5821 (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
5822
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5823 (defun gnus-make-headers-hashtable-by-number ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5824 "Make hashtable for the variable `gnus-newsgroup-headers' by number."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5825 (let ((header nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5826 (headers gnus-newsgroup-headers))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5827 (setq gnus-newsgroup-headers-hashtb-by-number
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5828 (gnus-make-hashtable (length headers)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5829 (while headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5830 (setq header (car headers))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5831 (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
5832 header gnus-newsgroup-headers-hashtb-by-number)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5833 (setq headers (cdr headers))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5834 )))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5835
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5836 (defun gnus-make-headers-hashtable-by-id ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5837 "Make hashtable for the variable `gnus-newsgroup-headers' by id."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5838 (let ((header nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5839 (headers gnus-newsgroup-headers))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5840 (setq gnus-newsgroup-headers-hashtb-by-id
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5841 (gnus-make-hashtable (length headers)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5842 (while headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5843 (setq header (car headers))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5844 (gnus-sethash (nntp-header-id header)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5845 header gnus-newsgroup-headers-hashtb-by-id)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5846 (setq headers (cdr headers))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5847 )))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5848
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5849 (defun gnus-clear-hashtables-for-newsgroup-headers ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5850 "Clear hash tables created for the variable `gnus-newsgroup-headers'."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5851 (setq gnus-newsgroup-headers-hashtb-by-id nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5852 (setq gnus-newsgroup-headers-hashtb-by-number nil))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5853
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5854 (defun gnus-more-header-backward ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5855 "Find new header backward."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5856 (let ((first
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5857 (car (nth 2 (gnus-gethash gnus-newsgroup-name gnus-active-hashtb))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5858 (artnum gnus-newsgroup-begin)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5859 (header nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5860 (while (and (not header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5861 (> artnum first))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5862 (setq artnum (1- artnum))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5863 (setq header (car (gnus-retrieve-headers (list artnum)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5864 header
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5865 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5866
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5867 (defun gnus-more-header-forward ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5868 "Find new header forward."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5869 (let ((last
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5870 (cdr (nth 2 (gnus-gethash gnus-newsgroup-name gnus-active-hashtb))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5871 (artnum gnus-newsgroup-end)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5872 (header nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5873 (while (and (not header)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5874 (< artnum last))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5875 (setq artnum (1+ artnum))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5876 (setq header (car (gnus-retrieve-headers (list artnum)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5877 header
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5878 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5879
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5880 (defun gnus-extend-newsgroup (header &optional backward)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5881 "Extend newsgroup selection with HEADER.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5882 Optional argument BACKWARD means extend toward backward."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5883 (if header
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5884 (let ((artnum (nntp-header-number header)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5885 (setq gnus-newsgroup-headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5886 (if backward
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5887 (cons header gnus-newsgroup-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5888 (append gnus-newsgroup-headers (list header))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5889 ;; 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
5890 (gnus-clear-hashtables-for-newsgroup-headers)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5891 ;; We have to update unreads and unselected, but don't have to
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5892 ;; care about gnus-newsgroup-marked.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5893 (if (memq artnum gnus-newsgroup-unselected)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5894 (setq gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5895 (cons artnum gnus-newsgroup-unreads)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5896 (setq gnus-newsgroup-unselected
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5897 (delq artnum gnus-newsgroup-unselected))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5898 (setq gnus-newsgroup-begin (min gnus-newsgroup-begin artnum))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5899 (setq gnus-newsgroup-end (max gnus-newsgroup-end artnum))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5900 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5901
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5902 (defun gnus-mark-article-as-read (article)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5903 "Remember that ARTICLE is marked as read."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5904 ;; Remove from unread and marked list.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5905 (setq gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5906 (delq article gnus-newsgroup-unreads))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5907 (setq gnus-newsgroup-marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5908 (delq article gnus-newsgroup-marked)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5909
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5910 (defun gnus-mark-article-as-unread (article &optional clear-mark)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5911 "Remember that ARTICLE is marked as unread.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5912 Optional argument CLEAR-MARK means ARTICLE should not be remembered
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5913 that it was marked as read once."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5914 ;; Add to unread list.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5915 (or (memq article gnus-newsgroup-unreads)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5916 (setq gnus-newsgroup-unreads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5917 (cons article gnus-newsgroup-unreads)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5918 ;; If CLEAR-MARK is non-nil, the article must be removed from marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5919 ;; list. Otherwise, it must be added to the list.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5920 (if clear-mark
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5921 (setq gnus-newsgroup-marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5922 (delq article gnus-newsgroup-marked))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5923 (or (memq article gnus-newsgroup-marked)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5924 (setq gnus-newsgroup-marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5925 (cons article gnus-newsgroup-marked)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5926
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5927 (defun gnus-clear-system ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5928 "Clear all variables and buffer."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5929 ;; Clear GNUS variables.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5930 (let ((variables gnus-variable-list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5931 (while variables
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5932 (set (car variables) nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5933 (setq variables (cdr variables))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5934 ;; Clear other internal variables.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5935 (setq gnus-newsrc-hashtb nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5936 (setq gnus-marked-hashtb nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5937 (setq gnus-killed-hashtb nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5938 (setq gnus-active-hashtb nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5939 (setq gnus-octive-hashtb nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5940 (setq gnus-unread-hashtb nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5941 (setq gnus-newsgroup-headers nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5942 (setq gnus-newsgroup-headers-hashtb-by-id nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5943 (setq gnus-newsgroup-headers-hashtb-by-number nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5944 ;; Kill the startup file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5945 (and gnus-current-startup-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5946 (get-file-buffer gnus-current-startup-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5947 (kill-buffer (get-file-buffer gnus-current-startup-file)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5948 (setq gnus-current-startup-file nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5949 ;; Kill GNUS buffers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5950 (let ((buffers gnus-buffer-list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5951 (while buffers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5952 (if (get-buffer (car buffers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5953 (kill-buffer (car buffers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5954 (setq buffers (cdr buffers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5955 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5956
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5957 (defun gnus-configure-windows (action)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5958 "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
5959 The ACTION is either a symbol, such as `summary', or a
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5960 configuration list such as `(1 1 2)'. If ACTION is not a list,
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5961 configuration list is got from the variable `gnus-window-configuration'."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5962 (let* ((windows
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5963 (if (listp action)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5964 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
5965 (grpwin (get-buffer-window gnus-group-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5966 (subwin (get-buffer-window gnus-summary-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5967 (artwin (get-buffer-window gnus-article-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5968 (winsum nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5969 (height nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5970 (grpheight 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5971 (subheight 0)
9824
1a60406f3d3e (gnus-configure-windows): Make split-window-keep-point locally t so that focus
Karl Heuer <kwzh@gnu.org>
parents: 9550
diff changeset
5972 (artheight 0)
1a60406f3d3e (gnus-configure-windows): Make split-window-keep-point locally t so that focus
Karl Heuer <kwzh@gnu.org>
parents: 9550
diff changeset
5973 ;; Make split-window-vertically leave focus in upper window.
1a60406f3d3e (gnus-configure-windows): Make split-window-keep-point locally t so that focus
Karl Heuer <kwzh@gnu.org>
parents: 9550
diff changeset
5974 (split-window-keep-point t))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5975 (if (or (null windows) ;No configuration is specified.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5976 (and (eq (null grpwin)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5977 (zerop (nth 0 windows)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5978 (eq (null subwin)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5979 (zerop (nth 1 windows)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5980 (eq (null artwin)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5981 (zerop (nth 2 windows)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5982 ;; No need to change window configuration.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5983 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5984 (select-window (or grpwin subwin artwin (selected-window)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5985 ;; First of all, compute the height of each window.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5986 (cond (gnus-use-full-window
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5987 ;; Take up the entire screen.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5988 (delete-other-windows)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5989 (setq height (window-height (selected-window))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5990 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5991 (setq height (+ (if grpwin (window-height grpwin) 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5992 (if subwin (window-height subwin) 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5993 (if artwin (window-height artwin) 0)))))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
5994 ;; The Newsgroup buffer exits always. So, use it to extend the
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5995 ;; 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
5996 (switch-to-buffer gnus-group-buffer 'norecord)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5997 (and (get-buffer gnus-summary-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5998 (delete-windows-on gnus-summary-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
5999 (and (get-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6000 (delete-windows-on gnus-article-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6001 ;; Compute expected window height.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6002 (setq winsum (apply (function +) windows))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6003 (if (not (zerop (nth 0 windows)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6004 (setq grpheight (max window-min-height
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6005 (/ (* height (nth 0 windows)) winsum))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6006 (if (not (zerop (nth 1 windows)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6007 (setq subheight (max window-min-height
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6008 (/ (* height (nth 1 windows)) winsum))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6009 (if (not (zerop (nth 2 windows)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6010 (setq artheight (max window-min-height
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6011 (/ (* height (nth 2 windows)) winsum))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6012 (setq height (+ grpheight subheight artheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6013 (enlarge-window (max 0 (- height (window-height (selected-window)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6014 ;; Then split the window.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6015 (and (not (zerop artheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6016 (or (not (zerop grpheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6017 (not (zerop subheight)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6018 (split-window-vertically (+ grpheight subheight)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6019 (and (not (zerop grpheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6020 (not (zerop subheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6021 (split-window-vertically grpheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6022 ;; Then select buffers in each window.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6023 (and (not (zerop grpheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6024 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6025 (switch-to-buffer gnus-group-buffer 'norecord)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6026 (other-window 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6027 (and (not (zerop subheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6028 (progn
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6029 (switch-to-buffer gnus-summary-buffer 'norecord)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6030 (other-window 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6031 (and (not (zerop artheight))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6032 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6033 ;; If Article buffer does not exist, it will be created
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6034 ;; and initialized.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6035 (gnus-article-setup-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6036 (switch-to-buffer gnus-article-buffer 'norecord)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6037 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6038 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6039
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6040 (defun gnus-find-header-by-number (headers number)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6041 "Return a header which is a element of HEADERS and has NUMBER."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6042 (let ((found nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6043 (while (and headers (not found))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6044 ;; We cannot use `=' to accept non-numeric NUMBER.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6045 (if (eq number (nntp-header-number (car headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6046 (setq found (car headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6047 (setq headers (cdr headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6048 found
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6049 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6050
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6051 (defun gnus-find-header-by-id (headers id)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6052 "Return a header which is a element of HEADERS and has Message-ID."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6053 (let ((found nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6054 (while (and headers (not found))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6055 (if (string-equal id (nntp-header-id (car headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6056 (setq found (car headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6057 (setq headers (cdr headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6058 found
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6059 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6060
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6061 (defun gnus-version ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6062 "Version numbers of this version of GNUS."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6063 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6064 (cond ((and (boundp 'mhspool-version) (boundp 'nnspool-version))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6065 (message "%s; %s; %s; %s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6066 gnus-version nntp-version nnspool-version mhspool-version))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6067 ((boundp 'mhspool-version)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6068 (message "%s; %s; %s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6069 gnus-version nntp-version mhspool-version))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6070 ((boundp 'nnspool-version)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6071 (message "%s; %s; %s"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6072 gnus-version nntp-version nnspool-version))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6073 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6074 (message "%s; %s" gnus-version nntp-version))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6075
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6076 (defun gnus-info-find-node ()
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6077 "Find Info documentation of GNUS."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6078 (interactive)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6079 (require 'info)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6080 ;; Enlarge info window if needed.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6081 (cond ((eq major-mode 'gnus-group-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6082 (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
6083 (pop-to-buffer gnus-group-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6084 ((eq major-mode 'gnus-summary-mode)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6085 (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
6086 (pop-to-buffer gnus-summary-buffer)))
2845
7a48e4a67e8c (gnus-info-directory): Variable removed.
Roland McGrath <roland@gnu.org>
parents: 2843
diff changeset
6087 (Info-goto-node (car (cdr (assq major-mode gnus-info-nodes)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6088
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6089 (defun gnus-overload-functions (&optional overloads)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6090 "Overload functions specified by optional argument OVERLOADS.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6091 If nothing is specified, use the variable `gnus-overload-functions'."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6092 (let ((defs nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6093 (overloads (or overloads gnus-overload-functions)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6094 (while overloads
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6095 (setq defs (car overloads))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6096 (setq overloads (cdr overloads))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6097 ;; 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
6098 ;; sure we cannot use `require' always.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6099 (and (not (fboundp (car defs)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6100 (car (cdr (cdr defs)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6101 (load (car (cdr (cdr defs))) nil 'nomessage))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6102 (fset (car defs) (car (cdr defs)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6103 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6104
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6105 (defun gnus-make-threads (newsgroup-headers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6106 "Make conversation threads tree from NEWSGROUP-HEADERS."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6107 (let ((headers newsgroup-headers)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6108 (refer nil)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6109 (h nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6110 (d nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6111 (roots nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6112 (dependencies nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6113 ;; Make message dependency alist.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6114 (while headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6115 (setq h (car headers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6116 (setq headers (cdr headers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6117 ;; Ignore invalid headers.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6118 (if (vectorp h) ;Depends on nntp.el.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6119 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6120 ;; 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
6121 (setq refer (nntp-header-references h))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6122 (setq d (and refer
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6123 (string-match "\\(<[^<>]+>\\)[^>]*$" refer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6124 ;; (gnus-find-header-by-id
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6125 ;; newsgroup-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6126 ;; (substring refer (match-beginning 1) (match-end 1)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6127 ;; In fact if the variable newsgroup-headers
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6128 ;; is not 'equal' to the variable
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6129 ;; gnus-newsgroup-headers, the following
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6130 ;; function call may return bogus value.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6131 (gnus-get-header-by-id
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6132 (substring refer (match-beginning 1) (match-end 1)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6133 ))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6134 ;; Check subject equality.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6135 (or gnus-thread-ignore-subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6136 (null d)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6137 (string-equal (gnus-simplify-subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6138 (nntp-header-subject h) 're)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6139 (gnus-simplify-subject
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6140 (nntp-header-subject d) 're))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6141 ;; H should be a thread root.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6142 (setq d nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6143 ;; H depends on D.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6144 (setq dependencies
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6145 (cons (cons h d) dependencies))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6146 ;; H is a thread root.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6147 (if (null d)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6148 (setq roots (cons h roots)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6149 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6150 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6151 ;; Make complete threads from the roots.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6152 ;; Note: dependencies are in reverse order, but
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6153 ;; gnus-make-threads-1 processes it in reverse order again. So,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6154 ;; we don't have to worry about it.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6155 (mapcar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6156 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6157 (lambda (root)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6158 (gnus-make-threads-1 root dependencies))) (nreverse roots))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6159 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6160
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6161 (defun gnus-make-threads-1 (parent dependencies)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6162 (let ((children nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6163 (d nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6164 (depends dependencies))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6165 ;; Find children.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6166 (while depends
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6167 (setq d (car depends))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6168 (setq depends (cdr depends))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6169 (and (cdr d)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6170 (eq (nntp-header-id parent) (nntp-header-id (cdr d)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6171 (setq children (cons (car d) children))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6172 ;; Go down.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6173 (cons parent
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6174 (mapcar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6175 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6176 (lambda (child)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6177 (gnus-make-threads-1 child dependencies))) children))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6178 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6179
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6180 (defun gnus-narrow-to-page (&optional arg)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6181 "Make text outside current page invisible except for page delimiter.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6182 A numeric arg specifies to move forward or backward by that many pages,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6183 thus showing a page other than the one point was originally in."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6184 (interactive "P")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6185 (setq arg (if arg (prefix-numeric-value arg) 0))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6186 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6187 (forward-page -1) ;Beginning of current page.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6188 (widen)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6189 (if (> arg 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6190 (forward-page arg)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6191 (if (< arg 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6192 (forward-page (1- arg))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6193 ;; Find the end of the page.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6194 (forward-page)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6195 ;; If we stopped due to end of buffer, stay there.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6196 ;; If we stopped after a page delimiter, put end of restriction
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6197 ;; at the beginning of that line.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6198 ;; These are commented out.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6199 ;; (if (save-excursion (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6200 ;; (looking-at page-delimiter))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6201 ;; (beginning-of-line))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6202 (narrow-to-region (point)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6203 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6204 ;; Find the top of the page.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6205 (forward-page -1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6206 ;; If we found beginning of buffer, stay there.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6207 ;; If extra text follows page delimiter on same line,
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6208 ;; include it.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6209 ;; Otherwise, show text starting with following line.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6210 (if (and (eolp) (not (bobp)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6211 (forward-line 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6212 (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6213 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6214
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6215 ;; 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
6216 ;; gnus-killed-assoc, and gnus-marked-assoc.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6217
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6218 (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
6219 "Return hash table for ALIST.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6220 Optional argument HASHSIZE specifies the hashtable size.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6221 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
6222 (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
6223 (while alist
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6224 (gnus-sethash (car (car alist)) ;Newsgroup name
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6225 (car alist) ;Alist element
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6226 hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6227 (setq alist (cdr alist)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6228 hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6229 ))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6230
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6231 (defun gnus-last-element (list)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6232 "Return last element of LIST."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6233 (let ((last nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6234 (while list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6235 (if (null (cdr list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6236 (setq last (car list)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6237 (setq list (cdr list)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6238 last
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6239 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6240
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6241 (defun gnus-set-difference (list1 list2)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6242 "Return a list of elements of LIST1 that do not appear in LIST2."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6243 (let ((list1 (copy-sequence list1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6244 (while list2
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6245 (setq list1 (delq (car list2) list1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6246 (setq list2 (cdr list2)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6247 list1
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6248 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6249
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6250 (defun gnus-intersection (list1 list2)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6251 "Return a list of elements that appear in both LIST1 and LIST2."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6252 (let ((result nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6253 (while list2
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6254 (if (memq (car list2) list1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6255 (setq result (cons (car list2) result)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6256 (setq list2 (cdr list2)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6257 result
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6258 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6259
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6260
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6261 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6262 ;;; Get information about active articles, already read articles, and
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6263 ;;; still unread articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6264 ;;;
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6265
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6266 ;; GNUS internal format of gnus-newsrc-assoc and gnus-killed-assoc:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6267 ;; (("general" t (1 . 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6268 ;; ("misc" t (1 . 10) (12 . 15))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6269 ;; ("test" nil (1 . 99)) ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6270 ;; GNUS internal format of gnus-marked-assoc:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6271 ;; (("general" 1 2 3)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6272 ;; ("misc" 2) ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6273 ;; GNUS internal format of gnus-active-hashtb:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6274 ;; (("general" t (1 . 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6275 ;; ("misc" t (1 . 10))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6276 ;; ("test" nil (1 . 99)) ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6277 ;; GNUS internal format of gnus-unread-hashtb:
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6278 ;; (("general" 1 (1 . 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6279 ;; ("misc" 14 (1 . 10) (12 . 15))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6280 ;; ("test" 99 (1 . 99)) ...)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6281
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6282 (defun gnus-setup-news (&optional rawfile)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6283 "Setup news information.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6284 If optional argument RAWFILE is non-nil, force to read raw startup file."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6285 (let ((init (not (and gnus-newsrc-assoc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6286 gnus-active-hashtb
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6287 gnus-unread-hashtb
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6288 (not rawfile)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6289 ))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6290 ;; We have to clear some variables to re-initialize news info.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6291 (if init
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6292 (setq gnus-newsrc-assoc nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6293 gnus-active-hashtb nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6294 gnus-unread-hashtb nil))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6295 (gnus-read-active-file)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6296 ;; Initialize only once.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6297 (if init
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6298 (progn
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6299 ;; Get distributions only once.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6300 (gnus-read-distributions-file)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6301 ;; 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
6302 ;; 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
6303 (gnus-read-newsrc-file rawfile)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6304 ))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6305 (gnus-expire-marked-articles)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6306 (gnus-get-unread-articles)
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6307
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6308 ;; newsgroups description
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6309 (if gnus-newsgroups-display
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6310 (if (not gnus-newsgroups-alist)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6311 ;; Get newsgroups file only once.
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6312 (gnus-newsgroups-retrieve-description)))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6313
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6314 (setq gnus-newsgroups-hashtb (gnus-make-hashtable-from-alist gnus-newsgroups-alist))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
6315
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6316 ;; Check new newsgroups and subscribe them.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6317 (if init
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6318 (let ((new-newsgroups (gnus-find-new-newsgroups)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6319 (while new-newsgroups
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6320 (funcall gnus-subscribe-newsgroup-method (car new-newsgroups))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6321 (setq new-newsgroups (cdr new-newsgroups))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6322 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6323 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6324
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6325 (defun gnus-add-newsgroup (newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6326 "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
6327 (and (null (gnus-gethash newsgroup gnus-newsrc-hashtb)) ;Really new?
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6328 (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
6329 (gnus-insert-newsgroup (or (gnus-gethash newsgroup gnus-killed-hashtb)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6330 (list newsgroup t))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6331 (car (car gnus-newsrc-assoc)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6332
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6333 (defun gnus-find-new-newsgroups ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6334 "Looking for new newsgroups and return names.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6335 `-n' option of options line in `.newsrc' file is recognized."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6336 (let ((group nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6337 (new-newsgroups nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6338 (mapatoms
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6339 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6340 (lambda (sym)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6341 (setq group (symbol-name sym))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6342 ;; Taking account of `-n' option.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6343 (and (or (null gnus-newsrc-options-n-no)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6344 (not (string-match gnus-newsrc-options-n-no group))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6345 (and gnus-newsrc-options-n-yes
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6346 (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
6347 (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
6348 (null (gnus-gethash group gnus-newsrc-hashtb)) ;Really new.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6349 ;; Find new newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6350 (setq new-newsgroups
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6351 (cons group new-newsgroups)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6352 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6353 gnus-active-hashtb)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6354 ;; Return new newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6355 new-newsgroups
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6356 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6357
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6358 (defun gnus-kill-newsgroup (group)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6359 "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
6360 (let ((info (gnus-gethash group gnus-newsrc-hashtb)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6361 (if (null info)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6362 nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6363 ;; Delete from gnus-newsrc-assoc and gnus-newsrc-hashtb.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6364 (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
6365 (gnus-sethash group nil gnus-newsrc-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6366 ;; Add to gnus-killed-assoc and gnus-killed-hashtb.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6367 (setq gnus-killed-assoc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6368 (cons info
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6369 (delq (gnus-gethash group gnus-killed-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6370 gnus-killed-assoc)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6371 (gnus-sethash group info gnus-killed-hashtb)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6372 ;; Clear unread hashtable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6373 ;; Thanks cwitty@csli.Stanford.EDU (Carl Witty).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6374 (gnus-sethash group nil gnus-unread-hashtb)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6375 ;; Then delete from .newsrc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6376 (gnus-update-newsrc-buffer group 'delete)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6377 ;; Return the deleted newsrc entry.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6378 info
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6379 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6380
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6381 (defun gnus-insert-newsgroup (info &optional next)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6382 "Insert newsrc INFO entry before NEXT.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6383 If optional argument NEXT is nil, appended to the last."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6384 (if (null info)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6385 (error "Invalid argument: %s" info))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6386 (let* ((group (car info)) ;Newsgroup name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6387 (range
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6388 (gnus-difference-of-range
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6389 (nth 2 (gnus-gethash group gnus-active-hashtb)) (nthcdr 2 info))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6390 ;; Check duplication.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6391 (if (gnus-gethash group gnus-newsrc-hashtb)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6392 (error "Duplicated: %s" group))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6393 ;; Insert to gnus-newsrc-assoc and gnus-newsrc-hashtb.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6394 (if (string-equal next (car (car gnus-newsrc-assoc)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6395 (setq gnus-newsrc-assoc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6396 (cons info gnus-newsrc-assoc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6397 (let ((found nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6398 (rest (cdr gnus-newsrc-assoc))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6399 (tail gnus-newsrc-assoc))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6400 ;; Seach insertion point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6401 (while (and (not found) rest)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6402 (if (string-equal next (car (car rest)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6403 (setq found t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6404 (setq rest (cdr rest))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6405 (setq tail (cdr tail))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6406 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6407 ;; Find it.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6408 (if (consp tail)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6409 (setcdr tail (cons info rest))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6410 ;; gnus-newsrc-assoc must be nil.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6411 (setq gnus-newsrc-assoc
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6412 (append gnus-newsrc-assoc (cons info rest))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6413 ))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6414 (gnus-sethash group info gnus-newsrc-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6415 ;; Delete from gnus-killed-assoc and gnus-killed-hashtb.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6416 (setq gnus-killed-assoc
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6417 (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
6418 (gnus-sethash group nil gnus-killed-hashtb)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6419 ;; Then insert to .newsrc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6420 (gnus-update-newsrc-buffer group nil next)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6421 ;; Add to gnus-unread-hashtb.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6422 (gnus-sethash group
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6423 (cons group ;Newsgroup name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6424 (cons (gnus-number-of-articles range) range))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6425 gnus-unread-hashtb)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6426 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6427
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6428 (defun gnus-check-killed-newsgroups ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6429 "Update `gnus-killed-assoc' based on `gnus-newsrc-assoc'.
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6430 Update `gnus-killed-hashtb' also."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6431 (let ((group nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6432 (new-killed nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6433 (old-killed gnus-killed-assoc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6434 (while old-killed
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6435 (setq group (car (car old-killed)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6436 (and (or (null gnus-newsrc-options-n-no)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6437 (not (string-match gnus-newsrc-options-n-no group))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6438 (and gnus-newsrc-options-n-yes
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6439 (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
6440 (null (gnus-gethash group gnus-newsrc-hashtb)) ;No duplication.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6441 ;; Subscribed in options line and not in gnus-newsrc-assoc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6442 (setq new-killed
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6443 (cons (car old-killed) new-killed)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6444 (setq old-killed (cdr old-killed))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6445 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6446 (setq gnus-killed-assoc (nreverse new-killed))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6447 (setq gnus-killed-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6448 (gnus-make-hashtable-from-alist gnus-killed-assoc))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6449 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6450
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6451 (defun gnus-check-bogus-newsgroups (&optional confirm)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6452 "Delete bogus newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6453 If optional argument CONFIRM is non-nil, confirm deletion of newsgroups."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6454 (let ((group nil) ;Newsgroup name temporary used.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6455 (old-newsrc gnus-newsrc-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6456 (new-newsrc nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6457 (bogus nil) ;List of bogus newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6458 (old-killed gnus-killed-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6459 (new-killed nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6460 (old-marked gnus-marked-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6461 (new-marked nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6462 (message "Checking bogus newsgroups...")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6463 ;; Update gnus-newsrc-assoc and gnus-newsrc-hashtb.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6464 (while old-newsrc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6465 (setq group (car (car old-newsrc)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6466 (if (or (gnus-gethash group gnus-active-hashtb)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6467 (and confirm
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6468 (not (y-or-n-p
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6469 (format "Delete bogus newsgroup: %s " group)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6470 ;; Active newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6471 (setq new-newsrc (cons (car old-newsrc) new-newsrc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6472 ;; Found a bogus newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6473 (setq bogus (cons group bogus)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6474 (setq old-newsrc (cdr old-newsrc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6475 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6476 (setq gnus-newsrc-assoc (nreverse new-newsrc))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6477 (setq gnus-newsrc-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6478 (gnus-make-hashtable-from-alist gnus-newsrc-assoc))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6479 ;; Update gnus-killed-assoc and gnus-killed-hashtb.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6480 ;; The killed newsgroups are deleted without any confirmations.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6481 (while old-killed
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6482 (setq group (car (car old-killed)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6483 (and (gnus-gethash group gnus-active-hashtb)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6484 (null (gnus-gethash group gnus-newsrc-hashtb))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6485 ;; Active and really killed newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6486 (setq new-killed (cons (car old-killed) new-killed)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6487 (setq old-killed (cdr old-killed))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6488 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6489 (setq gnus-killed-assoc (nreverse new-killed))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6490 (setq gnus-killed-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6491 (gnus-make-hashtable-from-alist gnus-killed-assoc))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6492 ;; Remove BOGUS from .newsrc file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6493 (while bogus
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6494 (gnus-update-newsrc-buffer (car bogus) 'delete)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6495 (setq bogus (cdr bogus)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6496 ;; Update gnus-marked-assoc and gnus-marked-hashtb.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6497 (while old-marked
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6498 (setq group (car (car old-marked)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6499 (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
6500 (gnus-gethash group gnus-newsrc-hashtb)) ;Not bogus?
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6501 (setq new-marked (cons (car old-marked) new-marked)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6502 (setq old-marked (cdr old-marked)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6503 (setq gnus-marked-assoc new-marked)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6504 (setq gnus-marked-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6505 (gnus-make-hashtable-from-alist gnus-marked-assoc))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6506 (message "Checking bogus newsgroups...done")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6507 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6508
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6509 (defun gnus-get-unread-articles ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6510 "Compute diffs between active and read articles."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6511 (let ((read gnus-newsrc-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6512 (group-info nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6513 (group-name nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6514 (active nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6515 (range nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6516 (message "Checking new news...")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6517 (or gnus-unread-hashtb
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6518 (setq gnus-unread-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6519 (gnus-make-hashtable (length gnus-active-hashtb))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6520 (while read
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6521 (setq group-info (car read)) ;About one newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6522 (setq group-name (car group-info))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6523 (setq active (nth 2 (gnus-gethash group-name gnus-active-hashtb)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6524 (if (and gnus-octive-hashtb
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6525 ;; Is nothing changed?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6526 (equal active
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6527 (nth 2 (gnus-gethash group-name gnus-octive-hashtb)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6528 ;; Is this newsgroup in the unread hash table?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6529 (gnus-gethash group-name gnus-unread-hashtb)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6530 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6531 nil ;Nothing to do.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6532 (setq range (gnus-difference-of-range active (nthcdr 2 group-info)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6533 (gnus-sethash group-name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6534 (cons group-name ;Group name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6535 (cons (gnus-number-of-articles range)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6536 range)) ;Range of unread articles
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6537 gnus-unread-hashtb)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6538 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6539 (setq read (cdr read))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6540 )
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6541 (message "Checking new news...done")
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6542 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6543
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6544 (defun gnus-expire-marked-articles ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6545 "Check expired article which is marked as unread."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6546 (let ((marked-assoc gnus-marked-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6547 (updated-assoc nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6548 (marked nil) ;Current marked info.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6549 (articles nil) ;List of marked articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6550 (updated nil) ;List of real marked.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6551 (begin nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6552 (while marked-assoc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6553 (setq marked (car marked-assoc))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6554 (setq articles (cdr marked))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6555 (setq updated nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6556 (setq begin
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6557 (car (nth 2 (gnus-gethash (car marked) gnus-active-hashtb))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6558 (while (and begin articles)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6559 (if (>= (car articles) begin)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6560 ;; This article is still active.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6561 (setq updated (cons (car articles) updated)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6562 (setq articles (cdr articles)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6563 (if updated
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6564 (setq updated-assoc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6565 (cons (cons (car marked) updated) updated-assoc)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6566 (setq marked-assoc (cdr marked-assoc)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6567 (setq gnus-marked-assoc updated-assoc)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6568 (setq gnus-marked-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6569 (gnus-make-hashtable-from-alist gnus-marked-assoc))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6570 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6571
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6572 (defun gnus-mark-as-read-by-xref
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6573 (group headers unreads &optional subscribed-only)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6574 "Mark articles as read using cross references and return updated newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6575 Arguments are GROUP, HEADERS, UNREADS, and optional SUBSCRIBED-ONLY."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6576 (let ((xref-list nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6577 (header nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6578 (xrefs nil) ;One Xref: field info.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6579 (xref nil) ;(NEWSGROUP . ARTICLE)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6580 (gname nil) ;Newsgroup name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6581 (article nil)) ;Article number
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6582 (while headers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6583 (setq header (car headers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6584 (if (memq (nntp-header-number header) unreads)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6585 ;; This article is not yet marked as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6586 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6587 (setq xrefs (gnus-parse-xref-field (nntp-header-xref header)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6588 ;; For each cross reference info. in one Xref: field.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6589 (while xrefs
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6590 (setq xref (car xrefs))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6591 (setq gname (car xref)) ;Newsgroup name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6592 (setq article (cdr xref)) ;Article number
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6593 (or (string-equal group gname) ;Ignore current newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6594 ;; Ignore unsubscribed newsgroup if requested.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6595 (and subscribed-only
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6596 (not (nth 1 (gnus-gethash gname gnus-newsrc-hashtb))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6597 ;; Ignore article marked as unread.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6598 (memq article (cdr (gnus-gethash gname gnus-marked-hashtb)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6599 (let ((group-xref (assoc gname xref-list)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6600 (if group-xref
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6601 (if (memq article (cdr group-xref))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6602 nil ;Alread marked.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6603 (setcdr group-xref (cons article (cdr group-xref))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6604 ;; Create new assoc entry for GROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6605 (setq xref-list (cons (list gname article) xref-list)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6606 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6607 (setq xrefs (cdr xrefs))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6608 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6609 (setq headers (cdr headers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6610 ;; Mark cross referenced articles as read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6611 (gnus-mark-xrefed-as-read xref-list)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6612 ;;(message "%s %s" (prin1-to-string unreads) (prin1-to-string xref-list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6613 ;; Return list of updated group name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6614 (mapcar (function car) xref-list)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6615 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6616
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6617 (defun gnus-parse-xref-field (xref-value)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6618 "Parse Xref: field value, and return list of `(group . article-id)'."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6619 (let ((xref-list nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6620 (xref-value (or xref-value "")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6621 ;; Remove server host name.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6622 (if (string-match "^[ \t]*[^ \t,]+[ \t,]+\\(.*\\)$" xref-value)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6623 (setq xref-value (substring xref-value (match-beginning 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6624 (setq xref-value nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6625 ;; Process each xref info.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6626 (while xref-value
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6627 (if (string-match
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6628 "^[ \t,]*\\([^ \t,]+\\):\\([0-9]+\\)[^0-9]*" xref-value)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6629 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6630 (setq xref-list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6631 (cons
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6632 (cons
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6633 ;; Group name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6634 (substring xref-value (match-beginning 1) (match-end 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6635 ;; Article-ID
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6636 (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6637 (substring xref-value (match-beginning 2) (match-end 2))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6638 xref-list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6639 (setq xref-value (substring xref-value (match-end 2))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6640 (setq xref-value nil)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6641 ;; Return alist.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6642 xref-list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6643 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6644
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6645 (defun gnus-mark-xrefed-as-read (xrefs)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6646 "Update unread article information using XREFS alist."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6647 (let ((group nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6648 (idlist nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6649 (unread nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6650 (while xrefs
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6651 (setq group (car (car xrefs)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6652 (setq idlist (cdr (car xrefs)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6653 (setq unread (gnus-uncompress-sequence
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6654 (nthcdr 2 (gnus-gethash group gnus-unread-hashtb))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6655 (while idlist
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6656 (setq unread (delq (car idlist) unread))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6657 (setq idlist (cdr idlist)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6658 (gnus-update-unread-articles group unread 'ignore)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6659 (setq xrefs (cdr xrefs))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6660 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6661
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6662 (defun gnus-update-unread-articles (group unread-list marked-list)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6663 "Update unread articles of GROUP using UNREAD-LIST and MARKED-LIST."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6664 (let ((active (nth 2 (gnus-gethash group gnus-active-hashtb)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6665 (unread (gnus-gethash group gnus-unread-hashtb)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6666 (if (or (null active) (null unread))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6667 ;; Ignore unknown newsgroup.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6668 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6669 ;; Update gnus-unread-hashtb.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6670 (if unread-list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6671 (setcdr (cdr unread)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6672 (gnus-compress-sequence unread-list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6673 ;; All of the articles are read.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6674 (setcdr (cdr unread) '((0 . 0))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6675 ;; Number of unread articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6676 (setcar (cdr unread)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6677 (gnus-number-of-articles (nthcdr 2 unread)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6678 ;; Update gnus-newsrc-assoc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6679 (if (> (car active) 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6680 ;; Articles from 1 to N are not active.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6681 (setq active (cons 1 (cdr active))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6682 (setcdr (cdr (gnus-gethash group gnus-newsrc-hashtb))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6683 (gnus-difference-of-range active (nthcdr 2 unread)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6684 ;; Update .newsrc buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6685 (gnus-update-newsrc-buffer group)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6686 ;; Update gnus-marked-assoc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6687 (if (listp marked-list) ;Includes NIL.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6688 (let ((marked (gnus-gethash group gnus-marked-hashtb)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6689 (cond (marked ;There is an entry.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6690 (setcdr marked marked-list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6691 (marked-list ;Non-NIL.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6692 (let ((info (cons group marked-list)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6693 ;; hashtb must share the same cons cell.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6694 (setq gnus-marked-assoc
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6695 (cons info gnus-marked-assoc))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6696 (gnus-sethash group info gnus-marked-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6697 ))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6698 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6699 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6700
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6701 (defun gnus-read-active-file ()
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6702 "Get active file from NNTP server."
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6703 ;; 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
6704 (gnus-start-news-server)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6705 (message "Reading active file...")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6706 (if (gnus-request-list) ;Get active file from server
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6707 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6708 (set-buffer nntp-server-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6709 (gnus-active-to-gnus-format)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6710 (message "Reading active file...done"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6711 (error "Cannot read active file from NNTP server.")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6712
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6713 (defun gnus-active-to-gnus-format ()
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6714 "Convert active file format to internal format.
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6715 Lines matching `gnus-ignored-newsgroups' are ignored."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6716 ;; Delete unnecessary lines.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6717 (goto-char (point-min))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6718 ;;(delete-matching-lines "^to\\..*$")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6719 (delete-matching-lines gnus-ignored-newsgroups)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6720 ;; Save OLD active info.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6721 (setq gnus-octive-hashtb gnus-active-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6722 ;; Make large enough hash table.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6723 (setq gnus-active-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6724 (gnus-make-hashtable (count-lines (point-min) (point-max))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6725 ;; Store active file in hashtable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6726 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6727 (while
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6728 (re-search-forward
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6729 "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([ymn]\\).*$"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6730 nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6731 (gnus-sethash
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6732 (buffer-substring (match-beginning 1) (match-end 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6733 (list (buffer-substring (match-beginning 1) (match-end 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6734 (string-equal
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6735 "y" (buffer-substring (match-beginning 4) (match-end 4)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6736 (cons (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6737 (buffer-substring (match-beginning 3) (match-end 3)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6738 (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6739 (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
6740 gnus-active-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6741 ))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6742
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6743 (defun gnus-read-newsrc-file (&optional rawfile)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6744 "Read startup FILE.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6745 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
6746 (setq gnus-current-startup-file (gnus-make-newsrc-file gnus-startup-file))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6747 ;; Reset variables which may be included in the quick startup file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6748 (let ((variables gnus-variable-list))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6749 (while variables
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6750 (set (car variables) nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6751 (setq variables (cdr variables))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6752 (let* ((newsrc-file gnus-current-startup-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6753 (quick-file (concat newsrc-file ".el"))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6754 (quick-loaded nil))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6755 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6756 ;; Prepare .newsrc buffer.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6757 (set-buffer (find-file-noselect newsrc-file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6758 ;; 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
6759 ;;(buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6760 ;; Load quick .newsrc to restore gnus-marked-assoc and
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6761 ;; gnus-killed-assoc even if gnus-newsrc-assoc is out of date.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6762 (condition-case nil
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6763 (progn
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6764 (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
6765 ;; Recreate hashtables.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6766 (setq gnus-killed-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6767 (gnus-make-hashtable-from-alist gnus-killed-assoc))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6768 (setq gnus-marked-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6769 (gnus-make-hashtable-from-alist gnus-marked-assoc))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6770 )
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6771 (error nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6772 (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
6773 ;; .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
6774 ;; 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
6775 ;; (on fast machines/disks).
9eaa2151f7f6 (gnus-summary-isearch-article): Call isearch-forward
Richard M. Stallman <rms@gnu.org>
parents: 3331
diff changeset
6776 (not (file-newer-than-file-p newsrc-file quick-file))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6777 quick-loaded
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6778 gnus-newsrc-assoc ;Really loaded?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6779 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6780 ;; 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
6781 ;; 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
6782 ;; So, we have to define the hashtable here.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6783 (setq gnus-newsrc-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6784 (gnus-make-hashtable-from-alist gnus-newsrc-assoc)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6785 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6786 ;; Since .newsrc file is newer than quick file, read it.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6787 (message "Reading %s..." newsrc-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6788 (gnus-newsrc-to-gnus-format)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6789 (gnus-check-killed-newsgroups)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6790 (message "Reading %s...done" newsrc-file)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6791 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6792
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6793 (defun gnus-make-newsrc-file (file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6794 "Make server dependent file name by catenating FILE and server host name."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6795 (let* ((file (expand-file-name file nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6796 (real-file (concat file "-" gnus-nntp-server)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6797 (if (file-exists-p real-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6798 real-file file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6799 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6800
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6801 (defun gnus-newsrc-to-gnus-format ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6802 "Parse current buffer as `.newsrc' file."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6803 (let ((newsgroup nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6804 (subscribe nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6805 (ranges nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6806 (subrange nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6807 (read-list nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6808 ;; We have to re-initialize these variable (except for
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6809 ;; gnus-marked-assoc and gnus-killed-assoc) because quick startup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6810 ;; file may contain bogus values.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6811 (setq gnus-newsrc-options nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6812 (setq gnus-newsrc-options-n-yes nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6813 (setq gnus-newsrc-options-n-no nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6814 (setq gnus-newsrc-assoc nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6815 ;; Make large enough hash table.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6816 (setq gnus-newsrc-hashtb
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6817 (gnus-make-hashtable
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6818 (max (length gnus-active-hashtb)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6819 (count-lines (point-min) (point-max)))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6820 ;; Save options line to variable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6821 ;; Lines beginning with white spaces are treated as continuation
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6822 ;; line. Refer man page of newsrc(5).
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6823 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6824 (if (re-search-forward
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6825 "^[ \t]*options[ \t]*\\(.*\\(\n[ \t]+.*\\)*\\)[ \t]*$" nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6826 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6827 ;; Save entire options line.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6828 (setq gnus-newsrc-options
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6829 (buffer-substring (match-beginning 1) (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6830 ;; Compile "-n" option.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6831 (if (string-match "\\(^\\|[ \t\n]\\)-n" gnus-newsrc-options)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6832 (let ((yes-and-no
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6833 (gnus-parse-n-options
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6834 (substring gnus-newsrc-options (match-end 0)))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6835 (setq gnus-newsrc-options-n-yes (car yes-and-no))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6836 (setq gnus-newsrc-options-n-no (cdr yes-and-no))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6837 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6838 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6839 ;; Parse body of .newsrc file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6840 ;; Options line continuation lines must be also considered here.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6841 ;; Before supporting continuation lines, " newsgroup ! 1-5" was
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6842 ;; okay, but now it is invalid. It should be "newsgroup! 1-5".
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6843 (goto-char (point-min))
7793
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6844 ;; We used this regexp, but it caused overflows.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6845 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(.*\\)$"
3610
b0c94b723e6a * gnus.el (gnus-newsrc-to-gnus-format): Change regexp which
Jim Blandy <jimb@redhat.com>
parents: 3591
diff changeset
6846 ;; 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
6847 ;; 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
6848 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(\\(...\\)*.*\\)$"
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
6849 ;; but, the following causes trouble on some case:
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
6850 ;; "^\\([^:! \t\n]+\\)\\([:!]\\)[ \t]*\\(\\|[^ \t\n].*\\)$"
7793
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6851 ;; So now we don't try to match the tail of the line at all.
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6852 ;; It's just as easy to extract it later.
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6853 (while (re-search-forward "^\\([^:! \t\n]+\\)\\([:!]\\)"
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6854 nil t)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6855 (setq newsgroup (buffer-substring (match-beginning 1) (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6856 ;; Check duplications of newsgroups.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6857 ;; 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
6858 (if (gnus-gethash newsgroup gnus-newsrc-hashtb)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6859 (message "Ignore duplicated newsgroup: %s" newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6860 (setq subscribe
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6861 (string-equal
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6862 ":" (buffer-substring (match-beginning 2) (match-end 2))))
7793
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6863 (skip-chars-forward " \t")
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6864 (setq ranges (buffer-substring (point) (save-excursion
4a683dc76931 (gnus-newsrc-to-gnus-format): In main loop,
Richard M. Stallman <rms@gnu.org>
parents: 7705
diff changeset
6865 (end-of-line) (point))))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6866 (setq read-list nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6867 (while (string-match "^[, \t]*\\([0-9-]+\\)" ranges)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6868 (setq subrange (substring ranges (match-beginning 1) (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6869 (setq ranges (substring ranges (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6870 (cond ((string-match "^\\([0-9]+\\)-\\([0-9]+\\)$" subrange)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6871 (setq read-list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6872 (cons
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6873 (cons (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6874 (substring subrange
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6875 (match-beginning 1) (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6876 (string-to-int
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6877 (substring subrange
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6878 (match-beginning 2) (match-end 2))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6879 read-list)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6880 ((string-match "^[0-9]+$" subrange)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6881 (setq read-list
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6882 (cons (cons (string-to-int subrange)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6883 (string-to-int subrange))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6884 read-list)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6885 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6886 (ding) (message "Ignoring bogus lines of %s" newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6887 (sit-for 0))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6888 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6889 (setq gnus-newsrc-assoc
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6890 (cons (cons newsgroup (cons subscribe (nreverse read-list)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6891 gnus-newsrc-assoc))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6892 ;; Update gnus-newsrc-hashtb one by one.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6893 (gnus-sethash newsgroup (car gnus-newsrc-assoc) gnus-newsrc-hashtb)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6894 ))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6895 (setq gnus-newsrc-assoc (nreverse gnus-newsrc-assoc))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6896 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6897
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6898 (defun gnus-parse-n-options (options)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6899 "Parse -n NEWSGROUPS options and return a cons of YES and NO regexps."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6900 (let ((yes nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6901 (no nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6902 (yes-or-no nil) ;`!' or not.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6903 (newsgroup nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6904 ;; Parse each newsgroup description such as "comp.all". Commas
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6905 ;; and white spaces can be a newsgroup separator.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6906 (while
6309
9217f29851c2 Don't use triple-hyphen in a character class.
Karl Heuer <kwzh@gnu.org>
parents: 5911
diff changeset
6907 (string-match "^[ \t\n,]*\\(!?\\)\\([^- \t\n,][^ \t\n,]*\\)" options)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6908 (setq yes-or-no
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6909 (substring options (match-beginning 1) (match-end 1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6910 (setq newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6911 (regexp-quote
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6912 (substring options
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6913 (match-beginning 2) (match-end 2))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6914 (setq options (substring options (match-end 2)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6915 ;; Rewrite "all" to ".+" not ".*". ".+" requires at least one
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6916 ;; character.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6917 (while (string-match "\\(^\\|\\\\[.]\\)all\\(\\\\[.]\\|$\\)" newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6918 (setq newsgroup
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6919 (concat (substring newsgroup 0 (match-end 1))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6920 ".+"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6921 (substring newsgroup (match-beginning 2)))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6922 ;; It is yes or no.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6923 (cond ((string-equal yes-or-no "!")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6924 (setq no (cons newsgroup no)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6925 ((string-equal newsgroup ".+")) ;Ignore `all'.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6926 (t
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6927 (setq yes (cons newsgroup yes))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6928 )
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6929 ;; 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
6930 ;; 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
6931 ;; 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
6932 ;; "jp.network".
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6933 ;; Fixes for large regexp problems are from yonezu@nak.math.keio.ac.jp.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6934 (cons (if yes
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6935 (concat "^\\("
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6936 (apply (function concat)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6937 (mapcar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6938 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6939 (lambda (newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6940 (concat newsgroup "\\|")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6941 (cdr yes)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6942 (car yes) "\\)\\(\\.\\|$\\)"))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6943 (if no
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6944 (concat "^\\("
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6945 (apply (function concat)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6946 (mapcar
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6947 (function
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6948 (lambda (newsgroup)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6949 (concat newsgroup "\\|")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6950 (cdr no)))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6951 (car no) "\\)\\(\\.\\|$\\)")))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6952 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6953
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6954 (defun gnus-save-newsrc-file ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6955 "Save current status in the `.newsrc' file."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6956 ;; Note: We cannot save .newsrc file if all newsgroups are removed
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6957 ;; from the variable gnus-newsrc-assoc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6958 (and (or gnus-newsrc-assoc gnus-killed-assoc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6959 gnus-current-startup-file
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6960 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6961 ;; A buffer containing .newsrc file may be deleted.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6962 (set-buffer (find-file-noselect gnus-current-startup-file))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6963 (if (not (buffer-modified-p))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6964 (message "(No changes need to be saved)")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6965 (message "Saving %s..." gnus-current-startup-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6966 (let ((make-backup-files t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6967 (version-control nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6968 (require-final-newline t)) ;Don't ask even if requested.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6969 ;; Make backup file of master newsrc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6970 ;; You can stop or change version control of backup file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6971 ;; Suggested by jason@violet.berkeley.edu.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6972 (run-hooks 'gnus-save-newsrc-hook)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6973 (save-buffer))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6974 ;; Quickly loadable .newsrc.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6975 (set-buffer (get-buffer-create " *GNUS-newsrc*"))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6976 (buffer-flush-undo (current-buffer))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6977 (erase-buffer)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6978 (gnus-gnus-to-quick-newsrc-format)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6979 (let ((make-backup-files nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6980 (version-control nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6981 (require-final-newline t)) ;Don't ask even if requested.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6982 (write-file (concat gnus-current-startup-file ".el")))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6983 (kill-buffer (current-buffer))
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6984 (message "Saving %s...done" gnus-current-startup-file)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6985 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6986 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6987
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6988 (defun gnus-update-newsrc-buffer (group &optional delete next)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
6989 "Incrementally update `.newsrc' buffer about GROUP.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
6990 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
6991 If optional 2nd argument NEXT is non-nil, inserted before it."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6992 (save-excursion
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6993 ;; Taking account of the killed startup file.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6994 ;; Suggested by tale@pawl.rpi.edu.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6995 (set-buffer (or (get-file-buffer gnus-current-startup-file)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6996 (find-file-noselect gnus-current-startup-file)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6997 ;; Options line continuation lines must be also considered here.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6998 ;; Before supporting continuation lines, " newsgroup ! 1-5" was
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6999 ;; okay, but now it is invalid. It should be "newsgroup! 1-5".
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7000 (let ((deleted nil)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7001 (case-fold-search nil) ;Should NOT ignore case.
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7002 (buffer-read-only nil)) ;May be not modifiable.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7003 ;; Delete ALL entries which match for GROUP.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7004 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7005 (while (re-search-forward
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7006 (concat "^" (regexp-quote group) "[:!]") nil t)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7007 (beginning-of-line)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7008 (delete-region (point) (progn (forward-line 1) (point)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7009 (setq deleted t) ;Old entry is deleted.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7010 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7011 (if delete
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7012 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7013 ;; Insert group entry.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7014 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7015 (if (null newsrc)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7016 nil
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7017 ;; Find insertion point.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7018 (cond (deleted nil) ;Insert here.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7019 ((and (stringp next)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7020 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7021 (goto-char (point-min))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7022 (re-search-forward
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7023 (concat "^" (regexp-quote next) "[:!]") nil t)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7024 (beginning-of-line))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7025 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7026 (goto-char (point-max))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7027 (or (bolp)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7028 (insert "\n"))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7029 ;; Insert after options line.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7030 (if (looking-at "^[ \t]*options\\([ \t]\\|$\\)")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7031 (progn
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7032 (forward-line 1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7033 ;; Skip continuation lines.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7034 (while (and (not (eobp))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7035 (looking-at "^[ \t]+"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7036 (forward-line 1))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7037 (insert group ;Group name
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7038 (if (nth 1 newsrc) ": " "! ")) ;Subscribed?
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7039 (gnus-ranges-to-newsrc-format (nthcdr 2 newsrc)) ;Read articles
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7040 (insert "\n")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7041 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7042 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7043
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7044 (defun gnus-gnus-to-quick-newsrc-format ()
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
7045 "Insert GNUS variables such as `gnus-newsrc-assoc' in Lisp format."
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7046 (insert ";; GNUS internal format of .newsrc.\n")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7047 (insert ";; Touch .newsrc instead if you think to remove this file.\n")
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7048 (let ((variable nil)
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7049 (variables (cons 'gnus-newsgroups-alist gnus-variable-list))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7050 ;; Temporary rebind to make changes
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7051 ;; gnus-check-killed-newsgroups in invisible.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7052 (gnus-killed-assoc gnus-killed-assoc)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7053 (gnus-killed-hashtb gnus-killed-hashtb))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7054 ;; Remove duplicated or unsubscribed newsgroups in
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7055 ;; gnus-killed-assoc (and gnus-killed-hashtb).
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7056 (gnus-check-killed-newsgroups)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7057 ;; Then, insert lisp expressions.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7058 (while variables
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7059 (setq variable (car variables))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7060 (and (boundp variable)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7061 (symbol-value variable)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7062 (insert "(setq " (symbol-name variable) " '"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7063 (prin1-to-string (symbol-value variable))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7064 ")\n"))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7065 (setq variables (cdr variables)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7066 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7067
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7068 (defun gnus-ranges-to-newsrc-format (ranges)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7069 "Insert ranges of read articles."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7070 (let ((range nil)) ;Range is a pair of BEGIN and END.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7071 (while ranges
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7072 (setq range (car ranges))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7073 (setq ranges (cdr ranges))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7074 (cond ((= (car range) (cdr range))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7075 (if (= (car range) 0)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7076 (setq ranges nil) ;No unread articles.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7077 (insert (int-to-string (car range)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7078 (if ranges (insert ","))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7079 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7080 (t
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7081 (insert (int-to-string (car range))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7082 "-"
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7083 (int-to-string (cdr range)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7084 (if ranges (insert ","))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7085 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7086 )))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7087
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7088 (defun gnus-compress-sequence (numbers)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7089 "Convert list of sorted numbers to ranges."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7090 (let* ((numbers (sort (copy-sequence numbers) (function <)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7091 (first (car numbers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7092 (last (car numbers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7093 (result nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7094 (while numbers
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7095 (cond ((= last (car numbers)) nil) ;Omit duplicated number
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7096 ((= (1+ last) (car numbers)) ;Still in sequence
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7097 (setq last (car numbers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7098 (t ;End of one sequence
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7099 (setq result (cons (cons first last) result))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7100 (setq first (car numbers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7101 (setq last (car numbers)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7102 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7103 (setq numbers (cdr numbers))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7104 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7105 (nreverse (cons (cons first last) result))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7106 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7107
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7108 (defun gnus-uncompress-sequence (ranges)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7109 "Expand compressed format of sequence."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7110 (let ((first nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7111 (last nil)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7112 (result nil))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7113 (while ranges
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7114 (setq first (car (car ranges)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7115 (setq last (cdr (car ranges)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7116 (while (< first last)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7117 (setq result (cons first result))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7118 (setq first (1+ first)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7119 (setq result (cons first result))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7120 (setq ranges (cdr ranges))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7121 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7122 (nreverse result)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7123 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7124
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7125 (defun gnus-number-of-articles (range)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7126 "Compute number of articles from RANGE `((beg1 . end1) (beg2 . end2) ...)'."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7127 (let ((count 0))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7128 (while range
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7129 (if (/= (cdr (car range)) 0)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
7130 ;; If end1 is 0, it must be skipped. Usually no articles in
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7131 ;; this group.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7132 (setq count (+ count 1 (- (cdr (car range)) (car (car range))))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7133 (setq range (cdr range))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7134 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7135 count ;Result
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7136 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7137
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7138 (defun gnus-difference-of-range (src obj)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7139 "Compute (SRC - OBJ) on range.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7140 Range of SRC is expressed as `(beg . end)'.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7141 Range of OBJ is expressed as `((beg1 . end1) (beg2 . end2) ...)."
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7142 (let ((beg (car src))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7143 (end (cdr src))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7144 (range nil)) ;This is result.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7145 ;; Src may be nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7146 (while (and src obj)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7147 (let ((beg1 (car (car obj)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7148 (end1 (cdr (car obj))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7149 (cond ((> beg end)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7150 (setq obj nil)) ;Terminate loop
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7151 ((< beg beg1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7152 (setq range (cons (cons beg (min (1- beg1) end)) range))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7153 (setq beg (1+ end1)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7154 ((>= beg beg1)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7155 (setq beg (max beg (1+ end1))))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7156 )
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7157 (setq obj (cdr obj)) ;Next OBJ
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7158 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7159 ;; Src may be nil.
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7160 (if (and src (<= beg end))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7161 (setq range (cons (cons beg end) range)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7162 ;; Result
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7163 (if range
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7164 (nreverse range)
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7165 (list (cons 0 0)))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7166 ))
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7167
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7168 (defun gnus-read-distributions-file ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7169 "Get distributions file from NNTP server (NNTP2 functionality)."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7170 ;; 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
7171 (gnus-start-news-server)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7172 (message "Reading distributions file...")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7173 (setq gnus-distribution-list nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7174 (if (gnus-request-list-distributions)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7175 (save-excursion
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7176 (set-buffer nntp-server-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7177 (gnus-distributions-to-gnus-format)
10073
71b3508d5418 Many doc fixes. Fix progress message formats.
Richard M. Stallman <rms@gnu.org>
parents: 9824
diff changeset
7178 (message "Reading distributions file...done"))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7179 ;; It's not a fatal error.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7180 ;;(error "Cannot read distributions file from NNTP server.")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7181 )
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7182 ;; Merge with user supplied default distributions.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7183 (let ((defaults (reverse gnus-local-distributions))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7184 (dist nil))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7185 (while defaults
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7186 (setq dist (assoc (car defaults) gnus-distribution-list))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7187 (if dist
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7188 (setq gnus-distribution-list
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7189 (delq dist gnus-distribution-list)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7190 (setq gnus-distribution-list
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7191 (cons (list (car defaults)) gnus-distribution-list))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7192 (setq defaults (cdr defaults))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7193 )))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7194
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7195 (defun gnus-distributions-to-gnus-format ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7196 "Convert distributions file format to internal format."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7197 (setq gnus-distribution-list nil)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7198 (goto-char (point-min))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7199 (while (re-search-forward "^\\([^ \t\n]+\\).*$" nil t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7200 (setq gnus-distribution-list
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7201 (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
7202 gnus-distribution-list)))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7203 (setq gnus-distribution-list
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7204 (nreverse gnus-distribution-list)))
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7205
10542
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7206 (defun gnus-newsgroups-retrieve-description ()
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7207 "Retrieve newsgroups description and build gnus-newsgroups-alist"
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7208 (message "Reading newsgroups file...")
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7209 (if (gnus-request-list-newsgroups)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7210 (save-excursion
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7211 (setq gnus-newsgroups-alist nil)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7212 (set-buffer nntp-server-buffer)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7213 (goto-char (point-min))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7214 (while (re-search-forward gnus-newsgroups-regex nil t)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7215 (setq gnus-newsgroups-alist
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7216 (cons (cons (buffer-substring (match-beginning 1) (match-end 1))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7217 (buffer-substring (match-beginning 2) (match-end 2)))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7218 gnus-newsgroups-alist)))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7219 (message "Reading newsgroups file...done"))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7220 (message "Cannot read newsgroups file")))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7221
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7222 (defun gnus-newsgroups-update-description ()
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7223 "Update the newsgroups description"
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7224 (interactive)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7225 (gnus-newsgroups-retrieve-description)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7226 (setq gnus-newsgroups-hashtb (gnus-make-hashtable-from-alist gnus-newsgroups-alist)))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7227
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7228 (defun gnus-newsgroups-display-toggle ()
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7229 "Toggle displaying newsgroup descriptions in *Newsgroup* buffer."
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7230 (interactive)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7231 (setq gnus-newsgroups-display (not gnus-newsgroups-display))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7232 (if gnus-newsgroups-showall
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7233 (gnus-group-list-groups t)
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7234 (gnus-group-list-groups nil)))
0701b42497fc Added support for descriptions in the group buffer:
Richard M. Stallman <rms@gnu.org>
parents: 10177
diff changeset
7235
8470
999e5521d05a Require timezone when loading this file.
Richard M. Stallman <rms@gnu.org>
parents: 8444
diff changeset
7236 (provide 'gnus)
999e5521d05a Require timezone when loading this file.
Richard M. Stallman <rms@gnu.org>
parents: 8444
diff changeset
7237
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7238 ;;Local variables:
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 1821
diff changeset
7239 ;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
257
e5ba2ba35226 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7240 ;;end:
4173
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
7241
2b3fb8d12918 (gnus-emacs-version): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 4118
diff changeset
7242 ;;; gnus.el ends here