annotate lisp/gnus.el @ 15915:cba4fbcb4aa0

(gnus-group-enter-directory): Virtual server definition list wasn't quoted.
author Lars Magne Ingebrigtsen <larsi@gnus.org>
date Sat, 24 Aug 1996 23:22:22 +0000
parents 68b9d495fe4f
children 66d74ded252a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1 ;;; gnus.el --- a newsreader for GNU Emacs
14485
ea5f35baa429 (gnus-request-accept-article): Make sure there's a newline at the
Richard M. Stallman <rms@gnu.org>
parents: 14484
diff changeset
2 ;; Copyright (C) 1987,88,89,90,93,94,95,96 Free Software Foundation, Inc.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5 ;; Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6 ;; Keywords: news
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13 ;; any later version.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
19
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13949
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13949
diff changeset
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 13949
diff changeset
23 ;; Boston, MA 02111-1307, USA.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
24
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
25 ;;; Commentary:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
26
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
27 ;;; Code:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
28
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
29 (eval '(run-hooks 'gnus-load-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
30
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
31 (require 'mail-utils)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
32 (require 'timezone)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
33 (require 'nnheader)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
34 (require 'nnmail)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
35 (require 'backquote)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
36 (require 'nnoo)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
37
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
38 (eval-when-compile (require 'cl))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
39
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
40 (defvar gnus-directory (or (getenv "SAVEDIR") "~/News/")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
41 "*Directory variable from which all other Gnus file variables are derived.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
42
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
43 ;; Site dependent variables. These variables should be defined in
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
44 ;; paths.el.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
45
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
46 (defvar gnus-default-nntp-server nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
47 "Specify a default NNTP server.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
48 This variable should be defined in paths.el, and should never be set
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
49 by the user.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
50 If you want to change servers, you should use `gnus-select-method'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
51 See the documentation to that variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
52
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
53 (defvar gnus-backup-default-subscribed-newsgroups
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
54 '("news.announce.newusers" "news.groups.questions" "gnu.emacs.gnus")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
55 "Default default new newsgroups the first time Gnus is run.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
56 Should be set in paths.el, and shouldn't be touched by the user.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
57
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
58 (defvar gnus-local-domain nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
59 "Local domain name without a host name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
60 The DOMAINNAME environment variable is used instead if it is defined.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
61 If the `system-name' function returns the full Internet name, there is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
62 no need to set this variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
63
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
64 (defvar gnus-local-organization nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
65 "String with a description of what organization (if any) the user belongs to.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
66 The ORGANIZATION environment variable is used instead if it is defined.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
67 If this variable contains a function, this function will be called
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
68 with the current newsgroup name as the argument. The function should
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
69 return a string.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
70
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
71 In any case, if the string (either in the variable, in the environment
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
72 variable, or returned by the function) is a file name, the contents of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
73 this file will be used as the organization.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
74
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
75 ;; Customization variables
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
76
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
77 ;; Don't touch this variable.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
78 (defvar gnus-nntp-service "nntp"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
79 "*NNTP service name (\"nntp\" or 119).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
80 This is an obsolete variable, which is scarcely used. If you use an
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
81 nntp server for your newsgroup and want to change the port number
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
82 used to 899, you would say something along these lines:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
83
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
84 (setq gnus-select-method '(nntp \"my.nntp.server\" (nntp-port-number 899)))")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
85
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
86 (defvar gnus-nntpserver-file "/etc/nntpserver"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
87 "*A file with only the name of the nntp server in it.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
88
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
89 ;; This function is used to check both the environment variable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
90 ;; NNTPSERVER and the /etc/nntpserver file to see whether one can find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
91 ;; an nntp server name default.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
92 (defun gnus-getenv-nntpserver ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
93 (or (getenv "NNTPSERVER")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
94 (and (file-readable-p gnus-nntpserver-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
95 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
96 (set-buffer (get-buffer-create " *gnus nntp*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
97 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
98 (insert-file-contents gnus-nntpserver-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
99 (let ((name (buffer-string)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
100 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
101 (if (string-match "^[ \t\n]*$" name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
102 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
103 name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
104 (kill-buffer (current-buffer))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
105
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
106 (defvar gnus-select-method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
107 (nconc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
108 (list 'nntp (or (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
109 (gnus-getenv-nntpserver)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
110 (error nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
111 (if (and gnus-default-nntp-server
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
112 (not (string= gnus-default-nntp-server "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
113 gnus-default-nntp-server)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
114 (system-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
115 (if (or (null gnus-nntp-service)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
116 (equal gnus-nntp-service "nntp"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
117 nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
118 (list gnus-nntp-service)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
119 "*Default method for selecting a newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
120 This variable should be a list, where the first element is how the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
121 news is to be fetched, the second is the address.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
122
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
123 For instance, if you want to get your news via NNTP from
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
124 \"flab.flab.edu\", you could say:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
125
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
126 (setq gnus-select-method '(nntp \"flab.flab.edu\"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
127
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
128 If you want to use your local spool, say:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
129
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
130 (setq gnus-select-method (list 'nnspool (system-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
131
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
132 If you use this variable, you must set `gnus-nntp-server' to nil.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
133
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
134 There is a lot more to know about select methods and virtual servers -
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
135 see the manual for details.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
136
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
137 (defvar gnus-message-archive-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
138 `(nnfolder
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
139 "archive"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
140 (nnfolder-directory ,(nnheader-concat message-directory "archive"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
141 (nnfolder-active-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
142 ,(nnheader-concat message-directory "archive/active"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
143 (nnfolder-get-new-mail nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
144 (nnfolder-inhibit-expiry t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
145 "*Method used for archiving messages you've sent.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
146 This should be a mail method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
147
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
148 It's probably not a very effective to change this variable once you've
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
149 run Gnus once. After doing that, you must edit this server from the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
150 server buffer.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
151
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
152 (defvar gnus-message-archive-group nil
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
153 "*Name of the group in which to save the messages you've written.
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
154 This can either be a string, a list of strings; or an alist
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
155 of regexps/functions/forms to be evaluated to return a string (or a list
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
156 of strings). The functions are called with the name of the current
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
157 group (or nil) as a parameter.
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
158
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
159 Normally the group names returned by this variable should be
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
160 unprefixed -- which implictly means \"store on the archive server\".
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
161 However, you may wish to store the message on some other server. In
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
162 that case, just return a fully prefixed name of the group --
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
163 \"nnml+private:mail.misc\", for instance.")
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
164
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
165 (defvar gnus-refer-article-method nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
166 "*Preferred method for fetching an article by Message-ID.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
167 If you are reading news from the local spool (with nnspool), fetching
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
168 articles by Message-ID is painfully slow. By setting this method to an
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
169 nntp method, you might get acceptable results.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
170
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
171 The value of this variable must be a valid select method as discussed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
172 in the documentation of `gnus-select-method'.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
173
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
174 (defvar gnus-secondary-select-methods nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
175 "*A list of secondary methods that will be used for reading news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
176 This is a list where each element is a complete select method (see
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
177 `gnus-select-method').
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
178
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
179 If, for instance, you want to read your mail with the nnml backend,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
180 you could set this variable:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
181
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
182 (setq gnus-secondary-select-methods '((nnml \"\")))")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
183
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
184 (defvar gnus-secondary-servers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
185 "*List of NNTP servers that the user can choose between interactively.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
186 To make Gnus query you for a server, you have to give `gnus' a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
187 non-numeric prefix - `C-u M-x gnus', in short.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
188
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
189 (defvar gnus-nntp-server nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
190 "*The name of the host running the NNTP server.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
191 This variable is semi-obsolete. Use the `gnus-select-method'
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
192 variable instead.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
193
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
194 (defvar gnus-startup-file "~/.newsrc"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
195 "*Your `.newsrc' file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
196 `.newsrc-SERVER' will be used instead if that exists.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
197
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
198 (defvar gnus-init-file "~/.gnus"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
199 "*Your Gnus elisp startup file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
200 If a file with the .el or .elc suffixes exist, it will be read
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
201 instead.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
202
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
203 (defvar gnus-group-faq-directory
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
204 '("/ftp@mirrors.aol.com:/pub/rtfm/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
205 "/ftp@sunsite.auc.dk:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
206 "/ftp@sunsite.doc.ic.ac.uk:/pub/usenet/news-faqs/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
207 "/ftp@src.doc.ic.ac.uk:/usenet/news-FAQS/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
208 "/ftp@ftp.seas.gwu.edu:/pub/rtfm/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
209 "/ftp@rtfm.mit.edu:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
210 "/ftp@ftp.uni-paderborn.de:/pub/FAQ/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
211 "/ftp@ftp.sunet.se:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
212 "/ftp@nctuccca.edu.tw:/USENET/FAQ/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
213 "/ftp@hwarang.postech.ac.kr:/pub/usenet/"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
214 "/ftp@ftp.hk.super.net:/mirror/faqs/")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
215 "*Directory where the group FAQs are stored.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
216 This will most commonly be on a remote machine, and the file will be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
217 fetched by ange-ftp.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
218
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
219 This variable can also be a list of directories. In that case, the
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
220 first element in the list will be used by default. The others can
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
221 be used when being prompted for a site.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
222
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
223 Note that Gnus uses an aol machine as the default directory. If this
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
224 feels fundamentally unclean, just think of it as a way to finally get
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
225 something of value back from them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
226
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
227 If the default site is too slow, try one of these:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
228
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
229 North America: mirrors.aol.com /pub/rtfm/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
230 ftp.seas.gwu.edu /pub/rtfm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
231 rtfm.mit.edu /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
232 Europe: ftp.uni-paderborn.de /pub/FAQ
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
233 src.doc.ic.ac.uk /usenet/news-FAQS
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
234 ftp.sunet.se /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
235 sunsite.auc.dk /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
236 Asia: nctuccca.edu.tw /USENET/FAQ
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
237 hwarang.postech.ac.kr /pub/usenet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
238 ftp.hk.super.net /mirror/faqs")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
239
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
240 (defvar gnus-group-archive-directory
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
241 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
242 "*The address of the (ding) archives.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
243
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
244 (defvar gnus-group-recent-archive-directory
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
245 "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list-recent/"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
246 "*The address of the most recent (ding) articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
247
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
248 (defvar gnus-default-subscribed-newsgroups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
249 "*This variable lists what newsgroups should be subscribed the first time Gnus is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
250 It should be a list of strings.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
251 If it is `t', Gnus will not do anything special the first time it is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
252 started; it'll just use the normal newsgroups subscription methods.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
253
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
254 (defvar gnus-use-cross-reference t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
255 "*Non-nil means that cross referenced articles will be marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
256 If nil, ignore cross references. If t, mark articles as read in
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
257 subscribed newsgroups. If neither t nor nil, mark as read in all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
258 newsgroups.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
259
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
260 (defvar gnus-single-article-buffer t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
261 "*If non-nil, display all articles in the same buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
262 If nil, each group will get its own article buffer.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
263
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
264 (defvar gnus-use-dribble-file t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
265 "*Non-nil means that Gnus will use a dribble file to store user updates.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
266 If Emacs should crash without saving the .newsrc files, complete
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
267 information can be restored from the dribble file.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
268
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
269 (defvar gnus-dribble-directory nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
270 "*The directory where dribble files will be saved.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
271 If this variable is nil, the directory where the .newsrc files are
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
272 saved will be used.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
273
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
274 (defvar gnus-asynchronous nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
275 "*If non-nil, Gnus will supply backends with data needed for async article fetching.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
276
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
277 (defvar gnus-kill-summary-on-exit t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
278 "*If non-nil, kill the summary buffer when you exit from it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
279 If nil, the summary will become a \"*Dead Summary*\" buffer, and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
280 it will be killed sometime later.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
281
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
282 (defvar gnus-large-newsgroup 200
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
283 "*The number of articles which indicates a large newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
284 If the number of articles in a newsgroup is greater than this value,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
285 confirmation is required for selecting the newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
286
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
287 ;; Suggested by Andrew Eskilsson <pi92ae@lelle.pt.hk-r.se>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
288 (defvar gnus-no-groups-message "No news is horrible news"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
289 "*Message displayed by Gnus when no groups are available.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
290
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
291 (defvar gnus-use-long-file-name (not (memq system-type '(usg-unix-v xenix)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
292 "*Non-nil means that the default name of a file to save articles in is the group name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
293 If it's nil, the directory form of the group name is used instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
294
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
295 If this variable is a list, and the list contains the element
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
296 `not-score', long file names will not be used for score files; if it
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
297 contains the element `not-save', long file names will not be used for
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
298 saving; and if it contains the element `not-kill', long file names
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
299 will not be used for kill files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
300
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
301 Note that the default for this variable varies according to what system
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
302 type you're using. On `usg-unix-v' and `xenix' this variable defaults
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
303 to nil while on all other systems it defaults to t.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
304
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
305 (defvar gnus-article-save-directory gnus-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
306 "*Name of the directory articles will be saved in (default \"~/News\").")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
307
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
308 (defvar gnus-kill-files-directory gnus-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
309 "*Name of the directory where kill files will be stored (default \"~/News\").")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
310
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
311 (defvar gnus-default-article-saver 'gnus-summary-save-in-rmail
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
312 "*A function to save articles in your favorite format.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
313 The function must be interactively callable (in other words, it must
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
314 be an Emacs command).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
315
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
316 Gnus provides the following functions:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
317
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
318 * gnus-summary-save-in-rmail (Rmail format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
319 * gnus-summary-save-in-mail (Unix mail format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
320 * gnus-summary-save-in-folder (MH folder)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
321 * gnus-summary-save-in-file (article format).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
322 * gnus-summary-save-in-vm (use VM's folder format).")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
323
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
324 (defvar gnus-prompt-before-saving 'always
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
325 "*This variable says how much prompting is to be done when saving articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
326 If it is nil, no prompting will be done, and the articles will be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
327 saved to the default files. If this variable is `always', each and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
328 every article that is saved will be preceded by a prompt, even when
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
329 saving large batches of articles. If this variable is neither nil not
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
330 `always', there the user will be prompted once for a file name for
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
331 each invocation of the saving commands.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
332
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
333 (defvar gnus-rmail-save-name (function gnus-plain-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
334 "*A function generating a file name to save articles in Rmail format.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
335 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
336
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
337 (defvar gnus-mail-save-name (function gnus-plain-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
338 "*A function generating a file name to save articles in Unix mail format.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
339 The function is called with NEWSGROUP, HEADERS, and optional LAST-FILE.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
340
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
341 (defvar gnus-folder-save-name (function gnus-folder-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
342 "*A function generating a file name to save articles in MH folder.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
343 The function is called with NEWSGROUP, HEADERS, and optional LAST-FOLDER.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
344
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
345 (defvar gnus-file-save-name (function gnus-numeric-save-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
346 "*A function generating a file name to save articles in article format.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
347 The function is called with NEWSGROUP, HEADERS, and optional
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
348 LAST-FILE.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
349
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
350 (defvar gnus-split-methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
351 '((gnus-article-archive-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
352 "*Variable used to suggest where articles are to be saved.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
353 For instance, if you would like to save articles related to Gnus in
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
354 the file \"gnus-stuff\", and articles related to VM in \"vm-stuff\",
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
355 you could set this variable to something like:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
356
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
357 '((\"^Subject:.*gnus\\|^Newsgroups:.*gnus\" \"gnus-stuff\")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
358 (\"^Subject:.*vm\\|^Xref:.*vm\" \"vm-stuff\"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
359
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
360 This variable is an alist where the where the key is the match and the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
361 value is a list of possible files to save in if the match is non-nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
362
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
363 If the match is a string, it is used as a regexp match on the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
364 article. If the match is a symbol, that symbol will be funcalled
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
365 from the buffer of the article to be saved with the newsgroup as the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
366 parameter. If it is a list, it will be evaled in the same buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
367
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
368 If this form or function returns a string, this string will be used as
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
369 a possible file name; and if it returns a non-nil list, that list will
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
370 be used as possible file names.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
371
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
372 (defvar gnus-move-split-methods nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
373 "*Variable used to suggest where articles are to be moved to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
374 It uses the same syntax as the `gnus-split-methods' variable.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
375
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
376 (defvar gnus-save-score nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
377 "*If non-nil, save group scoring info.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
378
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
379 (defvar gnus-use-adaptive-scoring nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
380 "*If non-nil, use some adaptive scoring scheme.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
381
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
382 (defvar gnus-use-cache 'passive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
383 "*If nil, Gnus will ignore the article cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
384 If `passive', it will allow entering (and reading) articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
385 explicitly entered into the cache. If anything else, use the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
386 cache to the full extent of the law.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
387
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
388 (defvar gnus-use-trees nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
389 "*If non-nil, display a thread tree buffer.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
390
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
391 (defvar gnus-use-grouplens nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
392 "*If non-nil, use GroupLens ratings.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
393
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
394 (defvar gnus-keep-backlog nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
395 "*If non-nil, Gnus will keep read articles for later re-retrieval.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
396 If it is a number N, then Gnus will only keep the last N articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
397 read. If it is neither nil nor a number, Gnus will keep all read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
398 articles. This is not a good idea.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
399
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
400 (defvar gnus-use-nocem nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
401 "*If non-nil, Gnus will read NoCeM cancel messages.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
402
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
403 (defvar gnus-use-demon nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
404 "If non-nil, Gnus might use some demons.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
405
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
406 (defvar gnus-use-scoring t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
407 "*If non-nil, enable scoring.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
408
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
409 (defvar gnus-use-picons nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
410 "*If non-nil, display picons.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
411
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
412 (defvar gnus-fetch-old-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
413 "*Non-nil means that Gnus will try to build threads by grabbing old headers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
414 If an unread article in the group refers to an older, already read (or
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
415 just marked as read) article, the old article will not normally be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
416 displayed in the Summary buffer. If this variable is non-nil, Gnus
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
417 will attempt to grab the headers to the old articles, and thereby
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
418 build complete threads. If it has the value `some', only enough
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
419 headers to connect otherwise loose threads will be displayed.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
420 This variable can also be a number. In that case, no more than that
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
421 number of old headers will be fetched.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
422
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
423 The server has to support NOV for any of this to work.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
424
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
425 ;see gnus-cus.el
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
426 ;(defvar gnus-visual t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
427 ; "*If non-nil, will do various highlighting.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
428 ;If nil, no mouse highlights (or any other highlights) will be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
429 ;performed. This might speed up Gnus some when generating large group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
430 ;and summary buffers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
431
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
432 (defvar gnus-novice-user t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
433 "*Non-nil means that you are a usenet novice.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
434 If non-nil, verbose messages may be displayed and confirmations may be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
435 required.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
436
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
437 (defvar gnus-expert-user nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
438 "*Non-nil means that you will never be asked for confirmation about anything.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
439 And that means *anything*.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
440
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
441 (defvar gnus-verbose 7
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
442 "*Integer that says how verbose Gnus should be.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
443 The higher the number, the more messages Gnus will flash to say what
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
444 it's doing. At zero, Gnus will be totally mute; at five, Gnus will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
445 display most important messages; and at ten, Gnus will keep on
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
446 jabbering all the time.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
447
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
448 (defvar gnus-keep-same-level nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
449 "*Non-nil means that the next newsgroup after the current will be on the same level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
450 When you type, for instance, `n' after reading the last article in the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
451 current newsgroup, you will go to the next newsgroup. If this variable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
452 is nil, the next newsgroup will be the next from the group
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
453 buffer.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
454 If this variable is non-nil, Gnus will either put you in the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
455 next newsgroup with the same level, or, if no such newsgroup is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
456 available, the next newsgroup with the lowest possible level higher
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
457 than the current level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
458 If this variable is `best', Gnus will make the next newsgroup the one
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
459 with the best level.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
460
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
461 (defvar gnus-summary-make-false-root 'adopt
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
462 "*nil means that Gnus won't gather loose threads.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
463 If the root of a thread has expired or been read in a previous
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
464 session, the information necessary to build a complete thread has been
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
465 lost. Instead of having many small sub-threads from this original thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
466 scattered all over the summary buffer, Gnus can gather them.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
467
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
468 If non-nil, Gnus will try to gather all loose sub-threads from an
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
469 original thread into one large thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
470
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
471 If this variable is non-nil, it should be one of `none', `adopt',
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
472 `dummy' or `empty'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
473
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
474 If this variable is `none', Gnus will not make a false root, but just
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
475 present the sub-threads after another.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
476 If this variable is `dummy', Gnus will create a dummy root that will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
477 have all the sub-threads as children.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
478 If this variable is `adopt', Gnus will make one of the \"children\"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
479 the parent and mark all the step-children as such.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
480 If this variable is `empty', the \"children\" are printed with empty
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
481 subject fields. (Or rather, they will be printed with a string
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
482 given by the `gnus-summary-same-subject' variable.)")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
483
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
484 (defvar gnus-summary-gather-exclude-subject "^ *$\\|^(none)$"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
485 "*A regexp to match subjects to be excluded from loose thread gathering.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
486 As loose thread gathering is done on subjects only, that means that
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
487 there can be many false gatherings performed. By rooting out certain
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
488 common subjects, gathering might become saner.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
489
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
490 (defvar gnus-summary-gather-subject-limit nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
491 "*Maximum length of subject comparisons when gathering loose threads.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
492 Use nil to compare full subjects. Setting this variable to a low
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
493 number will help gather threads that have been corrupted by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
494 newsreaders chopping off subject lines, but it might also mean that
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
495 unrelated articles that have subject that happen to begin with the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
496 same few characters will be incorrectly gathered.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
497
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
498 If this variable is `fuzzy', Gnus will use a fuzzy algorithm when
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
499 comparing subjects.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
500
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
501 (defvar gnus-simplify-ignored-prefixes nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
502 "*Regexp, matches for which are removed from subject lines when simplifying.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
503
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
504 (defvar gnus-build-sparse-threads nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
505 "*If non-nil, fill in the gaps in threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
506 If `some', only fill in the gaps that are needed to tie loose threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
507 together. If `more', fill in all leaf nodes that Gnus can find. If
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
508 non-nil and non-`some', fill in all gaps that Gnus manages to guess.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
509
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
510 (defvar gnus-summary-thread-gathering-function 'gnus-gather-threads-by-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
511 "Function used for gathering loose threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
512 There are two pre-defined functions: `gnus-gather-threads-by-subject',
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
513 which only takes Subjects into consideration; and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
514 `gnus-gather-threads-by-references', which compared the References
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
515 headers of the articles to find matches.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
516
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
517 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
518 (defvar gnus-summary-same-subject ""
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
519 "*String indicating that the current article has the same subject as the previous.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
520 This variable will only be used if the value of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
521 `gnus-summary-make-false-root' is `empty'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
522
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
523 (defvar gnus-summary-goto-unread t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
524 "*If non-nil, marking commands will go to the next unread article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
525 If `never', \\<gnus-summary-mode-map>\\[gnus-summary-next-page] will go to the next article,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
526 whether it is read or not.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
527
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
528 (defvar gnus-group-goto-unread t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
529 "*If non-nil, movement commands will go to the next unread and subscribed group.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
530
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
531 (defvar gnus-goto-next-group-when-activating t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
532 "*If non-nil, the \\<gnus-group-mode-map>\\[gnus-group-get-new-news-this-group] command will advance point to the next group.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
533
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
534 (defvar gnus-check-new-newsgroups t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
535 "*Non-nil means that Gnus will add new newsgroups at startup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
536 If this variable is `ask-server', Gnus will ask the server for new
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
537 groups since the last time it checked. This means that the killed list
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
538 is no longer necessary, so you could set `gnus-save-killed-list' to
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
539 nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
540
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
541 A variant is to have this variable be a list of select methods. Gnus
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
542 will then use the `ask-server' method on all these select methods to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
543 query for new groups from all those servers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
544
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
545 Eg.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
546 (setq gnus-check-new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
547 '((nntp \"some.server\") (nntp \"other.server\")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
548
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
549 If this variable is nil, then you have to tell Gnus explicitly to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
550 check for new newsgroups with \\<gnus-group-mode-map>\\[gnus-find-new-newsgroups].")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
551
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
552 (defvar gnus-check-bogus-newsgroups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
553 "*Non-nil means that Gnus will check and remove bogus newsgroup at startup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
554 If this variable is nil, then you have to tell Gnus explicitly to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
555 check for bogus newsgroups with \\<gnus-group-mode-map>\\[gnus-group-check-bogus-groups].")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
556
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
557 (defvar gnus-read-active-file t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
558 "*Non-nil means that Gnus will read the entire active file at startup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
559 If this variable is nil, Gnus will only know about the groups in your
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
560 `.newsrc' file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
561
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
562 If this variable is `some', Gnus will try to only read the relevant
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
563 parts of the active file from the server. Not all servers support
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
564 this, and it might be quite slow with other servers, but this should
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
565 generally be faster than both the t and nil value.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
566
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
567 If you set this variable to nil or `some', you probably still want to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
568 be told about new newsgroups that arrive. To do that, set
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
569 `gnus-check-new-newsgroups' to `ask-server'. This may not work
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
570 properly with all servers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
571
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
572 (defvar gnus-level-subscribed 5
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
573 "*Groups with levels less than or equal to this variable are subscribed.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
574
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
575 (defvar gnus-level-unsubscribed 7
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
576 "*Groups with levels less than or equal to this variable are unsubscribed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
577 Groups with levels less than `gnus-level-subscribed', which should be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
578 less than this variable, are subscribed.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
579
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
580 (defvar gnus-level-zombie 8
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
581 "*Groups with this level are zombie groups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
582
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
583 (defvar gnus-level-killed 9
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
584 "*Groups with this level are killed.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
585
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
586 (defvar gnus-level-default-subscribed 3
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
587 "*New subscribed groups will be subscribed at this level.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
588
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
589 (defvar gnus-level-default-unsubscribed 6
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
590 "*New unsubscribed groups will be unsubscribed at this level.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
591
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
592 (defvar gnus-activate-level (1+ gnus-level-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
593 "*Groups higher than this level won't be activated on startup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
594 Setting this variable to something log might save lots of time when
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
595 you have many groups that you aren't interested in.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
596
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
597 (defvar gnus-activate-foreign-newsgroups 4
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
598 "*If nil, Gnus will not check foreign newsgroups at startup.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
599 If it is non-nil, it should be a number between one and nine. Foreign
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
600 newsgroups that have a level lower or equal to this number will be
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
601 activated on startup. For instance, if you want to active all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
602 subscribed newsgroups, but not the rest, you'd set this variable to
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
603 `gnus-level-subscribed'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
604
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
605 If you subscribe to lots of newsgroups from different servers, startup
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
606 might take a while. By setting this variable to nil, you'll save time,
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
607 but you won't be told how many unread articles there are in the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
608 groups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
609
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
610 (defvar gnus-save-newsrc-file t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
611 "*Non-nil means that Gnus will save the `.newsrc' file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
612 Gnus always saves its own startup file, which is called
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
613 \".newsrc.eld\". The file called \".newsrc\" is in a format that can
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
614 be readily understood by other newsreaders. If you don't plan on
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
615 using other newsreaders, set this variable to nil to save some time on
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
616 exit.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
617
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
618 (defvar gnus-save-killed-list t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
619 "*If non-nil, save the list of killed groups to the startup file.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
620 If you set this variable to nil, you'll save both time (when starting
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
621 and quitting) and space (both memory and disk), but it will also mean
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
622 that Gnus has no record of which groups are new and which are old, so
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
623 the automatic new newsgroups subscription methods become meaningless.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
624
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
625 You should always set `gnus-check-new-newsgroups' to `ask-server' or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
626 nil if you set this variable to nil.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
627
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
628 (defvar gnus-interactive-catchup t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
629 "*If non-nil, require your confirmation when catching up a group.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
630
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
631 (defvar gnus-interactive-exit t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
632 "*If non-nil, require your confirmation when exiting Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
633
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
634 (defvar gnus-kill-killed t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
635 "*If non-nil, Gnus will apply kill files to already killed articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
636 If it is nil, Gnus will never apply kill files to articles that have
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
637 already been through the scoring process, which might very well save lots
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
638 of time.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
639
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
640 (defvar gnus-extract-address-components 'gnus-extract-address-components
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
641 "*Function for extracting address components from a From header.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
642 Two pre-defined function exist: `gnus-extract-address-components',
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
643 which is the default, quite fast, and too simplistic solution, and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
644 `mail-extract-address-components', which works much better, but is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
645 slower.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
646
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
647 (defvar gnus-summary-default-score 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
648 "*Default article score level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
649 If this variable is nil, scoring will be disabled.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
650
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
651 (defvar gnus-summary-zcore-fuzz 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
652 "*Fuzziness factor for the zcore in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
653 Articles with scores closer than this to `gnus-summary-default-score'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
654 will not be marked.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
655
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
656 (defvar gnus-simplify-subject-fuzzy-regexp nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
657 "*Strings to be removed when doing fuzzy matches.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
658 This can either be a regular expression or list of regular expressions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
659 that will be removed from subject strings if fuzzy subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
660 simplification is selected.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
661
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
662 (defvar gnus-permanently-visible-groups nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
663 "*Regexp to match groups that should always be listed in the group buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
664 This means that they will still be listed when there are no unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
665 articles in the groups.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
666
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
667 (defvar gnus-list-groups-with-ticked-articles t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
668 "*If non-nil, list groups that have only ticked articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
669 If nil, only list groups that have unread articles.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
670
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
671 (defvar gnus-group-default-list-level gnus-level-subscribed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
672 "*Default listing level.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
673 Ignored if `gnus-group-use-permanent-levels' is non-nil.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
674
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
675 (defvar gnus-group-use-permanent-levels nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
676 "*If non-nil, once you set a level, Gnus will use this level.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
677
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
678 (defvar gnus-group-list-inactive-groups t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
679 "*If non-nil, inactive groups will be listed.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
680
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
681 (defvar gnus-show-mime nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
682 "*If non-nil, do mime processing of articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
683 The articles will simply be fed to the function given by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
684 `gnus-show-mime-method'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
685
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
686 (defvar gnus-strict-mime t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
687 "*If nil, MIME-decode even if there is no Mime-Version header in the article.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
688
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
689 (defvar gnus-show-mime-method 'metamail-buffer
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
690 "*Function to process a MIME message.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
691 The function is called from the article buffer.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
692
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
693 (defvar gnus-decode-encoded-word-method (lambda ())
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
694 "*Function to decode a MIME encoded-words.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
695 The function is called from the article buffer.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
696
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
697 (defvar gnus-show-threads t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
698 "*If non-nil, display threads in summary mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
699
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
700 (defvar gnus-thread-hide-subtree nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
701 "*If non-nil, hide all threads initially.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
702 If threads are hidden, you have to run the command
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
703 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
704 to expose hidden threads.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
705
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
706 (defvar gnus-thread-hide-killed t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
707 "*If non-nil, hide killed threads automatically.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
708
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
709 (defvar gnus-thread-ignore-subject nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
710 "*If non-nil, ignore subjects and do all threading based on the Reference header.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
711 If nil, which is the default, articles that have different subjects
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
712 from their parents will start separate threads.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
713
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
714 (defvar gnus-thread-operation-ignore-subject t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
715 "*If non-nil, subjects will be ignored when doing thread commands.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
716 This affects commands like `gnus-summary-kill-thread' and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
717 `gnus-summary-lower-thread'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
718
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
719 If this variable is nil, articles in the same thread with different
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
720 subjects will not be included in the operation in question. If this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
721 variable is `fuzzy', only articles that have subjects that are fuzzily
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
722 equal will be included.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
723
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
724 (defvar gnus-thread-indent-level 4
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
725 "*Number that says how much each sub-thread should be indented.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
726
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
727 (defvar gnus-ignored-newsgroups
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
728 (purecopy (mapconcat 'identity
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
729 '("^to\\." ; not "real" groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
730 "^[0-9. \t]+ " ; all digits in name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
731 "[][\"#'()]" ; bogus characters
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
732 )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
733 "\\|"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
734 "*A regexp to match uninteresting newsgroups in the active file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
735 Any lines in the active file matching this regular expression are
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
736 removed from the newsgroup list before anything else is done to it,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
737 thus making them effectively non-existent.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
738
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
739 (defvar gnus-ignored-headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
740 "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:\\|^Received:\\|^Mail-from:"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
741 "*All headers that match this regexp will be hidden.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
742 This variable can also be a list of regexps of headers to be ignored.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
743 If `gnus-visible-headers' is non-nil, this variable will be ignored.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
744
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
745 (defvar gnus-visible-headers "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
746 "*All headers that do not match this regexp will be hidden.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
747 This variable can also be a list of regexp of headers to remain visible.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
748 If this variable is non-nil, `gnus-ignored-headers' will be ignored.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
749
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
750 (defvar gnus-sorted-header-list
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
751 '("^From:" "^Subject:" "^Summary:" "^Keywords:" "^Newsgroups:" "^To:"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
752 "^Cc:" "^Date:" "^Organization:")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
753 "*This variable is a list of regular expressions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
754 If it is non-nil, headers that match the regular expressions will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
755 be placed first in the article buffer in the sequence specified by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
756 this list.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
757
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
758 (defvar gnus-boring-article-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
759 '(empty followup-to reply-to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
760 "*Headers that are only to be displayed if they have interesting data.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
761 Possible values in this list are `empty', `newsgroups', `followup-to',
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
762 `reply-to', and `date'.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
763
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
764 (defvar gnus-show-all-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
765 "*If non-nil, don't hide any headers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
766
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
767 (defvar gnus-save-all-headers t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
768 "*If non-nil, don't remove any headers before saving.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
769
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
770 (defvar gnus-saved-headers gnus-visible-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
771 "*Headers to keep if `gnus-save-all-headers' is nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
772 If `gnus-save-all-headers' is non-nil, this variable will be ignored.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
773 If that variable is nil, however, all headers that match this regexp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
774 will be kept while the rest will be deleted before saving.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
775
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
776 (defvar gnus-inhibit-startup-message nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
777 "*If non-nil, the startup message will not be displayed.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
778
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
779 (defvar gnus-signature-separator "^-- *$"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
780 "Regexp matching signature separator.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
781
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
782 (defvar gnus-signature-limit nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
783 "Provide a limit to what is considered a signature.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
784 If it is a number, no signature may not be longer (in characters) than
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
785 that number. If it is a function, the function will be called without
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
786 any parameters, and if it returns nil, there is no signature in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
787 buffer. If it is a string, it will be used as a regexp. If it
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
788 matches, the text in question is not a signature.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
789
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
790 (defvar gnus-auto-extend-newsgroup t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
791 "*If non-nil, extend newsgroup forward and backward when requested.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
792
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
793 (defvar gnus-auto-select-first t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
794 "*If nil, don't select the first unread article when entering a group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
795 If this variable is `best', select the highest-scored unread article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
796 in the group. If neither nil nor `best', select the first unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
797 article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
798
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
799 If you want to prevent automatic selection of the first unread article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
800 in some newsgroups, set the variable to nil in
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
801 `gnus-select-group-hook'.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
802
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
803 (defvar gnus-auto-select-next t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
804 "*If non-nil, offer to go to the next group from the end of the previous.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
805 If the value is t and the next newsgroup is empty, Gnus will exit
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
806 summary mode and go back to group mode. If the value is neither nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
807 nor t, Gnus will select the following unread newsgroup. In
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
808 particular, if the value is the symbol `quietly', the next unread
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
809 newsgroup will be selected without any confirmation, and if it is
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
810 `almost-quietly', the next group will be selected without any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
811 confirmation if you are located on the last article in the group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
812 Finally, if this variable is `slightly-quietly', the `Z n' command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
813 will go to the next group without confirmation.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
814
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
815 (defvar gnus-auto-select-same nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
816 "*If non-nil, select the next article with the same subject.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
817
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
818 (defvar gnus-summary-check-current nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
819 "*If non-nil, consider the current article when moving.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
820 The \"unread\" movement commands will stay on the same line if the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
821 current article is unread.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
822
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
823 (defvar gnus-auto-center-summary t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
824 "*If non-nil, always center the current summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
825 In particular, if `vertical' do only vertical recentering. If non-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
826 and non-`vertical', do both horizontal and vertical recentering.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
827
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
828 (defvar gnus-break-pages t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
829 "*If non-nil, do page breaking on articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
830 The page delimiter is specified by the `gnus-page-delimiter'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
831 variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
832
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
833 (defvar gnus-page-delimiter "^\^L"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
834 "*Regexp describing what to use as article page delimiters.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
835 The default value is \"^\^L\", which is a form linefeed at the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
836 beginning of a line.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
837
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
838 (defvar gnus-use-full-window t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
839 "*If non-nil, use the entire Emacs screen.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
840
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
841 (defvar gnus-window-configuration nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
842 "Obsolete variable. See `gnus-buffer-configuration'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
843
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
844 (defvar gnus-window-min-width 2
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
845 "*Minimum width of Gnus buffers.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
846
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
847 (defvar gnus-window-min-height 1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
848 "*Minimum height of Gnus buffers.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
849
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
850 (defvar gnus-buffer-configuration
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
851 '((group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
852 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
853 (group 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
854 (if gnus-carpal '(group-carpal 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
855 (summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
856 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
857 (summary 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
858 (if gnus-carpal '(summary-carpal 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
859 (article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
860 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
861 (gnus-use-picons
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
862 '(frame 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
863 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
864 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
865 (if gnus-carpal '(summary-carpal 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
866 (article 1.0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
867 (vertical ((height . 5) (width . 15)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
868 (user-position . t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
869 (left . -1) (top . 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
870 (picons 1.0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
871 (gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
872 '(vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
873 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
874 (tree 0.25)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
875 (article 1.0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
876 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
877 '(vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
878 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
879 (if gnus-carpal '(summary-carpal 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
880 (article 1.0)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
881 (server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
882 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
883 (server 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
884 (if gnus-carpal '(server-carpal 2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
885 (browse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
886 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
887 (browse 1.0 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
888 (if gnus-carpal '(browse-carpal 2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
889 (message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
890 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
891 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
892 (pick
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
893 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
894 (article 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
895 (info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
896 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
897 (info 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
898 (summary-faq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
899 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
900 (summary 0.25)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
901 (faq 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
902 (edit-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
903 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
904 (group 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
905 (edit-group 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
906 (edit-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
907 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
908 (server 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
909 (edit-server 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
910 (edit-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
911 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
912 (summary 0.25)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
913 (edit-score 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
914 (post
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
915 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
916 (post 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
917 (reply
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
918 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
919 (article-copy 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
920 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
921 (forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
922 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
923 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
924 (reply-yank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
925 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
926 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
927 (mail-bounce
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
928 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
929 (article 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
930 (message 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
931 (draft
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
932 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
933 (draft 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
934 (pipe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
935 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
936 (summary 0.25 point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
937 (if gnus-carpal '(summary-carpal 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
938 ("*Shell Command Output*" 1.0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
939 (bug
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
940 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
941 ("*Gnus Help Bug*" 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
942 ("*Gnus Bug*" 1.0 point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
943 (compose-bounce
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
944 (vertical 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
945 (article 0.5)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
946 (message 1.0 point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
947 "Window configuration for all possible Gnus buffers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
948 This variable is a list of lists. Each of these lists has a NAME and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
949 a RULE. The NAMEs are commonsense names like `group', which names a
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
950 rule used when displaying the group buffer; `summary', which names a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
951 rule for what happens when you enter a group and do not display an
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
952 article buffer; and so on. See the value of this variable for a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
953 complete list of NAMEs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
954
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
955 Each RULE is a list of vectors. The first element in this vector is
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
956 the name of the buffer to be displayed; the second element is the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
957 percentage of the screen this buffer is to occupy (a number in the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
958 0.0-0.99 range); the optional third element is `point', which should
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
959 be present to denote which buffer point is to go to after making this
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
960 buffer configuration.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
961
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
962 (defvar gnus-window-to-buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
963 '((group . gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
964 (summary . gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
965 (article . gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
966 (server . gnus-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
967 (browse . "*Gnus Browse Server*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
968 (edit-group . gnus-group-edit-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
969 (edit-server . gnus-server-edit-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
970 (group-carpal . gnus-carpal-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
971 (summary-carpal . gnus-carpal-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
972 (server-carpal . gnus-carpal-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
973 (browse-carpal . gnus-carpal-browse-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
974 (edit-score . gnus-score-edit-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
975 (message . gnus-message-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
976 (mail . gnus-message-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
977 (post-news . gnus-message-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
978 (faq . gnus-faq-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
979 (picons . "*Picons*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
980 (tree . gnus-tree-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
981 (info . gnus-info-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
982 (article-copy . gnus-article-copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
983 (draft . gnus-draft-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
984 "Mapping from short symbols to buffer names or buffer variables.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
985
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
986 (defvar gnus-carpal nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
987 "*If non-nil, display clickable icons.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
988
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
989 (defvar gnus-subscribe-newsgroup-method 'gnus-subscribe-zombies
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
990 "*Function called with a group name when new group is detected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
991 A few pre-made functions are supplied: `gnus-subscribe-randomly'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
992 inserts new groups at the beginning of the list of groups;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
993 `gnus-subscribe-alphabetically' inserts new groups in strict
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
994 alphabetic order; `gnus-subscribe-hierarchically' inserts new groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
995 in hierarchical newsgroup order; `gnus-subscribe-interactively' asks
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
996 for your decision; `gnus-subscribe-killed' kills all new groups;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
997 `gnus-subscribe-zombies' will make all new groups into zombies.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
998
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
999 ;; Suggested by a bug report by Hallvard B Furuseth.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1000 ;; <h.b.furuseth@usit.uio.no>.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1001 (defvar gnus-subscribe-options-newsgroup-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1002 (function gnus-subscribe-alphabetically)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1003 "*This function is called to subscribe newsgroups mentioned on \"options -n\" lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1004 If, for instance, you want to subscribe to all newsgroups in the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1005 \"no\" and \"alt\" hierarchies, you'd put the following in your
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1006 .newsrc file:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1007
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1008 options -n no.all alt.all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1009
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1010 Gnus will the subscribe all new newsgroups in these hierarchies with
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1011 the subscription method in this variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1012
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1013 (defvar gnus-subscribe-hierarchical-interactive nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1014 "*If non-nil, Gnus will offer to subscribe hierarchically.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1015 When a new hierarchy appears, Gnus will ask the user:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1016
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1017 'alt.binaries': Do you want to subscribe to this hierarchy? ([d]ys):
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1018
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1019 If the user pressed `d', Gnus will descend the hierarchy, `y' will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1020 subscribe to all newsgroups in the hierarchy and `s' will skip this
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1021 hierarchy in its entirety.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1022
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1023 (defvar gnus-group-sort-function 'gnus-group-sort-by-alphabet
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1024 "*Function used for sorting the group buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1025 This function will be called with group info entries as the arguments
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1026 for the groups to be sorted. Pre-made functions include
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1027 `gnus-group-sort-by-alphabet', `gnus-group-sort-by-unread',
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1028 `gnus-group-sort-by-level', `gnus-group-sort-by-score', and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1029 `gnus-group-sort-by-rank'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1030
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1031 This variable can also be a list of sorting functions. In that case,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1032 the most significant sort function should be the last function in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1033 list.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1034
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1035 ;; Mark variables suggested by Thomas Michanek
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1036 ;; <Thomas.Michanek@telelogic.se>.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1037 (defvar gnus-unread-mark ?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1038 "*Mark used for unread articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1039 (defvar gnus-ticked-mark ?!
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1040 "*Mark used for ticked articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1041 (defvar gnus-dormant-mark ??
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1042 "*Mark used for dormant articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1043 (defvar gnus-del-mark ?r
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1044 "*Mark used for del'd articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1045 (defvar gnus-read-mark ?R
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1046 "*Mark used for read articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1047 (defvar gnus-expirable-mark ?E
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1048 "*Mark used for expirable articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1049 (defvar gnus-killed-mark ?K
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1050 "*Mark used for killed articles.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1051 (defvar gnus-souped-mark ?F
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1052 "*Mark used for killed articles.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1053 (defvar gnus-kill-file-mark ?X
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1054 "*Mark used for articles killed by kill files.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1055 (defvar gnus-low-score-mark ?Y
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1056 "*Mark used for articles with a low score.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1057 (defvar gnus-catchup-mark ?C
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1058 "*Mark used for articles that are caught up.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1059 (defvar gnus-replied-mark ?A
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1060 "*Mark used for articles that have been replied to.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1061 (defvar gnus-cached-mark ?*
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1062 "*Mark used for articles that are in the cache.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1063 (defvar gnus-saved-mark ?S
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1064 "*Mark used for articles that have been saved to.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1065 (defvar gnus-process-mark ?#
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1066 "*Process mark.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1067 (defvar gnus-ancient-mark ?O
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1068 "*Mark used for ancient articles.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1069 (defvar gnus-sparse-mark ?Q
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1070 "*Mark used for sparsely reffed articles.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1071 (defvar gnus-canceled-mark ?G
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1072 "*Mark used for canceled articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1073 (defvar gnus-score-over-mark ?+
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1074 "*Score mark used for articles with high scores.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1075 (defvar gnus-score-below-mark ?-
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1076 "*Score mark used for articles with low scores.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1077 (defvar gnus-empty-thread-mark ?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1078 "*There is no thread under the article.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1079 (defvar gnus-not-empty-thread-mark ?=
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1080 "*There is a thread under the article.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1081
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1082 (defvar gnus-view-pseudo-asynchronously nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1083 "*If non-nil, Gnus will view pseudo-articles asynchronously.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1084
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1085 (defvar gnus-view-pseudos nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1086 "*If `automatic', pseudo-articles will be viewed automatically.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1087 If `not-confirm', pseudos will be viewed automatically, and the user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1088 will not be asked to confirm the command.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1089
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1090 (defvar gnus-view-pseudos-separately t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1091 "*If non-nil, one pseudo-article will be created for each file to be viewed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1092 If nil, all files that use the same viewing command will be given as a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1093 list of parameters to that command.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1094
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1095 (defvar gnus-insert-pseudo-articles t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1096 "*If non-nil, insert pseudo-articles when decoding articles.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1097
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1098 (defvar gnus-group-line-format "%M%S%p%P%5y: %(%g%)%l\n"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1099 "*Format of group lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1100 It works along the same lines as a normal formatting string,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1101 with some simple extensions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1102
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1103 %M Only marked articles (character, \"*\" or \" \")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1104 %S Whether the group is subscribed (character, \"U\", \"K\", \"Z\" or \" \")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1105 %L Level of subscribedness (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1106 %N Number of unread articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1107 %I Number of dormant articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1108 %i Number of ticked and dormant (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1109 %T Number of ticked articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1110 %R Number of read articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1111 %t Total number of articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1112 %y Number of unread, unticked articles (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1113 %G Group name (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1114 %g Qualified group name (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1115 %D Group description (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1116 %s Select method (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1117 %o Moderated group (char, \"m\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1118 %p Process mark (char)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1119 %O Moderated group (string, \"(m)\" or \"\")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1120 %P Topic indentation (string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1121 %l Whether there are GroupLens predictions for this group (string)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1122 %n Select from where (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1123 %z A string that look like `<%s:%n>' if a foreign select method is used
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1124 %u User defined specifier. The next character in the format string should
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1125 be a letter. Gnus will call the function gnus-user-format-function-X,
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1126 where X is the letter following %u. The function will be passed the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1127 current header as argument. The function should return a string, which
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1128 will be inserted into the buffer just like information from any other
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1129 group specifier.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1130
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1131 Text between %( and %) will be highlighted with `gnus-mouse-face' when
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1132 the mouse point move inside the area. There can only be one such area.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1133
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1134 Note that this format specification is not always respected. For
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1135 reasons of efficiency, when listing killed groups, this specification
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1136 is ignored altogether. If the spec is changed considerably, your
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1137 output may end up looking strange when listing both alive and killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1138 groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1139
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1140 If you use %o or %O, reading the active file will be slower and quite
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1141 a bit of extra memory will be used. %D will also worsen performance.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1142 Also note that if you change the format specification to include any
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1143 of these specs, you must probably re-start Gnus to see them go into
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1144 effect.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1145
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1146 (defvar gnus-summary-line-format "%U%R%z%I%(%[%4L: %-20,20n%]%) %s\n"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1147 "*The format specification of the lines in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1148
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1149 It works along the same lines as a normal formatting string,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1150 with some simple extensions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1151
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1152 %N Article number, left padded with spaces (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1153 %S Subject (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1154 %s Subject if it is at the root of a thread, and \"\" otherwise (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1155 %n Name of the poster (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1156 %a Extracted name of the poster (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1157 %A Extracted address of the poster (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1158 %F Contents of the From: header (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1159 %x Contents of the Xref: header (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1160 %D Date of the article (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1161 %d Date of the article (string) in DD-MMM format
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1162 %M Message-id of the article (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1163 %r References of the article (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1164 %c Number of characters in the article (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1165 %L Number of lines in the article (integer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1166 %I Indentation based on thread level (a string of spaces)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1167 %T A string with two possible values: 80 spaces if the article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1168 is on thread level two or larger and 0 spaces on level one
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1169 %R \"A\" if this article has been replied to, \" \" otherwise (character)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1170 %U Status of this article (character, \"R\", \"K\", \"-\" or \" \")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1171 %[ Opening bracket (character, \"[\" or \"<\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1172 %] Closing bracket (character, \"]\" or \">\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1173 %> Spaces of length thread-level (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1174 %< Spaces of length (- 20 thread-level) (string)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1175 %i Article score (number)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1176 %z Article zcore (character)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1177 %t Number of articles under the current thread (number).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1178 %e Whether the thread is empty or not (character).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1179 %l GroupLens score (string).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1180 %u User defined specifier. The next character in the format string should
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1181 be a letter. Gnus will call the function gnus-user-format-function-X,
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1182 where X is the letter following %u. The function will be passed the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1183 current header as argument. The function should return a string, which
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1184 will be inserted into the summary just like information from any other
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1185 summary specifier.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1186
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1187 Text between %( and %) will be highlighted with `gnus-mouse-face'
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1188 when the mouse point is placed inside the area. There can only be one
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1189 such area.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1190
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1191 The %U (status), %R (replied) and %z (zcore) specs have to be handled
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1192 with care. For reasons of efficiency, Gnus will compute what column
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1193 these characters will end up in, and \"hard-code\" that. This means that
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1194 it is illegal to have these specs after a variable-length spec. Well,
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1195 you might not be arrested, but your summary buffer will look strange,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1196 which is bad enough.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1197
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1198 The smart choice is to have these specs as for to the left as
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1199 possible.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1200
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1201 This restriction may disappear in later versions of Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1202
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1203 (defvar gnus-summary-dummy-line-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1204 "* %(: :%) %S\n"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1205 "*The format specification for the dummy roots in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1206 It works along the same lines as a normal formatting string,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1207 with some simple extensions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1208
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1209 %S The subject")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1210
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1211 (defvar gnus-summary-mode-line-format "Gnus: %%b [%A] %Z"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1212 "*The format specification for the summary mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1213 It works along the same lines as a normal formatting string,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1214 with some simple extensions:
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1215
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1216 %G Group name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1217 %p Unprefixed group name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1218 %A Current article number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1219 %V Gnus version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1220 %U Number of unread articles in the group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1221 %e Number of unselected articles in the group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1222 %Z A string with unread/unselected article counts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1223 %g Shortish group name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1224 %S Subject of the current article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1225 %u User-defined spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1226 %s Current score file name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1227 %d Number of dormant articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1228 %r Number of articles that have been marked as read in this session
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1229 %E Number of articles expunged by the score files")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1230
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1231 (defvar gnus-article-mode-line-format "Gnus: %%b %S"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1232 "*The format specification for the article mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1233 See `gnus-summary-mode-line-format' for a closer description.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1234
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1235 (defvar gnus-group-mode-line-format "Gnus: %%b {%M%:%S}"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1236 "*The format specification for the group mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1237 It works along the same lines as a normal formatting string,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1238 with some simple extensions:
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1239
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1240 %S The native news server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1241 %M The native select method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1242 %: \":\" if %S isn't \"\".")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1243
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1244 (defvar gnus-valid-select-methods
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1245 '(("nntp" post address prompt-address)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1246 ("nnspool" post address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1247 ("nnvirtual" post-mail virtual prompt-address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1248 ("nnmbox" mail respool address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1249 ("nnml" mail respool address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1250 ("nnmh" mail respool address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1251 ("nndir" post-mail prompt-address address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1252 ("nneething" none address prompt-address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1253 ("nndoc" none address prompt-address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1254 ("nnbabyl" mail address respool)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1255 ("nnkiboze" post virtual)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1256 ("nnsoup" post-mail address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1257 ("nndraft" post-mail)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1258 ("nnfolder" mail respool address))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1259 "An alist of valid select methods.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1260 The first element of each list lists should be a string with the name
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1261 of the select method. The other elements may be be the category of
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1262 this method (ie. `post', `mail', `none' or whatever) or other
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1263 properties that this method has (like being respoolable).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1264 If you implement a new select method, all you should have to change is
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1265 this variable. I think.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1266
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1267 (defvar gnus-updated-mode-lines '(group article summary tree)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1268 "*List of buffers that should update their mode lines.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1269 The list may contain the symbols `group', `article' and `summary'. If
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1270 the corresponding symbol is present, Gnus will keep that mode line
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1271 updated with information that may be pertinent.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1272 If this variable is nil, screen refresh may be quicker.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1273
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1274 ;; Added by Keinonen Kari <kk85613@cs.tut.fi>.
13732
b09b073f6b77 * gnus.el (gnus-summary-mode-line-format,
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13700
diff changeset
1275 (defvar gnus-mode-non-string-length nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1276 "*Max length of mode-line non-string contents.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1277 If this is nil, Gnus will take space as is needed, leaving the rest
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1278 of the modeline intact.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1279
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1280 ;see gnus-cus.el
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1281 ;(defvar gnus-mouse-face 'highlight
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1282 ; "*Face used for mouse highlighting in Gnus.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1283 ;No mouse highlights will be done if `gnus-visual' is nil.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1284
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1285 (defvar gnus-summary-mark-below 0
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1286 "*Mark all articles with a score below this variable as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1287 This variable is local to each summary buffer and usually set by the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1288 score file.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1289
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1290 (defvar gnus-article-sort-functions '(gnus-article-sort-by-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1291 "*List of functions used for sorting articles in the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1292 This variable is only used when not using a threaded display.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1293
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1294 (defvar gnus-thread-sort-functions '(gnus-thread-sort-by-number)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1295 "*List of functions used for sorting threads in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1296 By default, threads are sorted by article number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1297
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1298 Each function takes two threads and return non-nil if the first thread
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1299 should be sorted before the other. If you use more than one function,
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1300 the primary sort function should be the last. You should probably
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1301 always include `gnus-thread-sort-by-number' in the list of sorting
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1302 functions -- preferably first.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1303
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1304 Ready-mady functions include `gnus-thread-sort-by-number',
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1305 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject',
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1306 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1307 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function').")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1308
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1309 (defvar gnus-thread-score-function '+
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1310 "*Function used for calculating the total score of a thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1311
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1312 The function is called with the scores of the article and each
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1313 subthread and should then return the score of the thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1314
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1315 Some functions you can use are `+', `max', or `min'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1316
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1317 (defvar gnus-summary-expunge-below nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1318 "All articles that have a score less than this variable will be expunged.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1319
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1320 (defvar gnus-thread-expunge-below nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1321 "All threads that have a total score less than this variable will be expunged.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1322 See `gnus-thread-score-function' for en explanation of what a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1323 \"thread score\" is.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1324
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1325 (defvar gnus-auto-subscribed-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1326 "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1327 "*All new groups that match this regexp will be subscribed automatically.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1328 Note that this variable only deals with new groups. It has no effect
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1329 whatsoever on old groups.
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1330
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1331 New groups that match this regexp will not be handled by
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1332 `gnus-subscribe-newsgroup-method'. Instead, they will
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1333 be subscribed using `gnus-subscribe-options-newsgroup-method'.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1334
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1335 (defvar gnus-options-subscribe nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1336 "*All new groups matching this regexp will be subscribed unconditionally.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1337 Note that this variable deals only with new newsgroups. This variable
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1338 does not affect old newsgroups.
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1339
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1340 New groups that match this regexp will not be handled by
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1341 `gnus-subscribe-newsgroup-method'. Instead, they will
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
1342 be subscribed using `gnus-subscribe-options-newsgroup-method'.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1343
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1344 (defvar gnus-options-not-subscribe nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1345 "*All new groups matching this regexp will be ignored.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1346 Note that this variable deals only with new newsgroups. This variable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1347 does not affect old (already subscribed) newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1348
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1349 (defvar gnus-auto-expirable-newsgroups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1350 "*Groups in which to automatically mark read articles as expirable.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1351 If non-nil, this should be a regexp that should match all groups in
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1352 which to perform auto-expiry. This only makes sense for mail groups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1353
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1354 (defvar gnus-total-expirable-newsgroups nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1355 "*Groups in which to perform expiry of all read articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1356 Use with extreme caution. All groups that match this regexp will be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1357 expiring - which means that all read articles will be deleted after
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1358 (say) one week. (This only goes for mail groups and the like, of
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1359 course.)")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1360
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1361 (defvar gnus-group-uncollapsed-levels 1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1362 "Number of group name elements to leave alone when making a short group name.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1363
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1364 (defvar gnus-hidden-properties '(invisible t intangible t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1365 "Property list to use for hiding text.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1366
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1367 (defvar gnus-modtime-botch nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1368 "*Non-nil means .newsrc should be deleted prior to save.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1369 Its use is due to the bogus appearance that .newsrc was modified on
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1370 disc.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1371
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1372 ;; Hooks.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1373
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1374 (defvar gnus-group-mode-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1375 "*A hook for Gnus group mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1376
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1377 (defvar gnus-summary-mode-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1378 "*A hook for Gnus summary mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1379 This hook is run before any variables are set in the summary buffer.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1380
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1381 (defvar gnus-article-mode-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1382 "*A hook for Gnus article mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1383
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1384 (defvar gnus-summary-prepare-exit-hook nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1385 "*A hook called when preparing to exit from the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1386 It calls `gnus-summary-expire-articles' by default.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1387 (add-hook 'gnus-summary-prepare-exit-hook 'gnus-summary-expire-articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1388
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1389 (defvar gnus-summary-exit-hook nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1390 "*A hook called on exit from the summary buffer.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1391
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1392 (defvar gnus-group-catchup-group-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1393 "*A hook run when catching up a group from the group buffer.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1394
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1395 (defvar gnus-group-update-group-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1396 "*A hook called when updating group lines.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1397
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1398 (defvar gnus-open-server-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1399 "*A hook called just before opening connection to the news server.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1400
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1401 (defvar gnus-load-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1402 "*A hook run while Gnus is loaded.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1403
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1404 (defvar gnus-startup-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1405 "*A hook called at startup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1406 This hook is called after Gnus is connected to the NNTP server.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1407
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1408 (defvar gnus-get-new-news-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1409 "*A hook run just before Gnus checks for new news.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1410
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1411 (defvar gnus-after-getting-new-news-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1412 "*A hook run after Gnus checks for new news.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1413
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1414 (defvar gnus-group-prepare-function 'gnus-group-prepare-flat
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1415 "*A function that is called to generate the group buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1416 The function is called with three arguments: The first is a number;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1417 all group with a level less or equal to that number should be listed,
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1418 if the second is non-nil, empty groups should also be displayed. If
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1419 the third is non-nil, it is a number. No groups with a level lower
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1420 than this number should be displayed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1421
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1422 The only current function implemented is `gnus-group-prepare-flat'.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1423
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1424 (defvar gnus-group-prepare-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1425 "*A hook called after the group buffer has been generated.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1426 If you want to modify the group buffer, you can use this hook.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1427
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1428 (defvar gnus-summary-prepare-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1429 "*A hook called after the summary buffer has been generated.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1430 If you want to modify the summary buffer, you can use this hook.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1431
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1432 (defvar gnus-summary-generate-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1433 "*A hook run just before generating the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1434 This hook is commonly used to customize threading variables and the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1435 like.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1436
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1437 (defvar gnus-article-prepare-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1438 "*A hook called after an article has been prepared in the article buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1439 If you want to run a special decoding program like nkf, use this hook.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1440
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1441 ;(defvar gnus-article-display-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1442 ; "*A hook called after the article is displayed in the article buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1443 ;The hook is designed to change the contents of the article
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1444 ;buffer. Typical functions that this hook may contain are
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1445 ;`gnus-article-hide-headers' (hide selected headers),
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1446 ;`gnus-article-maybe-highlight' (perform fancy article highlighting),
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1447 ;`gnus-article-hide-signature' (hide signature) and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1448 ;`gnus-article-treat-overstrike' (turn \"^H_\" into bold characters).")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1449 ;(add-hook 'gnus-article-display-hook 'gnus-article-hide-headers-if-wanted)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1450 ;(add-hook 'gnus-article-display-hook 'gnus-article-treat-overstrike)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1451 ;(add-hook 'gnus-article-display-hook 'gnus-article-maybe-highlight)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1452
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1453 (defvar gnus-article-x-face-too-ugly nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1454 "Regexp matching posters whose face shouldn't be shown automatically.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1455
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1456 (defvar gnus-select-group-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1457 "*A hook called when a newsgroup is selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1458
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1459 If you'd like to simplify subjects like the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1460 `gnus-summary-next-same-subject' command does, you can use the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1461 following hook:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1462
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1463 (setq gnus-select-group-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1464 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1465 (lambda ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1466 (mapcar (lambda (header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1467 (mail-header-set-subject
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1468 header
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1469 (gnus-simplify-subject
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1470 (mail-header-subject header) 're-only)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1471 gnus-newsgroup-headers))))")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1472
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1473 (defvar gnus-select-article-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1474 "*A hook called when an article is selected.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1475
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1476 (defvar gnus-apply-kill-hook '(gnus-apply-kill-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1477 "*A hook called to apply kill files to a group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1478 This hook is intended to apply a kill file to the selected newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1479 The function `gnus-apply-kill-file' is called by default.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1480
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1481 Since a general kill file is too heavy to use only for a few
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1482 newsgroups, I recommend you to use a lighter hook function. For
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1483 example, if you'd like to apply a kill file to articles which contains
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1484 a string `rmgroup' in subject in newsgroup `control', you can use the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1485 following hook:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1486
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1487 (setq gnus-apply-kill-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1488 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1489 (lambda ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1490 (cond ((string-match \"control\" gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1491 (gnus-kill \"Subject\" \"rmgroup\")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1492 (gnus-expunge \"X\"))))))")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1493
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1494 (defvar gnus-visual-mark-article-hook
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1495 (list 'gnus-highlight-selected-summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1496 "*Hook run after selecting an article in the summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1497 It is meant to be used for highlighting the article in some way. It
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1498 is not run if `gnus-visual' is nil.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1499
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1500 (defvar gnus-parse-headers-hook nil
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
1501 "*A hook called before parsing the headers.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1502 (add-hook 'gnus-parse-headers-hook 'gnus-decode-rfc1522)
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
1503
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1504 (defvar gnus-exit-group-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1505 "*A hook called when exiting (not quitting) summary mode.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1506
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1507 (defvar gnus-suspend-gnus-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1508 "*A hook called when suspending (not exiting) Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1509
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1510 (defvar gnus-exit-gnus-hook nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1511 "*A hook called when exiting Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1512
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1513 (defvar gnus-after-exiting-gnus-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1514 "*A hook called after exiting Gnus.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1515
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1516 (defvar gnus-save-newsrc-hook nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1517 "*A hook called before saving any of the newsrc files.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1518
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1519 (defvar gnus-save-quick-newsrc-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1520 "*A hook called just before saving the quick newsrc file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1521 Can be used to turn version control on or off.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1522
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1523 (defvar gnus-save-standard-newsrc-hook nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1524 "*A hook called just before saving the standard newsrc file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1525 Can be used to turn version control on or off.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1526
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1527 (defvar gnus-summary-update-hook
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1528 (list 'gnus-summary-highlight-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1529 "*A hook called when a summary line is changed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1530 The hook will not be called if `gnus-visual' is nil.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1531
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1532 The default function `gnus-summary-highlight-line' will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1533 highlight the line according to the `gnus-summary-highlight'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1534 variable.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1535
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1536 (defvar gnus-group-update-hook '(gnus-group-highlight-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1537 "*A hook called when a group line is changed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1538 The hook will not be called if `gnus-visual' is nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1539
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1540 The default function `gnus-group-highlight-line' will
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1541 highlight the line according to the `gnus-group-highlight'
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1542 variable.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1543
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1544 (defvar gnus-mark-article-hook '(gnus-summary-mark-read-and-unread-as-read)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1545 "*A hook called when an article is selected for the first time.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1546 The hook is intended to mark an article as read (or unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1547 automatically when it is selected.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1548
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1549 (defvar gnus-group-change-level-function nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1550 "Function run when a group level is changed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1551 It is called with three parameters -- GROUP, LEVEL and OLDLEVEL.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1552
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1553 ;; Remove any hilit infestation.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1554 (add-hook 'gnus-startup-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1555 (lambda ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1556 (remove-hook 'gnus-summary-prepare-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1557 'hilit-rehighlight-buffer-quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1558 (remove-hook 'gnus-summary-prepare-hook 'hilit-install-line-hooks)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1559 (setq gnus-mark-article-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1560 '(gnus-summary-mark-read-and-unread-as-read))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1561 (remove-hook 'gnus-article-prepare-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1562 'hilit-rehighlight-buffer-quietly)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1563
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1564
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1565 ;; Internal variables
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1566
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1567 (defvar gnus-tree-buffer "*Tree*"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1568 "Buffer where Gnus thread trees are displayed.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1569
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1570 ;; Dummy variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1571 (defvar gnus-use-generic-from nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1572
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1573 (defvar gnus-thread-indent-array nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1574 (defvar gnus-thread-indent-array-level gnus-thread-indent-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1575
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1576 (defvar gnus-newsrc-file-version nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1577
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1578 (defvar gnus-method-history nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1579 ;; Variable holding the user answers to all method prompts.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1580
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1581 (defvar gnus-group-history nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1582 ;; Variable holding the user answers to all group prompts.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1583
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1584 (defvar gnus-server-alist nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1585 "List of available servers.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1586
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1587 (defvar gnus-group-indentation-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1588
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1589 (defvar gnus-topic-indentation "") ;; Obsolete variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1590
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1591 (defvar gnus-goto-missing-group-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1592
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1593 (defvar gnus-override-subscribe-method nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1594
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1595 (defvar gnus-group-goto-next-group-function nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1596 "Function to override finding the next group after listing groups.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1597
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1598 (defconst gnus-article-mark-lists
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1599 '((marked . tick) (replied . reply)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1600 (expirable . expire) (killed . killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1601 (bookmarks . bookmark) (dormant . dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1602 (scored . score) (saved . save)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1603 (cached . cache)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1604 ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1605
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1606 ;; Avoid highlighting in kill files.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1607 (defvar gnus-summary-inhibit-highlight nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1608 (defvar gnus-newsgroup-selected-overlay nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1609
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1610 (defvar gnus-inhibit-hiding nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1611 (defvar gnus-group-indentation "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1612 (defvar gnus-inhibit-limiting nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1613 (defvar gnus-created-frames nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1614
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1615 (defvar gnus-article-mode-map nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1616 (defvar gnus-dribble-buffer nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1617 (defvar gnus-headers-retrieved-by nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1618 (defvar gnus-article-reply nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1619 (defvar gnus-override-method nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1620 (defvar gnus-article-check-size nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1621
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1622 (defvar gnus-current-score-file nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1623 (defvar gnus-newsgroup-adaptive-score-file nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1624 (defvar gnus-scores-exclude-files nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1625
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1626 (defvar gnus-opened-servers nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1627
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1628 (defvar gnus-current-move-group nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1629 (defvar gnus-current-copy-group nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1630 (defvar gnus-current-crosspost-group nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1631
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1632 (defvar gnus-newsgroup-dependencies nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1633 (defvar gnus-newsgroup-async nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1634 (defconst gnus-group-edit-buffer "*Gnus edit newsgroup*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1635
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1636 (defvar gnus-newsgroup-adaptive nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1637
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1638 (defvar gnus-summary-display-table nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1639 (defvar gnus-summary-display-article-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1640
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1641 (defvar gnus-summary-highlight-line-function nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1642 "Function called after highlighting a summary line.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1643
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1644 (defvar gnus-group-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1645 `((?M gnus-tmp-marked-mark ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1646 (?S gnus-tmp-subscribed ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1647 (?L gnus-tmp-level ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1648 (?N (cond ((eq number t) "*" )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1649 ((numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1650 (int-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1651 (+ number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1652 (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1653 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1654 (t number)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1655 (?R gnus-tmp-number-of-read ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1656 (?t gnus-tmp-number-total ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1657 (?y gnus-tmp-number-of-unread ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1658 (?I (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1659 (?T (gnus-range-length (cdr (assq 'tick gnus-tmp-marked))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1660 (?i (+ (gnus-range-length (cdr (assq 'dormant gnus-tmp-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1661 (gnus-range-length (cdr (assq 'tick gnus-tmp-marked)))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1662 (?g gnus-tmp-group ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1663 (?G gnus-tmp-qualified-group ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1664 (?c (gnus-short-group-name gnus-tmp-group) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1665 (?D gnus-tmp-newsgroup-description ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1666 (?o gnus-tmp-moderated ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1667 (?O gnus-tmp-moderated-string ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1668 (?p gnus-tmp-process-marked ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1669 (?s gnus-tmp-news-server ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1670 (?n gnus-tmp-news-method ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1671 (?P gnus-group-indentation ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1672 (?l gnus-tmp-grouplens ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1673 (?z gnus-tmp-news-method-string ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1674 (?u gnus-tmp-user-defined ?s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1675
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1676 (defvar gnus-summary-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1677 `((?N ,(macroexpand '(mail-header-number gnus-tmp-header)) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1678 (?S ,(macroexpand '(mail-header-subject gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1679 (?s gnus-tmp-subject-or-nil ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1680 (?n gnus-tmp-name ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1681 (?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1682 ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1683 (?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1684 gnus-tmp-from) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1685 (?F gnus-tmp-from ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1686 (?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1687 (?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1688 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1689 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1690 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1691 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1692 (?L gnus-tmp-lines ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1693 (?I gnus-tmp-indentation ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1694 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1695 (?R gnus-tmp-replied ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1696 (?\[ gnus-tmp-opening-bracket ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1697 (?\] gnus-tmp-closing-bracket ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1698 (?\> (make-string gnus-tmp-level ? ) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1699 (?\< (make-string (max 0 (- 20 gnus-tmp-level)) ? ) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1700 (?i gnus-tmp-score ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1701 (?z gnus-tmp-score-char ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1702 (?l (bbb-grouplens-score gnus-tmp-header) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1703 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1704 (?U gnus-tmp-unread ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1705 (?t (gnus-summary-number-of-articles-in-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1706 (and (boundp 'thread) (car thread)) gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1707 ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1708 (?e (gnus-summary-number-of-articles-in-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1709 (and (boundp 'thread) (car thread)) gnus-tmp-level t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1710 ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1711 (?u gnus-tmp-user-defined ?s))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1712 "An alist of format specifications that can appear in summary lines,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1713 and what variables they correspond with, along with the type of the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1714 variable (string, integer, character, etc).")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1715
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1716 (defvar gnus-summary-dummy-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1717 `((?S gnus-tmp-subject ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1718 (?N gnus-tmp-number ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1719 (?u gnus-tmp-user-defined ?s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1720
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1721 (defvar gnus-summary-mode-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1722 `((?G gnus-tmp-group-name ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1723 (?g (gnus-short-group-name gnus-tmp-group-name) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1724 (?p (gnus-group-real-name gnus-tmp-group-name) ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1725 (?A gnus-tmp-article-number ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1726 (?Z gnus-tmp-unread-and-unselected ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1727 (?V gnus-version ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1728 (?U gnus-tmp-unread-and-unticked ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1729 (?S gnus-tmp-subject ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1730 (?e gnus-tmp-unselected ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1731 (?u gnus-tmp-user-defined ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1732 (?d (length gnus-newsgroup-dormant) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1733 (?t (length gnus-newsgroup-marked) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1734 (?r (length gnus-newsgroup-reads) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1735 (?E gnus-newsgroup-expunged-tally ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1736 (?s (gnus-current-score-file-nondirectory) ?s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1737
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1738 (defvar gnus-article-mode-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1739 gnus-summary-mode-line-format-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1740
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1741 (defvar gnus-group-mode-line-format-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1742 `((?S gnus-tmp-news-server ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1743 (?M gnus-tmp-news-method ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1744 (?u gnus-tmp-user-defined ?s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1745 (?: gnus-tmp-colon ?s)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1746
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1747 (defvar gnus-have-read-active-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1748
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1749 (defconst gnus-maintainer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1750 "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1751 "The mail address of the Gnus maintainers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1752
15558
18364c2808f7 Wrong version number.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15557
diff changeset
1753 (defconst gnus-version-number "5.3"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1754 "Version number for this version of Gnus.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1755
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1756 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1757 "Version string for this version of Gnus.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1758
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1759 (defvar gnus-info-nodes
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1760 '((gnus-group-mode "(gnus)The Group Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1761 (gnus-summary-mode "(gnus)The Summary Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1762 (gnus-article-mode "(gnus)The Article Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1763 (gnus-server-mode "(gnus)The Server Buffer")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1764 (gnus-browse-mode "(gnus)Browse Foreign Server")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1765 (gnus-tree-mode "(gnus)Tree Display")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1766 )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1767 "Alist of major modes and related Info nodes.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1768
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1769 (defvar gnus-group-buffer "*Group*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1770 (defvar gnus-summary-buffer "*Summary*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1771 (defvar gnus-article-buffer "*Article*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1772 (defvar gnus-server-buffer "*Server*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1773
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1774 (defvar gnus-work-buffer " *gnus work*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1775
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1776 (defvar gnus-original-article-buffer " *Original Article*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1777 (defvar gnus-original-article nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1778
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1779 (defvar gnus-buffer-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1780 "Gnus buffers that should be killed on exit.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1781
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1782 (defvar gnus-slave nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1783 "Whether this Gnus is a slave or not.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1784
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1785 (defvar gnus-variable-list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1786 '(gnus-newsrc-options gnus-newsrc-options-n
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1787 gnus-newsrc-last-checked-date
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1788 gnus-newsrc-alist gnus-server-alist
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1789 gnus-killed-list gnus-zombie-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1790 gnus-topic-topology gnus-topic-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1791 gnus-format-specs)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1792 "Gnus variables saved in the quick startup file.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1793
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1794 (defvar gnus-newsrc-options nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1795 "Options line in the .newsrc file.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1796
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1797 (defvar gnus-newsrc-options-n nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1798 "List of regexps representing groups to be subscribed/ignored unconditionally.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1799
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1800 (defvar gnus-newsrc-last-checked-date nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1801 "Date Gnus last asked server for new newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1802
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1803 (defvar gnus-topic-topology nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1804 "The complete topic hierarchy.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1805
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1806 (defvar gnus-topic-alist nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1807 "The complete topic-group alist.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1808
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1809 (defvar gnus-newsrc-alist nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1810 "Assoc list of read articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1811 gnus-newsrc-hashtb should be kept so that both hold the same information.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1812
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1813 (defvar gnus-newsrc-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1814 "Hashtable of gnus-newsrc-alist.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1815
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1816 (defvar gnus-killed-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1817 "List of killed newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1818
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1819 (defvar gnus-killed-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1820 "Hash table equivalent of gnus-killed-list.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1821
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1822 (defvar gnus-zombie-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1823 "List of almost dead newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1824
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1825 (defvar gnus-description-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1826 "Descriptions of newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1827
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1828 (defvar gnus-list-of-killed-groups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1829 "List of newsgroups that have recently been killed by the user.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1830
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1831 (defvar gnus-active-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1832 "Hashtable of active articles.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1833
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1834 (defvar gnus-moderated-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1835 "List of moderated newsgroups.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1836
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1837 (defvar gnus-group-marked nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1838
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1839 (defvar gnus-current-startup-file nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1840 "Startup file for the current host.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1841
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1842 (defvar gnus-last-search-regexp nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1843 "Default regexp for article search command.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1844
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1845 (defvar gnus-last-shell-command nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1846 "Default shell command on article.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1847
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1848 (defvar gnus-current-select-method nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1849 "The current method for selecting a newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1850
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1851 (defvar gnus-group-list-mode nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1852
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1853 (defvar gnus-article-internal-prepare-hook nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1854
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1855 (defvar gnus-newsgroup-name nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1856 (defvar gnus-newsgroup-begin nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1857 (defvar gnus-newsgroup-end nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1858 (defvar gnus-newsgroup-last-rmail nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1859 (defvar gnus-newsgroup-last-mail nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1860 (defvar gnus-newsgroup-last-folder nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1861 (defvar gnus-newsgroup-last-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1862 (defvar gnus-newsgroup-auto-expire nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1863 (defvar gnus-newsgroup-active nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1864
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1865 (defvar gnus-newsgroup-data nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1866 (defvar gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1867 (defvar gnus-newsgroup-limit nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1868 (defvar gnus-newsgroup-limits nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1869
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1870 (defvar gnus-newsgroup-unreads nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1871 "List of unread articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1872
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1873 (defvar gnus-newsgroup-unselected nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1874 "List of unselected unread articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1875
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1876 (defvar gnus-newsgroup-reads nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1877 "Alist of read articles and article marks in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1878
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1879 (defvar gnus-newsgroup-expunged-tally nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1880
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1881 (defvar gnus-newsgroup-marked nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1882 "List of ticked articles in the current newsgroup (a subset of unread art).")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1883
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1884 (defvar gnus-newsgroup-killed nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1885 "List of ranges of articles that have been through the scoring process.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1886
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1887 (defvar gnus-newsgroup-cached nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1888 "List of articles that come from the article cache.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1889
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1890 (defvar gnus-newsgroup-saved nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1891 "List of articles that have been saved.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1892
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1893 (defvar gnus-newsgroup-kill-headers nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1894
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1895 (defvar gnus-newsgroup-replied nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1896 "List of articles that have been replied to in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1897
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1898 (defvar gnus-newsgroup-expirable nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1899 "List of articles in the current newsgroup that can be expired.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1900
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1901 (defvar gnus-newsgroup-processable nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1902 "List of articles in the current newsgroup that can be processed.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1903
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1904 (defvar gnus-newsgroup-bookmarks nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1905 "List of articles in the current newsgroup that have bookmarks.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1906
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1907 (defvar gnus-newsgroup-dormant nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1908 "List of dormant articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1909
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1910 (defvar gnus-newsgroup-scored nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1911 "List of scored articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1912
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1913 (defvar gnus-newsgroup-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1914 "List of article headers in the current newsgroup.")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1915
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1916 (defvar gnus-newsgroup-threads nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1917
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1918 (defvar gnus-newsgroup-prepared nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1919 "Whether the current group has been prepared properly.")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1920
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1921 (defvar gnus-newsgroup-ancient nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1922 "List of `gnus-fetch-old-headers' articles in the current newsgroup.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1923
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1924 (defvar gnus-newsgroup-sparse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1925
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1926 (defvar gnus-current-article nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1927 (defvar gnus-article-current nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1928 (defvar gnus-current-headers nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1929 (defvar gnus-have-all-headers nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1930 (defvar gnus-last-article nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1931 (defvar gnus-newsgroup-history nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1932 (defvar gnus-current-kill-article nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1933
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1934 ;; Save window configuration.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1935 (defvar gnus-prev-winconf nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1936
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1937 (defvar gnus-summary-mark-positions nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1938 (defvar gnus-group-mark-positions nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1939
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1940 (defvar gnus-reffed-article-number nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1941
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1942 ;;; Let the byte-compiler know that we know about this variable.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1943 (defvar rmail-default-rmail-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1944
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
1945 (defvar gnus-cache-removable-articles nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1946
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1947 (defvar gnus-dead-summary nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1948
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1949 (defconst gnus-summary-local-variables
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1950 '(gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1951 gnus-newsgroup-begin gnus-newsgroup-end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1952 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1953 gnus-newsgroup-last-folder gnus-newsgroup-last-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1954 gnus-newsgroup-auto-expire gnus-newsgroup-unreads
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1955 gnus-newsgroup-unselected gnus-newsgroup-marked
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1956 gnus-newsgroup-reads gnus-newsgroup-saved
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1957 gnus-newsgroup-replied gnus-newsgroup-expirable
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1958 gnus-newsgroup-processable gnus-newsgroup-killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1959 gnus-newsgroup-bookmarks gnus-newsgroup-dormant
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1960 gnus-newsgroup-headers gnus-newsgroup-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1961 gnus-newsgroup-prepared gnus-summary-highlight-line-function
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1962 gnus-current-article gnus-current-headers gnus-have-all-headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1963 gnus-last-article gnus-article-internal-prepare-hook
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1964 gnus-newsgroup-dependencies gnus-newsgroup-selected-overlay
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1965 gnus-newsgroup-scored gnus-newsgroup-kill-headers
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1966 gnus-newsgroup-async gnus-thread-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1967 gnus-score-alist gnus-current-score-file gnus-summary-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1968 (gnus-summary-mark-below . global)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1969 gnus-newsgroup-active gnus-scores-exclude-files
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1970 gnus-newsgroup-history gnus-newsgroup-ancient
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1971 gnus-newsgroup-sparse
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1972 (gnus-newsgroup-adaptive . gnus-use-adaptive-scoring)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1973 gnus-newsgroup-adaptive-score-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1974 (gnus-newsgroup-expunged-tally . 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1975 gnus-cache-removable-articles gnus-newsgroup-cached
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1976 gnus-newsgroup-data gnus-newsgroup-data-reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1977 gnus-newsgroup-limit gnus-newsgroup-limits)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1978 "Variables that are buffer-local to the summary buffers.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1979
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1980 (defconst gnus-bug-message
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1981 "Sending a bug report to the Gnus Towers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1982 ========================================
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1983
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1984 The buffer below is a mail buffer. When you press `C-c C-c', it will
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1985 be sent to the Gnus Bug Exterminators.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1986
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1987 At the bottom of the buffer you'll see lots of variable settings.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1988 Please do not delete those. They will tell the Bug People what your
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1989 environment is, so that it will be easier to locate the bugs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1990
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1991 If you have found a bug that makes Emacs go \"beep\", set
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
1992 debug-on-error to t (`M-x set-variable RET debug-on-error RET t RET')
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1993 and include the backtrace in your bug report.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1994
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1995 Please describe the bug in annoying, painstaking detail.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1996
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1997 Thank you for your help in stamping out bugs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1998 ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
1999
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2000 ;;; End of variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2001
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2002 ;; Define some autoload functions Gnus might use.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2003 (eval-and-compile
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2004
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2005 ;; This little mapcar goes through the list below and marks the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2006 ;; symbols in question as autoloaded functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2007 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2008 (lambda (package)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2009 (let ((interactive (nth 1 (memq ':interactive package))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2010 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2011 (lambda (function)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2012 (let (keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2013 (when (consp function)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2014 (setq keymap (car (memq 'keymap function)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2015 (setq function (car function)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2016 (autoload function (car package) nil interactive keymap)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2017 (if (eq (nth 1 package) ':interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2018 (cdddr package)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2019 (cdr package)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2020 '(("metamail" metamail-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2021 ("info" Info-goto-node)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2022 ("hexl" hexl-hex-string-to-integer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2023 ("pp" pp pp-to-string pp-eval-expression)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2024 ("mail-extr" mail-extract-address-components)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2025 ("nnmail" nnmail-split-fancy nnmail-article-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2026 ("nnvirtual" nnvirtual-catchup-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2027 ("timezone" timezone-make-date-arpa-standard timezone-fix-time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2028 timezone-make-sortable-date timezone-make-time-string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2029 ("rmailout" rmail-output)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2030 ("rmail" rmail-insert-rmail-file-header rmail-count-new-messages
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2031 rmail-show-message)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2032 ("gnus-soup" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2033 gnus-group-brew-soup gnus-brew-soup gnus-soup-add-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2034 gnus-soup-send-replies gnus-soup-save-areas gnus-soup-pack-packet)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2035 ("nnsoup" nnsoup-pack-replies)
15577
e369d2f12bc7 Load `gnus-score-mode' from "score-mode".
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15558
diff changeset
2036 ("score-mode" :interactive t gnus-score-mode)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2037 ("gnus-mh" gnus-mh-mail-setup gnus-summary-save-article-folder
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2038 gnus-Folder-save-name gnus-folder-save-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2039 ("gnus-mh" :interactive t gnus-summary-save-in-folder)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2040 ("gnus-vis" gnus-group-make-menu-bar gnus-summary-make-menu-bar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2041 gnus-server-make-menu-bar gnus-article-make-menu-bar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2042 gnus-browse-make-menu-bar gnus-highlight-selected-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2043 gnus-summary-highlight-line gnus-carpal-setup-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2044 gnus-group-highlight-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2045 gnus-article-add-button gnus-insert-next-page-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2046 gnus-insert-prev-page-button gnus-visual-turn-off-edit-menu)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2047 ("gnus-vis" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2048 gnus-article-push-button gnus-article-press-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2049 gnus-article-highlight gnus-article-highlight-some
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2050 gnus-article-highlight-headers gnus-article-highlight-signature
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2051 gnus-article-add-buttons gnus-article-add-buttons-to-head
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2052 gnus-article-next-button gnus-article-prev-button)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2053 ("gnus-demon" gnus-demon-add-nocem gnus-demon-add-scanmail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2054 gnus-demon-add-disconnection gnus-demon-add-handler
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2055 gnus-demon-remove-handler)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2056 ("gnus-demon" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2057 gnus-demon-init gnus-demon-cancel)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2058 ("gnus-salt" gnus-highlight-selected-tree gnus-possibly-generate-tree
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2059 gnus-tree-open gnus-tree-close)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2060 ("gnus-nocem" gnus-nocem-scan-groups gnus-nocem-close
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2061 gnus-nocem-unwanted-article-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2062 ("gnus-srvr" gnus-enter-server-buffer gnus-server-set-info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2063 ("gnus-srvr" gnus-browse-foreign-server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2064 ("gnus-cite" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2065 gnus-article-highlight-citation gnus-article-hide-citation-maybe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2066 gnus-article-hide-citation gnus-article-fill-cited-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2067 gnus-article-hide-citation-in-followups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2068 ("gnus-kill" gnus-kill gnus-apply-kill-file-internal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2069 gnus-kill-file-edit-file gnus-kill-file-raise-followups-to-author
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2070 gnus-execute gnus-expunge)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2071 ("gnus-cache" gnus-cache-possibly-enter-article gnus-cache-save-buffers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2072 gnus-cache-possibly-remove-articles gnus-cache-request-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2073 gnus-cache-retrieve-headers gnus-cache-possibly-alter-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2074 gnus-cache-enter-remove-article gnus-cached-article-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2075 gnus-cache-open gnus-cache-close gnus-cache-update-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2076 ("gnus-cache" :interactive t gnus-jog-cache gnus-cache-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2077 gnus-cache-remove-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2078 ("gnus-score" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2079 gnus-summary-increase-score gnus-summary-lower-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2080 gnus-score-flush-cache gnus-score-close
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2081 gnus-score-raise-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2082 gnus-score-raise-same-subject gnus-score-default
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2083 gnus-score-raise-thread gnus-score-lower-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2084 gnus-score-lower-same-subject gnus-score-lower-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2085 gnus-possibly-score-headers gnus-summary-raise-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2086 gnus-summary-set-score gnus-summary-current-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2087 ("gnus-score"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2088 (gnus-summary-score-map keymap) gnus-score-save gnus-score-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2089 gnus-current-score-file-nondirectory gnus-score-adaptive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2090 gnus-score-find-trace gnus-score-file-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2091 ("gnus-edit" :interactive t gnus-score-customize)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2092 ("gnus-topic" :interactive t gnus-topic-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2093 ("gnus-topic" gnus-topic-remove-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2094 ("gnus-salt" :interactive t gnus-pick-mode gnus-binary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2095 ("gnus-uu" (gnus-uu-extract-map keymap) (gnus-uu-mark-map keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2096 ("gnus-uu" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2097 gnus-uu-digest-mail-forward gnus-uu-digest-post-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2098 gnus-uu-mark-series gnus-uu-mark-region gnus-uu-mark-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2099 gnus-uu-mark-by-regexp gnus-uu-mark-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2100 gnus-uu-mark-sparse gnus-uu-mark-thread gnus-uu-decode-uu
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2101 gnus-uu-decode-uu-and-save gnus-uu-decode-unshar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2102 gnus-uu-decode-unshar-and-save gnus-uu-decode-save
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2103 gnus-uu-decode-binhex gnus-uu-decode-uu-view
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2104 gnus-uu-decode-uu-and-save-view gnus-uu-decode-unshar-view
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2105 gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2106 gnus-uu-decode-binhex-view)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2107 ("gnus-msg" (gnus-summary-send-map keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2108 gnus-mail-yank-original gnus-mail-send-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2109 gnus-article-mail gnus-new-mail gnus-mail-reply)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2110 ("gnus-msg" :interactive t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2111 gnus-group-post-news gnus-group-mail gnus-summary-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2112 gnus-summary-followup gnus-summary-followup-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2113 gnus-summary-cancel-article gnus-summary-supersede-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2114 gnus-post-news gnus-inews-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2115 gnus-summary-reply gnus-summary-reply-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2116 gnus-summary-mail-forward gnus-summary-mail-other-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2117 gnus-bug)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2118 ("gnus-picon" :interactive t gnus-article-display-picons
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
2119 gnus-group-display-picons gnus-picons-article-display-x-face
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
2120 gnus-picons-display-x-face)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2121 ("gnus-gl" bbb-login bbb-logout bbb-grouplens-group-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2122 gnus-grouplens-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2123 ("smiley" :interactive t gnus-smiley-display)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2124 ("gnus-vm" gnus-vm-mail-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2125 ("gnus-vm" :interactive t gnus-summary-save-in-vm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2126 gnus-summary-save-article-vm))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2127
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2128
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2129
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2130 ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2131 ;; If you want the cursor to go somewhere else, set these two
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2132 ;; functions in some startup hook to whatever you want.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2133 (defalias 'gnus-summary-position-point 'gnus-goto-colon)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2134 (defalias 'gnus-group-position-point 'gnus-goto-colon)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2135
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2136 ;;; Various macros and substs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2137
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2138 (defun gnus-header-from (header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2139 (mail-header-from header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2140
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2141 (defmacro gnus-eval-in-buffer-window (buffer &rest forms)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2142 "Pop to BUFFER, evaluate FORMS, and then return to the original window."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2143 (let ((tempvar (make-symbol "GnusStartBufferWindow"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2144 (w (make-symbol "w"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2145 (buf (make-symbol "buf")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2146 `(let* ((,tempvar (selected-window))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2147 (,buf ,buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2148 (,w (get-buffer-window ,buf 'visible)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2149 (unwind-protect
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2150 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2151 (if ,w
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2152 (select-window ,w)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2153 (pop-to-buffer ,buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2154 ,@forms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2155 (select-window ,tempvar)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2156
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2157 (put 'gnus-eval-in-buffer-window 'lisp-indent-function 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2158 (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2159 (put 'gnus-eval-in-buffer-window 'edebug-form-spec '(form body))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2160
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2161 (defmacro gnus-gethash (string hashtable)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2162 "Get hash value of STRING in HASHTABLE."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2163 `(symbol-value (intern-soft ,string ,hashtable)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2164
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2165 (defmacro gnus-sethash (string value hashtable)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2166 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2167 `(set (intern ,string ,hashtable) ,value))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2168
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2169 (defmacro gnus-intern-safe (string hashtable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2170 "Set hash value. Arguments are STRING, VALUE, and HASHTABLE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2171 `(let ((symbol (intern ,string ,hashtable)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2172 (or (boundp symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2173 (set symbol nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2174 symbol))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2175
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2176 (defmacro gnus-group-unread (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2177 "Get the currently computed number of unread articles in GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2178 `(car (gnus-gethash ,group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2179
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2180 (defmacro gnus-group-entry (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2181 "Get the newsrc entry for GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2182 `(gnus-gethash ,group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2183
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2184 (defmacro gnus-active (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2185 "Get active info on GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2186 `(gnus-gethash ,group gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2187
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2188 (defmacro gnus-set-active (group active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2189 "Set GROUP's active info."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2190 `(gnus-sethash ,group ,active gnus-active-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2191
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2192 ;; modified by MORIOKA Tomohiko <morioka@jaist.ac.jp>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2193 ;; function `substring' might cut on a middle of multi-octet
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2194 ;; character.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2195 (defun gnus-truncate-string (str width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2196 (substring str 0 width))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2197
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2198 ;; Added by Geoffrey T. Dairiki <dairiki@u.washington.edu>. A safe way
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2199 ;; to limit the length of a string. This function is necessary since
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2200 ;; `(substr "abc" 0 30)' pukes with "Args out of range".
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2201 (defsubst gnus-limit-string (str width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2202 (if (> (length str) width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2203 (substring str 0 width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2204 str))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2205
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2206 (defsubst gnus-simplify-subject-re (subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2207 "Remove \"Re:\" from subject lines."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2208 (if (string-match "^[Rr][Ee]: *" subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2209 (substring subject (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2210 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2211
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2212 (defsubst gnus-functionp (form)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2213 "Return non-nil if FORM is funcallable."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2214 (or (and (symbolp form) (fboundp form))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2215 (and (listp form) (eq (car form) 'lambda))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2216
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2217 (defsubst gnus-goto-char (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2218 (and point (goto-char point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2219
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2220 (defmacro gnus-buffer-exists-p (buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2221 `(let ((buffer ,buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2222 (and buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2223 (funcall (if (stringp buffer) 'get-buffer 'buffer-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2224 buffer))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2225
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2226 (defmacro gnus-kill-buffer (buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2227 `(let ((buf ,buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2228 (if (gnus-buffer-exists-p buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2229 (kill-buffer buf))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2230
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2231 (defsubst gnus-point-at-bol ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2232 "Return point at the beginning of the line."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2233 (let ((p (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2234 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2235 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2236 (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2237 (goto-char p))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2238
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2239 (defsubst gnus-point-at-eol ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2240 "Return point at the end of the line."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2241 (let ((p (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2242 (end-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2243 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2244 (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2245 (goto-char p))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2246
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2247 (defun gnus-alive-p ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2248 "Say whether Gnus is running or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2249 (and gnus-group-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2250 (get-buffer gnus-group-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2251
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2252 (defun gnus-delete-first (elt list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2253 "Delete by side effect the first occurrence of ELT as a member of LIST."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2254 (if (equal (car list) elt)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2255 (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2256 (let ((total list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2257 (while (and (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2258 (not (equal (cadr list) elt)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2259 (setq list (cdr list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2260 (when (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2261 (setcdr list (cddr list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2262 total)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2263
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2264 ;; Delete the current line (and the next N lines.);
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2265 (defmacro gnus-delete-line (&optional n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2266 `(delete-region (progn (beginning-of-line) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2267 (progn (forward-line ,(or n 1)) (point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2268
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2269 ;; Suggested by Brian Edmonds <edmonds@cs.ubc.ca>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2270 (defvar gnus-init-inhibit nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2271 (defun gnus-read-init-file (&optional inhibit-next)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2272 (if gnus-init-inhibit
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2273 (setq gnus-init-inhibit nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2274 (setq gnus-init-inhibit inhibit-next)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2275 (and gnus-init-file
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2276 (or (and (file-exists-p gnus-init-file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2277 ;; Don't try to load a directory.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2278 (not (file-directory-p gnus-init-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2279 (file-exists-p (concat gnus-init-file ".el"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2280 (file-exists-p (concat gnus-init-file ".elc")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2281 (condition-case var
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2282 (load gnus-init-file nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2283 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2284 (error "Error in %s: %s" gnus-init-file var))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2285
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2286 ;; Info access macros.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2287
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2288 (defmacro gnus-info-group (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2289 `(nth 0 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2290 (defmacro gnus-info-rank (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2291 `(nth 1 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2292 (defmacro gnus-info-read (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2293 `(nth 2 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2294 (defmacro gnus-info-marks (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2295 `(nth 3 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2296 (defmacro gnus-info-method (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2297 `(nth 4 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2298 (defmacro gnus-info-params (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2299 `(nth 5 ,info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2300
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2301 (defmacro gnus-info-level (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2302 `(let ((rank (gnus-info-rank ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2303 (if (consp rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2304 (car rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2305 rank)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2306 (defmacro gnus-info-score (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2307 `(let ((rank (gnus-info-rank ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2308 (or (and (consp rank) (cdr rank)) 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2309
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2310 (defmacro gnus-info-set-group (info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2311 `(setcar ,info ,group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2312 (defmacro gnus-info-set-rank (info rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2313 `(setcar (nthcdr 1 ,info) ,rank))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2314 (defmacro gnus-info-set-read (info read)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2315 `(setcar (nthcdr 2 ,info) ,read))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2316 (defmacro gnus-info-set-marks (info marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2317 `(setcar (nthcdr 3 ,info) ,marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2318 (defmacro gnus-info-set-method (info method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2319 `(setcar (nthcdr 4 ,info) ,method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2320 (defmacro gnus-info-set-params (info params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2321 `(setcar (nthcdr 5 ,info) ,params))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2322
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2323 (defmacro gnus-info-set-level (info level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2324 `(let ((rank (cdr ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2325 (if (consp (car rank))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2326 (setcar (car rank) ,level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2327 (setcar rank ,level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2328 (defmacro gnus-info-set-score (info score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2329 `(let ((rank (cdr ,info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2330 (if (consp (car rank))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2331 (setcdr (car rank) ,score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2332 (setcar rank (cons (car rank) ,score)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2333
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2334 (defmacro gnus-get-info (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2335 `(nth 2 (gnus-gethash ,group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2336
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2337 (defun gnus-byte-code (func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2338 "Return a form that can be `eval'ed based on FUNC."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2339 (let ((fval (symbol-function func)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2340 (if (byte-code-function-p fval)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2341 (let ((flist (append fval nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2342 (setcar flist 'byte-code)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2343 flist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2344 (cons 'progn (cddr fval)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2345
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2346 ;; Find out whether the gnus-visual TYPE is wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2347 (defun gnus-visual-p (&optional type class)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2348 (and gnus-visual ; Has to be non-nil, at least.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2349 (if (not type) ; We don't care about type.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2350 gnus-visual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2351 (if (listp gnus-visual) ; It's a list, so we check it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2352 (or (memq type gnus-visual)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2353 (memq class gnus-visual))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2354 t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2355
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2356 ;;; Load the compatability functions.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2357
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2358 (require 'gnus-cus)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2359 (require 'gnus-ems)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2360
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2361
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2362 ;;;
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2363 ;;; Shutdown
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2364 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2365
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2366 (defvar gnus-shutdown-alist nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2367
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2368 (defun gnus-add-shutdown (function &rest symbols)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2369 "Run FUNCTION whenever one of SYMBOLS is shut down."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2370 (push (cons function symbols) gnus-shutdown-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2371
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2372 (defun gnus-shutdown (symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2373 "Shut down everything that waits for SYMBOL."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2374 (let ((alist gnus-shutdown-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2375 entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2376 (while (setq entry (pop alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2377 (when (memq symbol (cdr entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2378 (funcall (car entry))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2379
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2380
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2381
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2382 ;; Format specs. The chunks below are the machine-generated forms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2383 ;; that are to be evaled as the result of the default format strings.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2384 ;; We write them in here to get them byte-compiled. That way the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2385 ;; default actions will be quite fast, while still retaining the full
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2386 ;; flexibility of the user-defined format specs.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2387
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2388 ;; First we have lots of dummy defvars to let the compiler know these
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2389 ;; are really dynamic variables.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2390
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2391 (defvar gnus-tmp-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2392 (defvar gnus-tmp-replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2393 (defvar gnus-tmp-score-char)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2394 (defvar gnus-tmp-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2395 (defvar gnus-tmp-opening-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2396 (defvar gnus-tmp-lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2397 (defvar gnus-tmp-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2398 (defvar gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2399 (defvar gnus-tmp-subject-or-nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2400 (defvar gnus-tmp-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2401 (defvar gnus-tmp-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2402 (defvar gnus-tmp-marked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2403 (defvar gnus-tmp-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2404 (defvar gnus-tmp-process-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2405 (defvar gnus-tmp-number-of-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2406 (defvar gnus-tmp-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2407 (defvar gnus-tmp-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2408 (defvar gnus-tmp-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2409 (defvar gnus-tmp-unread-and-unselected)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2410 (defvar gnus-tmp-news-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2411 (defvar gnus-tmp-news-server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2412 (defvar gnus-tmp-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2413 (defvar gnus-mouse-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2414 (defvar gnus-mouse-face-prop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2415
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2416 (defun gnus-summary-line-format-spec ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2417 (insert gnus-tmp-unread gnus-tmp-replied
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2418 gnus-tmp-score-char gnus-tmp-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2419 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2420 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2421 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2422 (insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2423 gnus-tmp-opening-bracket
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2424 (format "%4d: %-20s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2425 gnus-tmp-lines
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2426 (if (> (length gnus-tmp-name) 20)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2427 (substring gnus-tmp-name 0 20)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2428 gnus-tmp-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2429 gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2430 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2431 gnus-mouse-face-prop gnus-mouse-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2432 (insert " " gnus-tmp-subject-or-nil "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2433
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2434 (defvar gnus-summary-line-format-spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2435 (gnus-byte-code 'gnus-summary-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2436
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2437 (defun gnus-summary-dummy-line-format-spec ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2438 (insert "* ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2439 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2440 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2441 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2442 (insert ": :")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2443 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2444 gnus-mouse-face-prop gnus-mouse-face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2445 (insert " " gnus-tmp-subject "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2446
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2447 (defvar gnus-summary-dummy-line-format-spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2448 (gnus-byte-code 'gnus-summary-dummy-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2449
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2450 (defun gnus-group-line-format-spec ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2451 (insert gnus-tmp-marked-mark gnus-tmp-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2452 gnus-tmp-process-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2453 gnus-group-indentation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2454 (format "%5s: " gnus-tmp-number-of-unread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2455 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2456 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2457 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2458 (insert gnus-tmp-group "\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2459 (1- (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2460 gnus-mouse-face-prop gnus-mouse-face))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2461 (defvar gnus-group-line-format-spec
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2462 (gnus-byte-code 'gnus-group-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2463
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2464 (defvar gnus-format-specs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2465 `((version . ,emacs-version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2466 (group ,gnus-group-line-format ,gnus-group-line-format-spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2467 (summary-dummy ,gnus-summary-dummy-line-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2468 ,gnus-summary-dummy-line-format-spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2469 (summary ,gnus-summary-line-format ,gnus-summary-line-format-spec)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2470
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2471 (defvar gnus-article-mode-line-format-spec nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2472 (defvar gnus-summary-mode-line-format-spec nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2473 (defvar gnus-group-mode-line-format-spec nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2474
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2475 ;;; Phew. All that gruft is over, fortunately.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2476
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2477
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2478 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2479 ;;; Gnus Utility Functions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2480 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2481
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2482 (defun gnus-extract-address-components (from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2483 (let (name address)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2484 ;; First find the address - the thing with the @ in it. This may
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2485 ;; not be accurate in mail addresses, but does the trick most of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2486 ;; the time in news messages.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2487 (if (string-match "\\b[^@ \t<>]+[!@][^@ \t<>]+\\b" from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2488 (setq address (substring from (match-beginning 0) (match-end 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2489 ;; Then we check whether the "name <address>" format is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2490 (and address
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2491 ;; Fix by MORIOKA Tomohiko <morioka@jaist.ac.jp>
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2492 ;; Linear white space is not required.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2493 (string-match (concat "[ \t]*<" (regexp-quote address) ">") from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2494 (and (setq name (substring from 0 (match-beginning 0)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2495 ;; Strip any quotes from the name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2496 (string-match "\".*\"" name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2497 (setq name (substring name 1 (1- (match-end 0))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2498 ;; If not, then "address (name)" is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2499 (or name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2500 (and (string-match "(.+)" from)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2501 (setq name (substring from (1+ (match-beginning 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2502 (1- (match-end 0)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2503 (and (string-match "()" from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2504 (setq name address))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2505 ;; Fix by MORIOKA Tomohiko <morioka@jaist.ac.jp>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2506 ;; XOVER might not support folded From headers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2507 (and (string-match "(.*" from)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2508 (setq name (substring from (1+ (match-beginning 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2509 (match-end 0)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2510 ;; Fix by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2511 (list (or name from) (or address from))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2512
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2513 (defun gnus-fetch-field (field)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2514 "Return the value of the header FIELD of current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2515 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2516 (save-restriction
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2517 (let ((case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2518 (inhibit-point-motion-hooks t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2519 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2520 (message-fetch-field field)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2521
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2522 (defun gnus-goto-colon ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2523 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2524 (search-forward ":" (gnus-point-at-eol) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2525
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2526 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2527 (defun gnus-update-format (var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2528 "Update the format specification near point."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2529 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2530 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2531 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2532 (eval-defun nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2533 ;; Find the end of the current word.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2534 (re-search-forward "[ \t\n]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2535 ;; Search backward.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2536 (when (re-search-backward "\\(gnus-[-a-z]+-line-format\\)" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2537 (match-string 1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2538 (let* ((type (intern (progn (string-match "gnus-\\([-a-z]+\\)-line" var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2539 (match-string 1 var))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2540 (entry (assq type gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2541 value spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2542 (when entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2543 (setq gnus-format-specs (delq entry gnus-format-specs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2544 (set
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2545 (intern (format "%s-spec" var))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2546 (gnus-parse-format (setq value (symbol-value (intern var)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2547 (symbol-value (intern (format "%s-alist" var)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2548 (not (string-match "mode" var))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2549 (setq spec (symbol-value (intern (format "%s-spec" var))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2550 (push (list type value spec) gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2551
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2552 (pop-to-buffer "*Gnus Format*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2553 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2554 (lisp-interaction-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2555 (insert (pp-to-string spec))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2556
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2557 (defun gnus-update-format-specifications (&optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2558 "Update all (necessary) format specifications."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2559 ;; Make the indentation array.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2560 (gnus-make-thread-indent-array)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2561
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2562 ;; See whether all the stored info needs to be flushed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2563 (when (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2564 (not (equal emacs-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2565 (cdr (assq 'version gnus-format-specs)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2566 (setq gnus-format-specs nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2567
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2568 ;; Go through all the formats and see whether they need updating.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2569 (let ((types '(summary summary-dummy group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2570 summary-mode group-mode article-mode))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2571 new-format entry type val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2572 (while (setq type (pop types))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2573 ;; Jump to the proper buffer to find out the value of
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2574 ;; the variable, if possible. (It may be buffer-local.)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2575 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2576 (let ((buffer (intern (format "gnus-%s-buffer" type)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2577 val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2578 (when (and (boundp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2579 (setq val (symbol-value buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2580 (get-buffer val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2581 (buffer-name (get-buffer val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2582 (set-buffer (get-buffer val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2583 (setq new-format (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2584 (intern (format "gnus-%s-line-format" type))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2585 (setq entry (cdr (assq type gnus-format-specs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2586 (if (and entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2587 (equal (car entry) new-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2588 ;; Use the old format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2589 (set (intern (format "gnus-%s-line-format-spec" type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2590 (cadr entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2591 ;; This is a new format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2592 (setq val
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2593 (if (not (stringp new-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2594 ;; This is a function call or something.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2595 new-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2596 ;; This is a "real" format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2597 (gnus-parse-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2598 new-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2599 (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2600 (intern (format "gnus-%s-line-format-alist"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2601 (if (eq type 'article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2602 'summary-mode type))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2603 (not (string-match "mode$" (symbol-name type))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2604 ;; Enter the new format spec into the list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2605 (if entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2606 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2607 (setcar (cdr entry) val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2608 (setcar entry new-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2609 (push (list type new-format val) gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2610 (set (intern (format "gnus-%s-line-format-spec" type)) val))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2611
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2612 (unless (assq 'version gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2613 (push (cons 'version emacs-version) gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2614
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2615 (gnus-update-group-mark-positions)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2616 (gnus-update-summary-mark-positions))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2617
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2618 (defun gnus-update-summary-mark-positions ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2619 "Compute where the summary marks are to go."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2620 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2621 (when (and gnus-summary-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2622 (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2623 (buffer-name (get-buffer gnus-summary-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2624 (set-buffer gnus-summary-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2625 (let ((gnus-replied-mark 129)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2626 (gnus-score-below-mark 130)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2627 (gnus-score-over-mark 130)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2628 (thread nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2629 (gnus-visual nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2630 (spec gnus-summary-line-format-spec)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2631 pos)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2632 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2633 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2634 (let ((gnus-summary-line-format-spec spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2635 (gnus-summary-insert-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2636 [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2637 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2638 (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2639 (- (point) 2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2640 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2641 (push (cons 'replied (and (search-forward "\201" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2642 (- (point) 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2643 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2644 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2645 (push (cons 'score (and (search-forward "\202" nil t) (- (point) 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2646 pos)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2647 (setq gnus-summary-mark-positions pos))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2648
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2649 (defun gnus-update-group-mark-positions ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2650 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2651 (let ((gnus-process-mark 128)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2652 (gnus-group-marked '("dummy.group"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2653 (gnus-active-hashtb (make-vector 10 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2654 (gnus-set-active "dummy.group" '(0 . 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2655 (gnus-set-work-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2656 (gnus-group-insert-group-line "dummy.group" 0 nil 0 nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2657 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2658 (setq gnus-group-mark-positions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2659 (list (cons 'process (and (search-forward "\200" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2660 (- (point) 2))))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2661
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2662 (defvar gnus-mouse-face-0 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2663 (defvar gnus-mouse-face-1 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2664 (defvar gnus-mouse-face-2 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2665 (defvar gnus-mouse-face-3 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2666 (defvar gnus-mouse-face-4 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2667
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2668 (defun gnus-mouse-face-function (form type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2669 `(gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2670 (point) (progn ,@form (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2671 gnus-mouse-face-prop
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2672 ,(if (equal type 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2673 'gnus-mouse-face
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2674 `(quote ,(symbol-value (intern (format "gnus-mouse-face-%d" type)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2675
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2676 (defvar gnus-face-0 'bold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2677 (defvar gnus-face-1 'italic)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2678 (defvar gnus-face-2 'bold-italic)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2679 (defvar gnus-face-3 'bold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2680 (defvar gnus-face-4 'bold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2681
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2682 (defun gnus-face-face-function (form type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2683 `(gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2684 (point) (progn ,@form (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2685 'face ',(symbol-value (intern (format "gnus-face-%d" type)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2686
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2687 (defun gnus-max-width-function (el max-width)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2688 (or (numberp max-width) (signal 'wrong-type-argument '(numberp max-width)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2689 (if (symbolp el)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2690 `(if (> (length ,el) ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2691 (substring ,el 0 ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2692 ,el)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2693 `(let ((val (eval ,el)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2694 (if (numberp val)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2695 (setq val (int-to-string val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2696 (if (> (length val) ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2697 (substring val 0 ,max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2698 val))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2699
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2700 (defun gnus-parse-format (format spec-alist &optional insert)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2701 ;; This function parses the FORMAT string with the help of the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2702 ;; SPEC-ALIST and returns a list that can be eval'ed to return the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2703 ;; string. If the FORMAT string contains the specifiers %( and %)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2704 ;; the text between them will have the mouse-face text property.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2705 (if (string-match
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2706 "\\`\\(.*\\)%[0-9]?[{(]\\(.*\\)%[0-9]?[})]\\(.*\n?\\)\\'"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2707 format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2708 (gnus-parse-complex-format format spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2709 ;; This is a simple format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2710 (gnus-parse-simple-format format spec-alist insert)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2711
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2712 (defun gnus-parse-complex-format (format spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2713 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2714 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2715 (insert format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2716 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2717 (while (re-search-forward "\"" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2718 (replace-match "\\\"" nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2719 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2720 (insert "(\"")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2721 (while (re-search-forward "%\\([0-9]+\\)?\\([{}()]\\)" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2722 (let ((number (if (match-beginning 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2723 (match-string 1) "0"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2724 (delim (aref (match-string 2) 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2725 (if (or (= delim ?\() (= delim ?\{))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2726 (replace-match (concat "\"(" (if (= delim ?\() "mouse" "face")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2727 " " number " \""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2728 (replace-match "\")\""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2729 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2730 (insert "\")")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2731 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2732 (let ((form (read (current-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2733 (cons 'progn (gnus-complex-form-to-spec form spec-alist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2734
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2735 (defun gnus-complex-form-to-spec (form spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2736 (delq nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2737 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2738 (lambda (sform)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2739 (if (stringp sform)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2740 (gnus-parse-simple-format sform spec-alist t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2741 (funcall (intern (format "gnus-%s-face-function" (car sform)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2742 (gnus-complex-form-to-spec (cddr sform) spec-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2743 (nth 1 sform))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2744 form)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2745
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2746 (defun gnus-parse-simple-format (format spec-alist &optional insert)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2747 ;; This function parses the FORMAT string with the help of the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2748 ;; SPEC-ALIST and returns a list that can be eval'ed to return a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2749 ;; string.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2750 (let ((max-width 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2751 spec flist fstring newspec elem beg result dontinsert)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2752 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2753 (gnus-set-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2754 (insert format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2755 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2756 (while (re-search-forward "%[-0-9]*\\(,[0-9]+\\)?\\([^0-9]\\)\\(.\\)?"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2757 nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2758 (if (= (setq spec (string-to-char (match-string 2))) ?%)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2759 (setq newspec "%"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2760 beg (1+ (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2761 ;; First check if there are any specs that look anything like
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2762 ;; "%12,12A", ie. with a "max width specification". These have
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2763 ;; to be treated specially.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2764 (if (setq beg (match-beginning 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2765 (setq max-width
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2766 (string-to-int
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2767 (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2768 (1+ (match-beginning 1)) (match-end 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2769 (setq max-width 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2770 (setq beg (match-beginning 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2771 ;; Find the specification from `spec-alist'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2772 (unless (setq elem (cdr (assq spec spec-alist)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2773 (setq elem '("*" ?s)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2774 ;; Treat user defined format specifiers specially.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2775 (when (eq (car elem) 'gnus-tmp-user-defined)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2776 (setq elem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2777 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2778 (list (intern (concat "gnus-user-format-function-"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2779 (match-string 3)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2780 'gnus-tmp-header) ?s))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2781 (delete-region (match-beginning 3) (match-end 3)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2782 (if (not (zerop max-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2783 (let ((el (car elem)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2784 (cond ((= (cadr elem) ?c)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2785 (setq el (list 'char-to-string el)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2786 ((= (cadr elem) ?d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2787 (setq el (list 'int-to-string el))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2788 (setq flist (cons (gnus-max-width-function el max-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2789 flist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2790 (setq newspec ?s))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2791 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2792 (setq flist (cons (car elem) flist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2793 (setq newspec (cadr elem)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2794 ;; Remove the old specification (and possibly a ",12" string).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2795 (delete-region beg (match-end 2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2796 ;; Insert the new specification.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2797 (goto-char beg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2798 (insert newspec))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2799 (setq fstring (buffer-substring 1 (point-max))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2800 ;; Do some postprocessing to increase efficiency.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2801 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2802 result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2803 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2804 ;; Emptyness.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2805 ((string= fstring "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2806 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2807 ;; Not a format string.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2808 ((not (string-match "%" fstring))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2809 (list fstring))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2810 ;; A format string with just a single string spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2811 ((string= fstring "%s")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2812 (list (car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2813 ;; A single character.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2814 ((string= fstring "%c")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2815 (list (car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2816 ;; A single number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2817 ((string= fstring "%d")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2818 (setq dontinsert)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2819 (if insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2820 (list `(princ ,(car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2821 (list `(int-to-string ,(car flist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2822 ;; Just lots of chars and strings.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2823 ((string-match "\\`\\(%[cs]\\)+\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2824 (nreverse flist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2825 ;; A single string spec at the beginning of the spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2826 ((string-match "\\`%[sc][^%]+\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2827 (list (car flist) (substring fstring 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2828 ;; A single string spec in the middle of the spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2829 ((string-match "\\`\\([^%]+\\)%[sc]\\([^%]+\\)\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2830 (list (match-string 1 fstring) (car flist) (match-string 2 fstring)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2831 ;; A single string spec in the end of the spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2832 ((string-match "\\`\\([^%]+\\)%[sc]\\'" fstring)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2833 (list (match-string 1 fstring) (car flist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2834 ;; A more complex spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2835 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2836 (list (cons 'format (cons fstring (nreverse flist)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2837
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2838 (if insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2839 (when result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2840 (if dontinsert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2841 result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2842 (cons 'insert result)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2843 (cond ((stringp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2844 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2845 ((consp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2846 (cons 'concat result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2847 (t "")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2848
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2849 (defun gnus-eval-format (format &optional alist props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2850 "Eval the format variable FORMAT, using ALIST.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2851 If PROPS, insert the result."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2852 (let ((form (gnus-parse-format format alist props)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2853 (if props
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2854 (gnus-add-text-properties (point) (progn (eval form) (point)) props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2855 (eval form))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2856
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2857 (defun gnus-remove-text-with-property (prop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2858 "Delete all text in the current buffer with text property PROP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2859 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2860 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2861 (while (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2862 (while (get-text-property (point) prop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2863 (delete-char 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2864 (goto-char (next-single-property-change (point) prop nil (point-max))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2865
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2866 (defun gnus-set-work-buffer ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2867 (if (get-buffer gnus-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2868 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2869 (set-buffer gnus-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2870 (erase-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2871 (set-buffer (get-buffer-create gnus-work-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2872 (kill-all-local-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2873 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2874 (gnus-add-current-to-buffer-list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2875
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2876 ;; Article file names when saving.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2877
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2878 (defun gnus-Numeric-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2879 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2880 If variable `gnus-use-long-file-name' is nil, it is ~/News/News.group/num.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2881 Otherwise, it is like ~/News/news/group/num."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2882 (let ((default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2883 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2884 (concat (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2885 (gnus-capitalize-newsgroup newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2886 (gnus-newsgroup-directory-form newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2887 "/" (int-to-string (mail-header-number headers)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2888 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2889 (if (and last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2890 (string-equal (file-name-directory default)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2891 (file-name-directory last-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2892 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2893 default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2894 (or last-file default))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2895
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2896 (defun gnus-numeric-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2897 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2898 If variable `gnus-use-long-file-name' is non-nil, it is
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2899 ~/News/news.group/num. Otherwise, it is like ~/News/news/group/num."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2900 (let ((default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2901 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2902 (concat (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2903 newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2904 (gnus-newsgroup-directory-form newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2905 "/" (int-to-string (mail-header-number headers)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2906 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2907 (if (and last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2908 (string-equal (file-name-directory default)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2909 (file-name-directory last-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2910 (string-match "^[0-9]+$" (file-name-nondirectory last-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2911 default
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2912 (or last-file default))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2913
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2914 (defun gnus-Plain-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2915 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2916 If variable `gnus-use-long-file-name' is non-nil, it is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2917 ~/News/News.group. Otherwise, it is like ~/News/news/group/news."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2918 (or last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2919 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2920 (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2921 (gnus-capitalize-newsgroup newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2922 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2923 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2924
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2925 (defun gnus-plain-save-name (newsgroup headers &optional last-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2926 "Generate file name from NEWSGROUP, HEADERS, and optional LAST-FILE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2927 If variable `gnus-use-long-file-name' is non-nil, it is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2928 ~/News/news.group. Otherwise, it is like ~/News/news/group/news."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2929 (or last-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2930 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2931 (if (gnus-use-long-file-name 'not-save)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2932 newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2933 (concat (gnus-newsgroup-directory-form newsgroup) "/news"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2934 gnus-article-save-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2935
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2936 ;; For subscribing new newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2937
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2938 (defun gnus-subscribe-hierarchical-interactive (groups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2939 (let ((groups (sort groups 'string<))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2940 prefixes prefix start ans group starts)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2941 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2942 (setq prefixes (list "^"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2943 (while (and groups prefixes)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2944 (while (not (string-match (car prefixes) (car groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2945 (setq prefixes (cdr prefixes)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2946 (setq prefix (car prefixes))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2947 (setq start (1- (length prefix)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2948 (if (and (string-match "[^\\.]\\." (car groups) start)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2949 (cdr groups)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2950 (setq prefix
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2951 (concat "^" (substring (car groups) 0 (match-end 0))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2952 (string-match prefix (cadr groups)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2953 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2954 (setq prefixes (cons prefix prefixes))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2955 (message "Descend hierarchy %s? ([y]nsq): "
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2956 (substring prefix 1 (1- (length prefix))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2957 (while (not (memq (setq ans (read-char)) '(?y ?\n ?n ?s ?q)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2958 (ding)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2959 (message "Descend hierarchy %s? ([y]nsq): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2960 (substring prefix 1 (1- (length prefix)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2961 (cond ((= ans ?n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2962 (while (and groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2963 (string-match prefix
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2964 (setq group (car groups))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2965 (setq gnus-killed-list
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2966 (cons group gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2967 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2968 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2969 (setq starts (cdr starts)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2970 ((= ans ?s)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2971 (while (and groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2972 (string-match prefix
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2973 (setq group (car groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2974 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2975 (gnus-subscribe-alphabetically (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2976 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2977 (setq starts (cdr starts)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2978 ((= ans ?q)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2979 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2980 (setq group (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2981 (setq gnus-killed-list (cons group gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2982 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2983 (setq groups (cdr groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2984 (t nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2985 (message "Subscribe %s? ([n]yq)" (car groups))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2986 (while (not (memq (setq ans (read-char)) '(?y ?\n ?q ?n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2987 (ding)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2988 (message "Subscribe %s? ([n]yq)" (car groups)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2989 (setq group (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2990 (cond ((= ans ?y)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2991 (gnus-subscribe-alphabetically (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2992 (gnus-sethash group group gnus-killed-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2993 ((= ans ?q)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2994 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2995 (setq group (car groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2996 (setq gnus-killed-list (cons group gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2997 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
2998 (setq groups (cdr groups))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
2999 (t
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3000 (setq gnus-killed-list (cons group gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3001 (gnus-sethash group group gnus-killed-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3002 (setq groups (cdr groups)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3003
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3004 (defun gnus-subscribe-randomly (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3005 "Subscribe new NEWSGROUP by making it the first newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3006 (gnus-subscribe-newsgroup newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3007
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3008 (defun gnus-subscribe-alphabetically (newgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3009 "Subscribe new NEWSGROUP and insert it in alphabetical order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3010 (let ((groups (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3011 before)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3012 (while (and (not before) groups)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3013 (if (string< newgroup (caar groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3014 (setq before (caar groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3015 (setq groups (cdr groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3016 (gnus-subscribe-newsgroup newgroup before)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3017
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3018 (defun gnus-subscribe-hierarchically (newgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3019 "Subscribe new NEWSGROUP and insert it in hierarchical newsgroup order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3020 ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3021 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3022 (set-buffer (find-file-noselect gnus-current-startup-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3023 (let ((groupkey newgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3024 before)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3025 (while (and (not before) groupkey)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3026 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3027 (let ((groupkey-re
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3028 (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3029 (while (and (re-search-forward groupkey-re nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3030 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3031 (setq before (match-string 1))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3032 (string< before newgroup)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3033 ;; Remove tail of newsgroup name (eg. a.b.c -> a.b)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3034 (setq groupkey
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3035 (if (string-match "^\\(.*\\)\\.[^.]+$" groupkey)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3036 (substring groupkey (match-beginning 1) (match-end 1)))))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
3037 (gnus-subscribe-newsgroup newgroup before))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
3038 (kill-buffer (current-buffer))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3039
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3040 (defun gnus-subscribe-interactively (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3041 "Subscribe the new GROUP interactively.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3042 It is inserted in hierarchical newsgroup order if subscribed. If not,
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3043 it is killed."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3044 (if (gnus-y-or-n-p (format "Subscribe new newsgroup: %s " group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3045 (gnus-subscribe-hierarchically group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3046 (push group gnus-killed-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3047
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3048 (defun gnus-subscribe-zombies (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3049 "Make the new GROUP into a zombie group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3050 (push group gnus-zombie-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3051
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3052 (defun gnus-subscribe-killed (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3053 "Make the new GROUP a killed group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3054 (push group gnus-killed-list))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3055
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3056 (defun gnus-subscribe-newsgroup (newsgroup &optional next)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3057 "Subscribe new NEWSGROUP.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3058 If NEXT is non-nil, it is inserted before NEXT. Otherwise it is made
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3059 the first newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3060 ;; We subscribe the group by changing its level to `subscribed'.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3061 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3062 newsgroup gnus-level-default-subscribed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3063 gnus-level-killed (gnus-gethash (or next "dummy.group") gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3064 (gnus-message 5 "Subscribe newsgroup: %s" newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3065
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3066 ;; For directories
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3067
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3068 (defun gnus-newsgroup-directory-form (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3069 "Make hierarchical directory name from NEWSGROUP name."
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
3070 (let ((newsgroup (gnus-newsgroup-savable-name newsgroup))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3071 (len (length newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3072 idx)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3073 ;; If this is a foreign group, we don't want to translate the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3074 ;; entire name.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3075 (if (setq idx (string-match ":" newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3076 (aset newsgroup idx ?/)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3077 (setq idx 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3078 ;; Replace all occurrences of `.' with `/'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3079 (while (< idx len)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3080 (if (= (aref newsgroup idx) ?.)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3081 (aset newsgroup idx ?/))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3082 (setq idx (1+ idx)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3083 newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3084
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
3085 (defun gnus-newsgroup-savable-name (group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3086 ;; Replace any slashes in a group name (eg. an ange-ftp nndoc group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3087 ;; with dots.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3088 (nnheader-replace-chars-in-string group ?/ ?.))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3089
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3090 (defun gnus-make-directory (dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3091 "Make DIRECTORY recursively."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3092 ;; Why don't we use `(make-directory dir 'parents)'? That's just one
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3093 ;; of the many mysteries of the universe.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3094 (let* ((dir (expand-file-name dir default-directory))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3095 dirs err)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3096 (if (string-match "/$" dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3097 (setq dir (substring dir 0 (match-beginning 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3098 ;; First go down the path until we find a directory that exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3099 (while (not (file-exists-p dir))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3100 (setq dirs (cons dir dirs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3101 (string-match "/[^/]+$" dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3102 (setq dir (substring dir 0 (match-beginning 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3103 ;; Then create all the subdirs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3104 (while (and dirs (not err))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3105 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3106 (make-directory (car dirs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3107 (error (setq err t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3108 (setq dirs (cdr dirs)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3109 ;; We return whether we were successful or not.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3110 (not dirs)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3111
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3112 (defun gnus-capitalize-newsgroup (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3113 "Capitalize NEWSGROUP name."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3114 (and (not (zerop (length newsgroup)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3115 (concat (char-to-string (upcase (aref newsgroup 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3116 (substring newsgroup 1))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3117
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3118 ;; Various... things.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3119
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3120 (defun gnus-simplify-subject (subject &optional re-only)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3121 "Remove `Re:' and words in parentheses.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3122 If RE-ONLY is non-nil, strip leading `Re:'s only."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3123 (let ((case-fold-search t)) ;Ignore case.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3124 ;; Remove `Re:', `Re^N:', `Re(n)', and `Re[n]:'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3125 (when (string-match "\\`\\(re\\([[(^][0-9]+[])]?\\)?:[ \t]*\\)+" subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3126 (setq subject (substring subject (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3127 ;; Remove uninteresting prefixes.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3128 (if (and (not re-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3129 gnus-simplify-ignored-prefixes
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3130 (string-match gnus-simplify-ignored-prefixes subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3131 (setq subject (substring subject (match-end 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3132 ;; Remove words in parentheses from end.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3133 (unless re-only
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3134 (while (string-match "[ \t\n]*([^()]*)[ \t\n]*\\'" subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3135 (setq subject (substring subject 0 (match-beginning 0)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3136 ;; Return subject string.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3137 subject))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3138
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3139 ;; Remove any leading "re:"s, any trailing paren phrases, and simplify
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3140 ;; all whitespace.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3141 ;; Written by Stainless Steel Rat <ratinox@ccs.neu.edu>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3142 (defun gnus-simplify-buffer-fuzzy ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3143 (let ((case-fold-search t))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3144 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3145 (while (search-forward "\t" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3146 (replace-match " " t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3147 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3148 (re-search-forward "^ *\\(re\\|fwd\\)[[{(^0-9]*[])}]?[:;] *" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3149 (goto-char (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3150 (while (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3151 (looking-at "^ *\\(re\\|fwd\\)[[{(^0-9]*[])}]?[:;] *")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3152 (looking-at "^[[].*: .*[]]$"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3153 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3154 (while (re-search-forward "^ *\\(re\\|fwd\\)[[{(^0-9]*[])}]?[:;] *"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3155 nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3156 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3157 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3158 (while (re-search-forward "^[[].*: .*[]]$" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3159 (goto-char (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3160 (delete-char -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3161 (delete-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3162 (progn (goto-char (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3163 (re-search-forward ":"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3164 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3165 (while (re-search-forward " *[[{(][^()\n]*[]})] *$" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3166 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3167 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3168 (while (re-search-forward " +" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3169 (replace-match " " t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3170 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3171 (while (re-search-forward " $" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3172 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3173 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3174 (while (re-search-forward "^ +" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3175 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3176 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3177 (when gnus-simplify-subject-fuzzy-regexp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3178 (if (listp gnus-simplify-subject-fuzzy-regexp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3179 (let ((list gnus-simplify-subject-fuzzy-regexp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3180 (while list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3181 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3182 (while (re-search-forward (car list) nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3183 (replace-match "" t t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3184 (setq list (cdr list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3185 (while (re-search-forward gnus-simplify-subject-fuzzy-regexp nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3186 (replace-match "" t t))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3187
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3188 (defun gnus-simplify-subject-fuzzy (subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3189 "Siplify a subject string fuzzily."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3190 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3191 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3192 (let ((case-fold-search t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3193 (insert subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3194 (inline (gnus-simplify-buffer-fuzzy))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3195 (buffer-string))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3196
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3197 ;; Add the current buffer to the list of buffers to be killed on exit.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3198 (defun gnus-add-current-to-buffer-list ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3199 (or (memq (current-buffer) gnus-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3200 (setq gnus-buffer-list (cons (current-buffer) gnus-buffer-list))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3201
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3202 (defun gnus-string> (s1 s2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3203 (not (or (string< s1 s2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3204 (string= s1 s2))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3205
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3206 (defun gnus-read-active-file-p ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3207 "Say whether the active file has been read from `gnus-select-method'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3208 (memq gnus-select-method gnus-have-read-active-file))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3209
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3210 ;;; General various misc type functions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3211
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3212 (defun gnus-clear-system ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3213 "Clear all variables and buffers."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3214 ;; Clear Gnus variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3215 (let ((variables gnus-variable-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3216 (while variables
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3217 (set (car variables) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3218 (setq variables (cdr variables))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3219 ;; Clear other internal variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3220 (setq gnus-list-of-killed-groups nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3221 gnus-have-read-active-file nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3222 gnus-newsrc-alist nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3223 gnus-newsrc-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3224 gnus-killed-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3225 gnus-zombie-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3226 gnus-killed-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3227 gnus-active-hashtb nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3228 gnus-moderated-list nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3229 gnus-description-hashtb nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3230 gnus-current-headers nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3231 gnus-thread-indent-array nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3232 gnus-newsgroup-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3233 gnus-newsgroup-name nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3234 gnus-server-alist nil
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3235 gnus-group-list-mode nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3236 gnus-opened-servers nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3237 gnus-group-mark-positions nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3238 gnus-newsgroup-data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3239 gnus-newsgroup-unreads nil
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
3240 nnoo-state-alist nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3241 gnus-current-select-method nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3242 (gnus-shutdown 'gnus)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3243 ;; Kill the startup file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3244 (and gnus-current-startup-file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3245 (get-file-buffer gnus-current-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3246 (kill-buffer (get-file-buffer gnus-current-startup-file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3247 ;; Clear the dribble buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3248 (gnus-dribble-clear)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3249 ;; Kill global KILL file buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3250 (when (get-file-buffer (gnus-newsgroup-kill-file nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3251 (kill-buffer (get-file-buffer (gnus-newsgroup-kill-file nil))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3252 (gnus-kill-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3253 ;; Kill Gnus buffers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3254 (while gnus-buffer-list
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3255 (gnus-kill-buffer (pop gnus-buffer-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3256 ;; Remove Gnus frames.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3257 (gnus-kill-gnus-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3258
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3259 (defun gnus-kill-gnus-frames ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3260 "Kill all frames Gnus has created."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3261 (while gnus-created-frames
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3262 (when (frame-live-p (car gnus-created-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3263 ;; We slap a condition-case around this `delete-frame' to ensure
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3264 ;; against errors if we try do delete the single frame that's left.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3265 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3266 (delete-frame (car gnus-created-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3267 (error nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3268 (pop gnus-created-frames)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3269
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3270 (defun gnus-windows-old-to-new (setting)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3271 ;; First we take care of the really, really old Gnus 3 actions.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3272 (when (symbolp setting)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3273 (setq setting
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3274 ;; Take care of ooold GNUS 3.x values.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3275 (cond ((eq setting 'SelectArticle) 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3276 ((memq setting '(SelectSubject ExpandSubject)) 'summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3277 ((memq setting '(SelectNewsgroup ExitNewsgroup)) 'group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3278 (t setting))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3279 (if (or (listp setting)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3280 (not (and gnus-window-configuration
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3281 (memq setting '(group summary article)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3282 setting
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3283 (let* ((setting (if (eq setting 'group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3284 (if (assq 'newsgroup gnus-window-configuration)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3285 'newsgroup
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3286 'newsgroups) setting))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3287 (elem (cadr (assq setting gnus-window-configuration)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3288 (total (apply '+ elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3289 (types '(group summary article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3290 (pbuf (if (eq setting 'newsgroups) 'group 'summary))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3291 (i 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3292 perc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3293 out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3294 (while (< i 3)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3295 (or (not (numberp (nth i elem)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3296 (zerop (nth i elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3297 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3298 (setq perc (if (= i 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3299 1.0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3300 (/ (float (nth 0 elem)) total)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3301 (setq out (cons (if (eq pbuf (nth i types))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3302 (list (nth i types) perc 'point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3303 (list (nth i types) perc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3304 out))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3305 (setq i (1+ i)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3306 `(vertical 1.0 ,@(nreverse out)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3307
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3308 ;;;###autoload
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3309 (defun gnus-add-configuration (conf)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3310 "Add the window configuration CONF to `gnus-buffer-configuration'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3311 (setq gnus-buffer-configuration
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3312 (cons conf (delq (assq (car conf) gnus-buffer-configuration)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3313 gnus-buffer-configuration))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3314
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3315 (defvar gnus-frame-list nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3316
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3317 (defun gnus-configure-frame (split &optional window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3318 "Split WINDOW according to SPLIT."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3319 (unless window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3320 (setq window (get-buffer-window (current-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3321 (select-window window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3322 ;; This might be an old-stylee buffer config.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3323 (when (vectorp split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3324 (setq split (append split nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3325 (when (or (consp (car split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3326 (vectorp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3327 (push 1.0 split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3328 (push 'vertical split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3329 ;; The SPLIT might be something that is to be evaled to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3330 ;; return a new SPLIT.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3331 (while (and (not (assq (car split) gnus-window-to-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3332 (gnus-functionp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3333 (setq split (eval split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3334 (let* ((type (car split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3335 (subs (cddr split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3336 (len (if (eq type 'horizontal) (window-width) (window-height)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3337 (total 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3338 (window-min-width (or gnus-window-min-width window-min-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3339 (window-min-height (or gnus-window-min-height window-min-height))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3340 s result new-win rest comp-subs size sub)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3341 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3342 ;; Nothing to do here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3343 ((null split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3344 ;; Don't switch buffers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3345 ((null type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3346 (and (memq 'point split) window))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3347 ;; This is a buffer to be selected.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3348 ((not (memq type '(frame horizontal vertical)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3349 (let ((buffer (cond ((stringp type) type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3350 (t (cdr (assq type gnus-window-to-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3351 buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3352 (unless buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3353 (error "Illegal buffer type: %s" type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3354 (unless (setq buf (get-buffer (if (symbolp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3355 (symbol-value buffer) buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3356 (setq buf (get-buffer-create (if (symbolp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3357 (symbol-value buffer) buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3358 (switch-to-buffer buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3359 ;; We return the window if it has the `point' spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3360 (and (memq 'point split) window)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3361 ;; This is a frame split.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3362 ((eq type 'frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3363 (unless gnus-frame-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3364 (setq gnus-frame-list (list (window-frame
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3365 (get-buffer-window (current-buffer))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3366 (let ((i 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3367 params frame fresult)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3368 (while (< i (length subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3369 ;; Frame parameter is gotten from the sub-split.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3370 (setq params (cadr (elt subs i)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3371 ;; It should be a list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3372 (unless (listp params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3373 (setq params nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3374 ;; Create a new frame?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3375 (unless (setq frame (elt gnus-frame-list i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3376 (nconc gnus-frame-list (list (setq frame (make-frame params))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3377 (push frame gnus-created-frames))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3378 ;; Is the old frame still alive?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3379 (unless (frame-live-p frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3380 (setcar (nthcdr i gnus-frame-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3381 (setq frame (make-frame params))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3382 ;; Select the frame in question and do more splits there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3383 (select-frame frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3384 (setq fresult (or (gnus-configure-frame (elt subs i)) fresult))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3385 (incf i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3386 ;; Select the frame that has the selected buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3387 (when fresult
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3388 (select-frame (window-frame fresult)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3389 ;; This is a normal split.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3390 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3391 (when (> (length subs) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3392 ;; First we have to compute the sizes of all new windows.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3393 (while subs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3394 (setq sub (append (pop subs) nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3395 (while (and (not (assq (car sub) gnus-window-to-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3396 (gnus-functionp (car sub)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3397 (setq sub (eval sub)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3398 (when sub
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3399 (push sub comp-subs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3400 (setq size (cadar comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3401 (cond ((equal size 1.0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3402 (setq rest (car comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3403 (setq s 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3404 ((floatp size)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3405 (setq s (floor (* size len))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3406 ((integerp size)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3407 (setq s size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3408 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3409 (error "Illegal size: %s" size)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3410 ;; Try to make sure that we are inside the safe limits.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3411 (cond ((zerop s))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3412 ((eq type 'horizontal)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3413 (setq s (max s window-min-width)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3414 ((eq type 'vertical)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3415 (setq s (max s window-min-height))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3416 (setcar (cdar comp-subs) s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3417 (incf total s)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3418 ;; Take care of the "1.0" spec.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3419 (if rest
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3420 (setcar (cdr rest) (- len total))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3421 (error "No 1.0 specs in %s" split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3422 ;; The we do the actual splitting in a nice recursive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3423 ;; fashion.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3424 (setq comp-subs (nreverse comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3425 (while comp-subs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3426 (if (null (cdr comp-subs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3427 (setq new-win window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3428 (setq new-win
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3429 (split-window window (cadar comp-subs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3430 (eq type 'horizontal))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3431 (setq result (or (gnus-configure-frame
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3432 (car comp-subs) window) result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3433 (select-window new-win)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3434 (setq window new-win)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3435 (setq comp-subs (cdr comp-subs))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3436 ;; Return the proper window, if any.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3437 (when result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3438 (select-window result))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3439
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3440 (defvar gnus-frame-split-p nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3441
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3442 (defun gnus-configure-windows (setting &optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3443 (setq setting (gnus-windows-old-to-new setting))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3444 (let ((split (if (symbolp setting)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3445 (cadr (assq setting gnus-buffer-configuration))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3446 setting))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3447 all-visible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3448
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3449 (setq gnus-frame-split-p nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3450
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3451 (unless split
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3452 (error "No such setting: %s" setting))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3453
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3454 (if (and (setq all-visible (gnus-all-windows-visible-p split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3455 (not force))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3456 ;; All the windows mentioned are already visible, so we just
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3457 ;; put point in the assigned buffer, and do not touch the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3458 ;; winconf.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3459 (select-window all-visible)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3460
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3461 ;; Either remove all windows or just remove all Gnus windows.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3462 (let ((frame (selected-frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3463 (unwind-protect
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3464 (if gnus-use-full-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3465 ;; We want to remove all other windows.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3466 (if (not gnus-frame-split-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3467 ;; This is not a `frame' split, so we ignore the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3468 ;; other frames.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3469 (delete-other-windows)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3470 ;; This is a `frame' split, so we delete all windows
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3471 ;; on all frames.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3472 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3473 (lambda (frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3474 (unless (eq (cdr (assq 'minibuffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3475 (frame-parameters frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3476 'only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3477 (select-frame frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3478 (delete-other-windows)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3479 (frame-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3480 ;; Just remove some windows.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3481 (gnus-remove-some-windows)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3482 (switch-to-buffer nntp-server-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3483 (select-frame frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3484
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3485 (switch-to-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3486 (gnus-configure-frame split (get-buffer-window (current-buffer))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3487
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3488 (defun gnus-all-windows-visible-p (split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3489 "Say whether all buffers in SPLIT are currently visible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3490 In particular, the value returned will be the window that
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3491 should have point."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3492 (let ((stack (list split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3493 (all-visible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3494 type buffer win buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3495 (while (and (setq split (pop stack))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3496 all-visible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3497 ;; Be backwards compatible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3498 (when (vectorp split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3499 (setq split (append split nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3500 (when (or (consp (car split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3501 (vectorp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3502 (push 1.0 split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3503 (push 'vertical split))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3504 ;; The SPLIT might be something that is to be evaled to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3505 ;; return a new SPLIT.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3506 (while (and (not (assq (car split) gnus-window-to-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3507 (gnus-functionp (car split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3508 (setq split (eval split)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3509
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3510 (setq type (elt split 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3511 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3512 ;; Nothing here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3513 ((null split) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3514 ;; A buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3515 ((not (memq type '(horizontal vertical frame)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3516 (setq buffer (cond ((stringp type) type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3517 (t (cdr (assq type gnus-window-to-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3518 (unless buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3519 (error "Illegal buffer type: %s" type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3520 (when (setq buf (get-buffer (if (symbolp buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3521 (symbol-value buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3522 buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3523 (setq win (get-buffer-window buf t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3524 (if win
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3525 (when (memq 'point split)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3526 (setq all-visible win))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3527 (setq all-visible nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3528 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3529 (when (eq type 'frame)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3530 (setq gnus-frame-split-p t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3531 (setq stack (append (cddr split) stack)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3532 (unless (eq all-visible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3533 all-visible)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3534
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3535 (defun gnus-window-top-edge (&optional window)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3536 (nth 1 (window-edges window)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3537
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3538 (defun gnus-remove-some-windows ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3539 (let ((buffers gnus-window-to-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3540 buf bufs lowest-buf lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3541 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3542 ;; Remove windows on all known Gnus buffers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3543 (while buffers
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3544 (setq buf (cdar buffers))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3545 (if (symbolp buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3546 (setq buf (and (boundp buf) (symbol-value buf))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3547 (and buf
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3548 (get-buffer-window buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3549 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3550 (setq bufs (cons buf bufs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3551 (pop-to-buffer buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3552 (if (or (not lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3553 (< (gnus-window-top-edge) lowest))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3554 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3555 (setq lowest (gnus-window-top-edge))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3556 (setq lowest-buf buf)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3557 (setq buffers (cdr buffers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3558 ;; Remove windows on *all* summary buffers.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3559 (walk-windows
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3560 (lambda (win)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3561 (let ((buf (window-buffer win)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3562 (if (string-match "^\\*Summary" (buffer-name buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3563 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3564 (setq bufs (cons buf bufs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3565 (pop-to-buffer buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3566 (if (or (not lowest)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3567 (< (gnus-window-top-edge) lowest))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3568 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3569 (setq lowest-buf buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3570 (setq lowest (gnus-window-top-edge)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3571 (and lowest-buf
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3572 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3573 (pop-to-buffer lowest-buf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3574 (switch-to-buffer nntp-server-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3575 (while bufs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3576 (and (not (eq (car bufs) lowest-buf))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3577 (delete-windows-on (car bufs)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3578 (setq bufs (cdr bufs))))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3579
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3580 (defun gnus-version (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3581 "Version number of this version of Gnus.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3582 If ARG, insert string at point."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3583 (interactive "P")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3584 (let ((methods gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3585 (mess gnus-version)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3586 meth)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3587 ;; Go through all the legal select methods and add their version
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3588 ;; numbers to the total version string. Only the backends that are
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3589 ;; currently in use will have their message numbers taken into
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3590 ;; consideration.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3591 (while methods
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3592 (setq meth (intern (concat (caar methods) "-version")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3593 (and (boundp meth)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3594 (stringp (symbol-value meth))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3595 (setq mess (concat mess "; " (symbol-value meth))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3596 (setq methods (cdr methods)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3597 (if arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3598 (insert (message mess))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3599 (message mess))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3600
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3601 (defun gnus-info-find-node ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3602 "Find Info documentation of Gnus."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3603 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3604 ;; Enlarge info window if needed.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3605 (let ((mode major-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3606 gnus-info-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3607 (Info-goto-node (cadr (assq mode gnus-info-nodes)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3608 (setq gnus-info-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3609 (gnus-configure-windows 'info)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3610
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3611 (defun gnus-days-between (date1 date2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3612 ;; Return the number of days between date1 and date2.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3613 (- (gnus-day-number date1) (gnus-day-number date2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3614
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3615 (defun gnus-day-number (date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3616 (let ((dat (mapcar (lambda (s) (and s (string-to-int s)) )
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3617 (timezone-parse-date date))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3618 (timezone-absolute-from-gregorian
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3619 (nth 1 dat) (nth 2 dat) (car dat))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3620
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3621 (defun gnus-encode-date (date)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3622 "Convert DATE to internal time."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3623 (let* ((parse (timezone-parse-date date))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3624 (date (mapcar (lambda (d) (and d (string-to-int d))) parse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3625 (time (mapcar 'string-to-int (timezone-parse-time (aref parse 3)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3626 (encode-time (caddr time) (cadr time) (car time)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3627 (caddr date) (cadr date) (car date) (nth 4 date))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3628
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3629 (defun gnus-time-minus (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3630 "Subtract two internal times."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3631 (let ((borrow (< (cadr t1) (cadr t2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3632 (list (- (car t1) (car t2) (if borrow 1 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3633 (- (+ (if borrow 65536 0) (cadr t1)) (cadr t2)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3634
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3635 (defun gnus-file-newer-than (file date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3636 (let ((fdate (nth 5 (file-attributes file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3637 (or (> (car fdate) (car date))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3638 (and (= (car fdate) (car date))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3639 (> (nth 1 fdate) (nth 1 date))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3640
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3641 (defmacro gnus-local-set-keys (&rest plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3642 "Set the keys in PLIST in the current keymap."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3643 `(gnus-define-keys-1 (current-local-map) ',plist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3644
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3645 (defmacro gnus-define-keys (keymap &rest plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3646 "Define all keys in PLIST in KEYMAP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3647 `(gnus-define-keys-1 (quote ,keymap) (quote ,plist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3648
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3649 (put 'gnus-define-keys 'lisp-indent-function 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3650 (put 'gnus-define-keys 'lisp-indent-hook 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3651 (put 'gnus-define-keymap 'lisp-indent-function 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3652 (put 'gnus-define-keymap 'lisp-indent-hook 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3653
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3654 (defmacro gnus-define-keymap (keymap &rest plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3655 "Define all keys in PLIST in KEYMAP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3656 `(gnus-define-keys-1 ,keymap (quote ,plist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3657
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3658 (defun gnus-define-keys-1 (keymap plist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3659 (when (null keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3660 (error "Can't set keys in a null keymap"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3661 (cond ((symbolp keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3662 (setq keymap (symbol-value keymap)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3663 ((keymapp keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3664 ((listp keymap)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3665 (set (car keymap) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3666 (define-prefix-command (car keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3667 (define-key (symbol-value (caddr keymap)) (cadr keymap) (car keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3668 (setq keymap (symbol-value (car keymap)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3669 (let (key)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3670 (while plist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3671 (when (symbolp (setq key (pop plist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3672 (setq key (symbol-value key)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3673 (define-key keymap key (pop plist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3674
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3675 (defun gnus-group-read-only-p (&optional group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3676 "Check whether GROUP supports editing or not.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3677 If GROUP is nil, `gnus-newsgroup-name' will be checked instead. Note
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3678 that that variable is buffer-local to the summary buffers."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3679 (let ((group (or group gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3680 (not (gnus-check-backend-function 'request-replace-article group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3681
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3682 (defun gnus-group-total-expirable-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3683 "Check whether GROUP is total-expirable or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3684 (let ((params (gnus-info-params (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3685 (or (memq 'total-expire params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3686 (cdr (assq 'total-expire params)) ; (total-expire . t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3687 (and gnus-total-expirable-newsgroups ; Check var.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3688 (string-match gnus-total-expirable-newsgroups group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3689
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3690 (defun gnus-group-auto-expirable-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3691 "Check whether GROUP is total-expirable or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3692 (let ((params (gnus-info-params (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3693 (or (memq 'auto-expire params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3694 (cdr (assq 'auto-expire params)) ; (auto-expire . t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3695 (and gnus-auto-expirable-newsgroups ; Check var.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3696 (string-match gnus-auto-expirable-newsgroups group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3697
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3698 (defun gnus-virtual-group-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3699 "Say whether GROUP is virtual or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3700 (memq 'virtual (assoc (symbol-name (car (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3701 gnus-valid-select-methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3702
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3703 (defun gnus-news-group-p (group &optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3704 "Return non-nil if GROUP (and ARTICLE) come from a news server."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3705 (or (gnus-member-of-valid 'post group) ; Ordinary news group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3706 (and (gnus-member-of-valid 'post-mail group) ; Combined group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3707 (eq (gnus-request-type group article) 'news))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3708
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3709 (defsubst gnus-simplify-subject-fully (subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3710 "Simplify a subject string according to the user's wishes."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3711 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3712 ((null gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3713 (gnus-simplify-subject-re subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3714 ((eq gnus-summary-gather-subject-limit 'fuzzy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3715 (gnus-simplify-subject-fuzzy subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3716 ((numberp gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3717 (gnus-limit-string (gnus-simplify-subject-re subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3718 gnus-summary-gather-subject-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3719 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3720 subject)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3721
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3722 (defsubst gnus-subject-equal (s1 s2 &optional simple-first)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3723 "Check whether two subjects are equal. If optional argument
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3724 simple-first is t, first argument is already simplified."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3725 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3726 ((null simple-first)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3727 (equal (gnus-simplify-subject-fully s1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3728 (gnus-simplify-subject-fully s2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3729 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3730 (equal s1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3731 (gnus-simplify-subject-fully s2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3732
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3733 ;; Returns a list of writable groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3734 (defun gnus-writable-groups ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3735 (let ((alist gnus-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3736 groups group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3737 (while (setq group (car (pop alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3738 (unless (gnus-group-read-only-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3739 (push group groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3740 (nreverse groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3741
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3742 (defun gnus-completing-read (default prompt &rest args)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3743 ;; Like `completing-read', except that DEFAULT is the default argument.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3744 (let* ((prompt (if default
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3745 (concat prompt " (default " default ") ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3746 (concat prompt " ")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3747 (answer (apply 'completing-read prompt args)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3748 (if (or (null answer) (zerop (length answer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3749 default
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3750 answer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3751
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3752 ;; Two silly functions to ensure that all `y-or-n-p' questions clear
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3753 ;; the echo area.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3754 (defun gnus-y-or-n-p (prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3755 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3756 (y-or-n-p prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3757 (message "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3758
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3759 (defun gnus-yes-or-no-p (prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3760 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3761 (yes-or-no-p prompt)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3762 (message "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3763
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3764 ;; Check whether to use long file names.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3765 (defun gnus-use-long-file-name (symbol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3766 ;; The variable has to be set...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3767 (and gnus-use-long-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3768 ;; If it isn't a list, then we return t.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3769 (or (not (listp gnus-use-long-file-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3770 ;; If it is a list, and the list contains `symbol', we
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3771 ;; return nil.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3772 (not (memq symbol gnus-use-long-file-name)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3773
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3774 ;; I suspect there's a better way, but I haven't taken the time to do
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3775 ;; it yet. -erik selberg@cs.washington.edu
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3776 (defun gnus-dd-mmm (messy-date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3777 "Return a string like DD-MMM from a big messy string"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3778 (let ((datevec (condition-case () (timezone-parse-date messy-date)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3779 (error nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3780 (if (not datevec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3781 "??-???"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3782 (format "%2s-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3783 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3784 ;; Make sure leading zeroes are stripped.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3785 (number-to-string (string-to-number (aref datevec 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3786 (error "??"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3787 (capitalize
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3788 (or (car
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3789 (nth (1- (string-to-number (aref datevec 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3790 timezone-months-assoc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3791 "???"))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3792
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3793 (defun gnus-mode-string-quote (string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3794 "Quote all \"%\" in STRING."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3795 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3796 (gnus-set-work-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3797 (insert string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3798 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3799 (while (search-forward "%" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3800 (insert "%"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3801 (buffer-string)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3802
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3803 ;; Make a hash table (default and minimum size is 255).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3804 ;; Optional argument HASHSIZE specifies the table size.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3805 (defun gnus-make-hashtable (&optional hashsize)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3806 (make-vector (if hashsize (max (gnus-create-hash-size hashsize) 255) 255) 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3807
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3808 ;; Make a number that is suitable for hashing; bigger than MIN and one
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3809 ;; less than 2^x.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3810 (defun gnus-create-hash-size (min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3811 (let ((i 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3812 (while (< i min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3813 (setq i (* 2 i)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3814 (1- i)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3815
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3816 ;; Show message if message has a lower level than `gnus-verbose'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3817 ;; Guideline for numbers:
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3818 ;; 1 - error messages, 3 - non-serious error messages, 5 - messages
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3819 ;; for things that take a long time, 7 - not very important messages
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3820 ;; on stuff, 9 - messages inside loops.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3821 (defun gnus-message (level &rest args)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3822 (if (<= level gnus-verbose)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3823 (apply 'message args)
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
3824 ;; We have to do this format thingy here even if the result isn't
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3825 ;; shown - the return value has to be the same as the return value
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3826 ;; from `message'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3827 (apply 'format args)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3828
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3829 (defun gnus-error (level &rest args)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
3830 "Beep an error if LEVEL is equal to or less than `gnus-verbose'."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3831 (when (<= (floor level) gnus-verbose)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3832 (apply 'message args)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3833 (ding)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3834 (let (duration)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3835 (when (and (floatp level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3836 (not (zerop (setq duration (* 10 (- level (floor level)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3837 (sit-for duration))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3838 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3839
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3840 ;; Generate a unique new group name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3841 (defun gnus-generate-new-group-name (leaf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3842 (let ((name leaf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3843 (num 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3844 (while (gnus-gethash name gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3845 (setq name (concat leaf "<" (int-to-string (setq num (1+ num))) ">")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3846 name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3847
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3848 (defsubst gnus-hide-text (b e props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3849 "Set text PROPS on the B to E region, extending `intangible' 1 past B."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3850 (gnus-add-text-properties b e props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3851 (when (memq 'intangible props)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3852 (gnus-put-text-property (max (1- b) (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3853 b 'intangible (cddr (memq 'intangible props)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3854
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3855 (defsubst gnus-unhide-text (b e)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3856 "Remove hidden text properties from region between B and E."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3857 (remove-text-properties b e gnus-hidden-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3858 (when (memq 'intangible gnus-hidden-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3859 (gnus-put-text-property (max (1- b) (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3860 b 'intangible nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3861
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3862 (defun gnus-hide-text-type (b e type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3863 "Hide text of TYPE between B and E."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3864 (gnus-hide-text b e (cons 'gnus-type (cons type gnus-hidden-properties))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3865
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3866 (defun gnus-parent-headers (headers &optional generation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3867 "Return the headers of the GENERATIONeth parent of HEADERS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3868 (unless generation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3869 (setq generation 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3870 (let (references parent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3871 (while (and headers (not (zerop generation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3872 (setq references (mail-header-references headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3873 (when (and references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3874 (setq parent (gnus-parent-id references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3875 (setq headers (car (gnus-id-to-thread parent))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3876 (decf generation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3877 headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3878
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3879 (defun gnus-parent-id (references)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3880 "Return the last Message-ID in REFERENCES."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3881 (when (and references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3882 (string-match "\\(<[^\n<>]+>\\)[ \t\n]*\\'" references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3883 (substring references (match-beginning 1) (match-end 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3884
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3885 (defun gnus-split-references (references)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3886 "Return a list of Message-IDs in REFERENCES."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3887 (let ((beg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3888 ids)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3889 (while (string-match "<[^>]+>" references beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3890 (push (substring references (match-beginning 0) (setq beg (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3891 ids))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3892 (nreverse ids)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3893
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3894 (defun gnus-buffer-live-p (buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3895 "Say whether BUFFER is alive or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3896 (and buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3897 (get-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3898 (buffer-name (get-buffer buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3899
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3900 (defun gnus-ephemeral-group-p (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3901 "Say whether GROUP is ephemeral or not."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3902 (gnus-group-get-parameter group 'quit-config))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3903
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3904 (defun gnus-group-quit-config (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3905 "Return the quit-config of GROUP."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3906 (gnus-group-get-parameter group 'quit-config))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3907
13700
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
3908 (defun gnus-simplify-mode-line ()
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
3909 "Make mode lines a bit simpler."
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
3910 (setq mode-line-modified "-- ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3911 (when (listp mode-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3912 (make-local-variable 'mode-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3913 (setq mode-line-format (copy-sequence mode-line-format))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3914 (when (equal (nth 3 mode-line-format) " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3915 (setcar (nthcdr 3 mode-line-format) " "))))
13700
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
3916
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3917 ;;; List and range functions
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3918
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3919 (defun gnus-last-element (list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3920 "Return last element of LIST."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3921 (while (cdr list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3922 (setq list (cdr list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3923 (car list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3924
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3925 (defun gnus-copy-sequence (list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3926 "Do a complete, total copy of a list."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3927 (if (and (consp list) (not (consp (cdr list))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3928 (cons (car list) (cdr list))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3929 (mapcar (lambda (elem) (if (consp elem)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3930 (if (consp (cdr elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3931 (gnus-copy-sequence elem)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3932 (cons (car elem) (cdr elem)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3933 elem))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3934 list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3935
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3936 (defun gnus-set-difference (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3937 "Return a list of elements of LIST1 that do not appear in LIST2."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3938 (let ((list1 (copy-sequence list1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3939 (while list2
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3940 (setq list1 (delq (car list2) list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3941 (setq list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3942 list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3943
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3944 (defun gnus-sorted-complement (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3945 "Return a list of elements of LIST1 that do not appear in LIST2.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3946 Both lists have to be sorted over <."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3947 (let (out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3948 (if (or (null list1) (null list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3949 (or list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3950 (while (and list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3951 (cond ((= (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3952 (setq list1 (cdr list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3953 list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3954 ((< (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3955 (setq out (cons (car list1) out))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3956 (setq list1 (cdr list1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3957 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3958 (setq out (cons (car list2) out))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3959 (setq list2 (cdr list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3960 (nconc (nreverse out) (or list1 list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3961
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
3962 (defun gnus-intersection (list1 list2)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3963 (let ((result nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3964 (while list2
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3965 (if (memq (car list2) list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3966 (setq result (cons (car list2) result)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3967 (setq list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3968 result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3969
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3970 (defun gnus-sorted-intersection (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3971 ;; LIST1 and LIST2 have to be sorted over <.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3972 (let (out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3973 (while (and list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3974 (cond ((= (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3975 (setq out (cons (car list1) out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3976 list1 (cdr list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3977 list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3978 ((< (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3979 (setq list1 (cdr list1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3980 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3981 (setq list2 (cdr list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3982 (nreverse out)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3983
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3984 (defun gnus-set-sorted-intersection (list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3985 ;; LIST1 and LIST2 have to be sorted over <.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3986 ;; This function modifies LIST1.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3987 (let* ((top (cons nil list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3988 (prev top))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3989 (while (and list1 list2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3990 (cond ((= (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3991 (setq prev list1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3992 list1 (cdr list1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3993 list2 (cdr list2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3994 ((< (car list1) (car list2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3995 (setcdr prev (cdr list1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3996 (setq list1 (cdr list1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3997 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3998 (setq list2 (cdr list2)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
3999 (setcdr prev nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4000 (cdr top)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4001
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4002 (defun gnus-compress-sequence (numbers &optional always-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4003 "Convert list of numbers to a list of ranges or a single range.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4004 If ALWAYS-LIST is non-nil, this function will always release a list of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4005 ranges."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4006 (let* ((first (car numbers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4007 (last (car numbers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4008 result)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4009 (if (null numbers)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4010 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4011 (if (not (listp (cdr numbers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4012 numbers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4013 (while numbers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4014 (cond ((= last (car numbers)) nil) ;Omit duplicated number
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4015 ((= (1+ last) (car numbers)) ;Still in sequence
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4016 (setq last (car numbers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4017 (t ;End of one sequence
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4018 (setq result
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4019 (cons (if (= first last) first
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4020 (cons first last)) result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4021 (setq first (car numbers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4022 (setq last (car numbers))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4023 (setq numbers (cdr numbers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4024 (if (and (not always-list) (null result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4025 (if (= first last) (list first) (cons first last))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4026 (nreverse (cons (if (= first last) first (cons first last))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4027 result)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4028
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4029 (defalias 'gnus-uncompress-sequence 'gnus-uncompress-range)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4030 (defun gnus-uncompress-range (ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4031 "Expand a list of ranges into a list of numbers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4032 RANGES is either a single range on the form `(num . num)' or a list of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4033 these ranges."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4034 (let (first last result)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4035 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4036 ((null ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4037 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4038 ((not (listp (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4039 (setq first (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4040 (setq last (cdr ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4041 (while (<= first last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4042 (setq result (cons first result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4043 (setq first (1+ first)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4044 (nreverse result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4045 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4046 (while ranges
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4047 (if (atom (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4048 (if (numberp (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4049 (setq result (cons (car ranges) result)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4050 (setq first (caar ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4051 (setq last (cdar ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4052 (while (<= first last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4053 (setq result (cons first result))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4054 (setq first (1+ first))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4055 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4056 (nreverse result)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4057
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4058 (defun gnus-add-to-range (ranges list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4059 "Return a list of ranges that has all articles from both RANGES and LIST.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4060 Note: LIST has to be sorted over `<'."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4061 (if (not ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4062 (gnus-compress-sequence list t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4063 (setq list (copy-sequence list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4064 (or (listp (cdr ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4065 (setq ranges (list ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4066 (let ((out ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4067 ilist lowest highest temp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4068 (while (and ranges list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4069 (setq ilist list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4070 (setq lowest (or (and (atom (car ranges)) (car ranges))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4071 (caar ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4072 (while (and list (cdr list) (< (cadr list) lowest))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4073 (setq list (cdr list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4074 (if (< (car ilist) lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4075 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4076 (setq temp list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4077 (setq list (cdr list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4078 (setcdr temp nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4079 (setq out (nconc (gnus-compress-sequence ilist t) out))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4080 (setq highest (or (and (atom (car ranges)) (car ranges))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4081 (cdar ranges)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4082 (while (and list (<= (car list) highest))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4083 (setq list (cdr list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4084 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4085 (if list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4086 (setq out (nconc (gnus-compress-sequence list t) out)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4087 (setq out (sort out (lambda (r1 r2)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4088 (< (or (and (atom r1) r1) (car r1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4089 (or (and (atom r2) r2) (car r2))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4090 (setq ranges out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4091 (while ranges
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4092 (if (atom (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4093 (if (cdr ranges)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4094 (if (atom (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4095 (if (= (1+ (car ranges)) (cadr ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4096 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4097 (setcar ranges (cons (car ranges)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4098 (cadr ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4099 (setcdr ranges (cddr ranges))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4100 (if (= (1+ (car ranges)) (caadr ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4101 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4102 (setcar (cadr ranges) (car ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4103 (setcar ranges (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4104 (setcdr ranges (cddr ranges))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4105 (if (cdr ranges)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4106 (if (atom (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4107 (if (= (1+ (cdar ranges)) (cadr ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4108 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4109 (setcdr (car ranges) (cadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4110 (setcdr ranges (cddr ranges))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4111 (if (= (1+ (cdar ranges)) (caadr ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4112 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4113 (setcdr (car ranges) (cdadr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4114 (setcdr ranges (cddr ranges)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4115 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4116 out)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4117
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4118 (defun gnus-remove-from-range (ranges list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4119 "Return a list of ranges that has all articles from LIST removed from RANGES.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4120 Note: LIST has to be sorted over `<'."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4121 ;; !!! This function shouldn't look like this, but I've got a headache.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4122 (gnus-compress-sequence
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4123 (gnus-sorted-complement
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4124 (gnus-uncompress-range ranges) list)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4125
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4126 (defun gnus-member-of-range (number ranges)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4127 (if (not (listp (cdr ranges)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4128 (and (>= number (car ranges))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4129 (<= number (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4130 (let ((not-stop t))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4131 (while (and ranges
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4132 (if (numberp (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4133 (>= number (car ranges))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4134 (>= number (caar ranges)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4135 not-stop)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4136 (if (if (numberp (car ranges))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4137 (= number (car ranges))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4138 (and (>= number (caar ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4139 (<= number (cdar ranges))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4140 (setq not-stop nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4141 (setq ranges (cdr ranges)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4142 (not not-stop))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4143
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4144 (defun gnus-range-length (range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4145 "Return the length RANGE would have if uncompressed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4146 (length (gnus-uncompress-range range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4147
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4148 (defun gnus-sublist-p (list sublist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4149 "Test whether all elements in SUBLIST are members of LIST."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4150 (let ((sublistp t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4151 (while sublist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4152 (unless (memq (pop sublist) list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4153 (setq sublistp nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4154 sublist nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4155 sublistp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4156
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4157
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4158 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4159 ;;; Gnus group mode
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4160 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4161
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4162 (defvar gnus-group-mode-map nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4163 (put 'gnus-group-mode 'mode-class 'special)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4164
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4165 (unless gnus-group-mode-map
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4166 (setq gnus-group-mode-map (make-keymap))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4167 (suppress-keymap gnus-group-mode-map)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4168
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4169 (gnus-define-keys gnus-group-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4170 " " gnus-group-read-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4171 "=" gnus-group-select-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4172 "\r" gnus-group-select-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4173 "\M-\r" gnus-group-quick-select-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4174 "j" gnus-group-jump-to-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4175 "n" gnus-group-next-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4176 "p" gnus-group-prev-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4177 "\177" gnus-group-prev-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4178 [delete] gnus-group-prev-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4179 "N" gnus-group-next-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4180 "P" gnus-group-prev-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4181 "\M-n" gnus-group-next-unread-group-same-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4182 "\M-p" gnus-group-prev-unread-group-same-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4183 "," gnus-group-best-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4184 "." gnus-group-first-unread-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4185 "u" gnus-group-unsubscribe-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4186 "U" gnus-group-unsubscribe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4187 "c" gnus-group-catchup-current
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4188 "C" gnus-group-catchup-current-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4189 "l" gnus-group-list-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4190 "L" gnus-group-list-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4191 "m" gnus-group-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4192 "g" gnus-group-get-new-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4193 "\M-g" gnus-group-get-new-news-this-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4194 "R" gnus-group-restart
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4195 "r" gnus-group-read-init-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4196 "B" gnus-group-browse-foreign-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4197 "b" gnus-group-check-bogus-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4198 "F" gnus-find-new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4199 "\C-c\C-d" gnus-group-describe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4200 "\M-d" gnus-group-describe-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4201 "\C-c\C-a" gnus-group-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4202 "\C-c\M-\C-a" gnus-group-description-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4203 "a" gnus-group-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4204 "\ek" gnus-group-edit-local-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4205 "\eK" gnus-group-edit-global-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4206 "\C-k" gnus-group-kill-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4207 "\C-y" gnus-group-yank-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4208 "\C-w" gnus-group-kill-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4209 "\C-x\C-t" gnus-group-transpose-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4210 "\C-c\C-l" gnus-group-list-killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4211 "\C-c\C-x" gnus-group-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4212 "\C-c\M-\C-x" gnus-group-expire-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4213 "V" gnus-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4214 "s" gnus-group-save-newsrc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4215 "z" gnus-group-suspend
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4216 ; "Z" gnus-group-clear-dribble
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4217 "q" gnus-group-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4218 "Q" gnus-group-quit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4219 "?" gnus-group-describe-briefly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4220 "\C-c\C-i" gnus-info-find-node
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4221 "\M-e" gnus-group-edit-group-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4222 "^" gnus-group-enter-server-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4223 gnus-mouse-2 gnus-mouse-pick-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4224 "<" beginning-of-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4225 ">" end-of-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4226 "\C-c\C-b" gnus-bug
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4227 "\C-c\C-s" gnus-group-sort-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4228 "t" gnus-topic-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4229 "\C-c\M-g" gnus-activate-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4230 "\M-&" gnus-group-universal-argument
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4231 "#" gnus-group-mark-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4232 "\M-#" gnus-group-unmark-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4233
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4234 (gnus-define-keys (gnus-group-mark-map "M" gnus-group-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4235 "m" gnus-group-mark-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4236 "u" gnus-group-unmark-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4237 "w" gnus-group-mark-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4238 "m" gnus-group-mark-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4239 "r" gnus-group-mark-regexp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4240 "U" gnus-group-unmark-all-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4241
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4242 (gnus-define-keys (gnus-group-group-map "G" gnus-group-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4243 "d" gnus-group-make-directory-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4244 "h" gnus-group-make-help-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4245 "a" gnus-group-make-archive-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4246 "k" gnus-group-make-kiboze-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4247 "m" gnus-group-make-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4248 "E" gnus-group-edit-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4249 "e" gnus-group-edit-group-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4250 "p" gnus-group-edit-group-parameters
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4251 "v" gnus-group-add-to-virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4252 "V" gnus-group-make-empty-virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4253 "D" gnus-group-enter-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4254 "f" gnus-group-make-doc-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4255 "r" gnus-group-rename-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4256 "\177" gnus-group-delete-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4257 [delete] gnus-group-delete-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4258
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4259 (gnus-define-keys (gnus-group-soup-map "s" gnus-group-group-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4260 "b" gnus-group-brew-soup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4261 "w" gnus-soup-save-areas
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4262 "s" gnus-soup-send-replies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4263 "p" gnus-soup-pack-packet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4264 "r" nnsoup-pack-replies)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4265
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4266 (gnus-define-keys (gnus-group-sort-map "S" gnus-group-group-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4267 "s" gnus-group-sort-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4268 "a" gnus-group-sort-groups-by-alphabet
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4269 "u" gnus-group-sort-groups-by-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4270 "l" gnus-group-sort-groups-by-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4271 "v" gnus-group-sort-groups-by-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4272 "r" gnus-group-sort-groups-by-rank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4273 "m" gnus-group-sort-groups-by-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4274
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4275 (gnus-define-keys (gnus-group-list-map "A" gnus-group-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4276 "k" gnus-group-list-killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4277 "z" gnus-group-list-zombies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4278 "s" gnus-group-list-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4279 "u" gnus-group-list-all-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4280 "A" gnus-group-list-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4281 "a" gnus-group-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4282 "d" gnus-group-description-apropos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4283 "m" gnus-group-list-matching
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4284 "M" gnus-group-list-all-matching
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4285 "l" gnus-group-list-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4286
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4287 (gnus-define-keys (gnus-group-score-map "W" gnus-group-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4288 "f" gnus-score-flush-cache)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4289
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4290 (gnus-define-keys (gnus-group-help-map "H" gnus-group-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4291 "f" gnus-group-fetch-faq)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4292
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4293 (gnus-define-keys (gnus-group-sub-map "S" gnus-group-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4294 "l" gnus-group-set-current-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4295 "t" gnus-group-unsubscribe-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4296 "s" gnus-group-unsubscribe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4297 "k" gnus-group-kill-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4298 "y" gnus-group-yank-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4299 "w" gnus-group-kill-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4300 "\C-k" gnus-group-kill-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4301 "z" gnus-group-kill-all-zombies))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4302
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4303 (defun gnus-group-mode ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4304 "Major mode for reading news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4305
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4306 All normal editing commands are switched off.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4307 \\<gnus-group-mode-map>
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4308 The group buffer lists (some of) the groups available. For instance,
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4309 `\\[gnus-group-list-groups]' will list all subscribed groups with unread articles, while `\\[gnus-group-list-zombies]'
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4310 lists all zombie groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4311
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4312 Groups that are displayed can be entered with `\\[gnus-group-read-group]'. To subscribe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4313 to a group not displayed, type `\\[gnus-group-unsubscribe-group]'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4314
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4315 For more in-depth information on this mode, read the manual (`\\[gnus-info-find-node]').
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4316
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4317 The following commands are available:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4318
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4319 \\{gnus-group-mode-map}"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4320 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4321 (when (and menu-bar-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4322 (gnus-visual-p 'group-menu 'menu))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4323 (gnus-group-make-menu-bar))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4324 (kill-all-local-variables)
13700
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
4325 (gnus-simplify-mode-line)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4326 (setq major-mode 'gnus-group-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4327 (setq mode-name "Group")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4328 (gnus-group-set-mode-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4329 (setq mode-line-process nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4330 (use-local-map gnus-group-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4331 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4332 (setq truncate-lines t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4333 (setq buffer-read-only t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4334 (gnus-make-local-hook 'post-command-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4335 (gnus-add-hook 'post-command-hook 'gnus-clear-inboxes-moved nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4336 (run-hooks 'gnus-group-mode-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4337
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4338 (defun gnus-clear-inboxes-moved ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4339 (setq nnmail-moved-inboxes nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4340
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4341 (defun gnus-mouse-pick-group (e)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4342 "Enter the group under the mouse pointer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4343 (interactive "e")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4344 (mouse-set-point e)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4345 (gnus-group-read-group nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4346
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4347 ;; Look at LEVEL and find out what the level is really supposed to be.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4348 ;; If LEVEL is non-nil, LEVEL will be returned, if not, what happens
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4349 ;; will depend on whether `gnus-group-use-permanent-levels' is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4350 (defun gnus-group-default-level (&optional level number-or-nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4351 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4352 (gnus-group-use-permanent-levels
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4353 (or (setq gnus-group-use-permanent-levels
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4354 (or level (if (numberp gnus-group-use-permanent-levels)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4355 gnus-group-use-permanent-levels
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4356 (or gnus-group-default-list-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4357 gnus-level-subscribed))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4358 gnus-group-default-list-level gnus-level-subscribed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4359 (number-or-nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4360 level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4361 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4362 (or level gnus-group-default-list-level gnus-level-subscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4363
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4364 ;;;###autoload
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4365 (defun gnus-slave-no-server (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4366 "Read network news as a slave, without connecting to local server"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4367 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4368 (gnus-no-server arg t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4369
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4370 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4371 (defun gnus-no-server (&optional arg slave)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4372 "Read network news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4373 If ARG is a positive number, Gnus will use that as the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4374 startup level. If ARG is nil, Gnus will be started at level 2.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4375 If ARG is non-nil and not a positive number, Gnus will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4376 prompt the user for the name of an NNTP server to use.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4377 As opposed to `gnus', this command will not connect to the local server."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4378 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4379 (let ((val (or arg (1- gnus-level-default-subscribed))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4380 (gnus val t slave)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4381 (make-local-variable 'gnus-group-use-permanent-levels)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4382 (setq gnus-group-use-permanent-levels val)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4383
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4384 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4385 (defun gnus-slave (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4386 "Read news as a slave."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4387 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4388 (gnus arg nil 'slave))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4389
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4390 ;;;###autoload
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4391 (defun gnus-other-frame (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4392 "Pop up a frame to read news."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4393 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4394 (if (get-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4395 (let ((pop-up-frames t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4396 (gnus arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4397 (select-frame (make-frame))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4398 (gnus arg)))
14359
83a980edc854 (read-news): Define as alias for gnus.
Richard M. Stallman <rms@gnu.org>
parents: 14198
diff changeset
4399
83a980edc854 (read-news): Define as alias for gnus.
Richard M. Stallman <rms@gnu.org>
parents: 14198
diff changeset
4400 ;;;###autoload
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4401 (defun gnus (&optional arg dont-connect slave)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4402 "Read network news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4403 If ARG is non-nil and a positive number, Gnus will use that as the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4404 startup level. If ARG is non-nil and not a positive number, Gnus will
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4405 prompt the user for the name of an NNTP server to use."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4406 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4407
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4408 (if (get-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4409 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4410 (switch-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4411 (gnus-group-get-new-news))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4412
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4413 (gnus-clear-system)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4414 (nnheader-init-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4415 (gnus-read-init-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4416 (setq gnus-slave slave)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4417
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4418 (gnus-group-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4419 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4420 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4421 (if (not gnus-inhibit-startup-message)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4422 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4423 (gnus-group-startup-message)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4424 (sit-for 0))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4425
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4426 (let ((level (and (numberp arg) (> arg 0) arg))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4427 did-connect)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4428 (unwind-protect
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4429 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4430 (or dont-connect
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4431 (setq did-connect
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4432 (gnus-start-news-server (and arg (not level))))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4433 (if (and (not dont-connect)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4434 (not did-connect))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4435 (gnus-group-quit)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4436 (run-hooks 'gnus-startup-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4437 ;; NNTP server is successfully open.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4438
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4439 ;; Find the current startup file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4440 (setq gnus-current-startup-file
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4441 (gnus-make-newsrc-file gnus-startup-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4442
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4443 ;; Read the dribble file.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4444 (when (or gnus-slave gnus-use-dribble-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4445 (gnus-dribble-read-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4446
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4447 ;; Allow using GroupLens predictions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4448 (when gnus-use-grouplens
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4449 (bbb-login)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4450 (add-hook 'gnus-summary-mode-hook 'gnus-grouplens-mode))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4451
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4452 (gnus-summary-make-display-table)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4453 ;; Do the actual startup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4454 (gnus-setup-news nil level dont-connect)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4455 ;; Generate the group buffer.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4456 (gnus-group-list-groups level)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4457 (gnus-group-first-unread-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4458 (gnus-configure-windows 'group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4459 (gnus-group-set-mode-line))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4460
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4461 (defun gnus-unload ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4462 "Unload all Gnus features."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4463 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4464 (or (boundp 'load-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4465 (error "Sorry, `gnus-unload' is not implemented in this Emacs version."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4466 (let ((history load-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4467 feature)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4468 (while history
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4469 (and (string-match "^\\(gnus\\|nn\\)" (caar history))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4470 (setq feature (cdr (assq 'provide (car history))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4471 (unload-feature feature 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4472 (setq history (cdr history)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4473
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4474 (defun gnus-compile ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4475 "Byte-compile the user-defined format specs."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4476 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4477 (let ((entries gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4478 entry gnus-tmp-func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4479 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4480 (gnus-message 7 "Compiling format specs...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4481
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4482 (while entries
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4483 (setq entry (pop entries))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4484 (if (eq (car entry) 'version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4485 (setq gnus-format-specs (delq entry gnus-format-specs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4486 (when (and (listp (caddr entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4487 (not (eq 'byte-code (caaddr entry))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4488 (fset 'gnus-tmp-func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4489 `(lambda () ,(caddr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4490 (byte-compile 'gnus-tmp-func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4491 (setcar (cddr entry) (gnus-byte-code 'gnus-tmp-func)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4492
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4493 (push (cons 'version emacs-version) gnus-format-specs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4494
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4495 (gnus-message 7 "Compiling user specs...done"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4496
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4497 (defun gnus-indent-rigidly (start end arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4498 "Indent rigidly using only spaces and no tabs."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4499 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4500 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4501 (narrow-to-region start end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4502 (indent-rigidly start end arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4503 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4504 (while (search-forward "\t" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4505 (replace-match " " t t)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4506
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4507 (defun gnus-group-startup-message (&optional x y)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4508 "Insert startup message in current buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4509 ;; Insert the message.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4510 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4511 (insert
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4512 (format " %s
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4513 _ ___ _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4514 _ ___ __ ___ __ _ ___
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4515 __ _ ___ __ ___
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4516 _ ___ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4517 _ _ __ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4518 ___ __ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4519 __ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4520 _ _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4521 _ _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4522 _ _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4523 __ ___
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4524 _ _ _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4525 _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4526 _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4527 _ _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4528 _
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4529 __
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4530
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4531 "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4532 ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4533 ;; And then hack it.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4534 (gnus-indent-rigidly (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4535 (/ (max (- (window-width) (or x 46)) 0) 2))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4536 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4537 (forward-line 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4538 (let* ((pheight (count-lines (point-min) (point-max)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4539 (wheight (window-height))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4540 (rest (- wheight pheight)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4541 (insert (make-string (max 0 (* 2 (/ rest 3))) ?\n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4542 ;; Fontify some.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4543 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4544 (and (search-forward "Praxis" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4545 (gnus-put-text-property (match-beginning 0) (match-end 0) 'face 'bold))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4546 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4547 (let* ((mode-string (gnus-group-set-mode-line)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4548 (setq mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4549 (list (concat gnus-version (substring (car mode-string) 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4550 (set-buffer-modified-p t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4551
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4552 (defun gnus-group-setup-buffer ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4553 (or (get-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4554 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4555 (switch-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4556 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4557 (gnus-group-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4558 (and gnus-carpal (gnus-carpal-setup-buffer 'group)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4559
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4560 (defun gnus-group-list-groups (&optional level unread lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4561 "List newsgroups with level LEVEL or lower that have unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4562 Default is all subscribed groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4563 If argument UNREAD is non-nil, groups with no unread articles are also
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4564 listed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4565 (interactive (list (if current-prefix-arg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4566 (prefix-numeric-value current-prefix-arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4567 (or
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4568 (gnus-group-default-level nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4569 gnus-group-default-list-level
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4570 gnus-level-subscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4571 (or level
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4572 (setq level (car gnus-group-list-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4573 unread (cdr gnus-group-list-mode)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4574 (setq level (gnus-group-default-level level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4575 (gnus-group-setup-buffer) ;May call from out of group buffer
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4576 (gnus-update-format-specifications)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4577 (let ((case-fold-search nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4578 (props (text-properties-at (gnus-point-at-bol)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4579 (group (gnus-group-group-name)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4580 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4581 (funcall gnus-group-prepare-function level unread lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4582 (if (zerop (buffer-size))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4583 (gnus-message 5 gnus-no-groups-message)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4584 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4585 (when (or (not gnus-group-goto-next-group-function)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4586 (not (funcall gnus-group-goto-next-group-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4587 group props)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4588 (if (not group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4589 ;; Go to the first group with unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4590 (gnus-group-search-forward t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4591 ;; Find the right group to put point on. If the current group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4592 ;; has disappeared in the new listing, try to find the next
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4593 ;; one. If no next one can be found, just leave point at the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4594 ;; first newsgroup in the buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4595 (if (not (gnus-goto-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4596 (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4597 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4598 'gnus-group (gnus-intern-safe group gnus-active-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4599 (let ((newsrc (cdddr (gnus-gethash group gnus-newsrc-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4600 (while (and newsrc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4601 (not (gnus-goto-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4602 (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4603 (point-min) (point-max) 'gnus-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4604 (gnus-intern-safe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4605 (caar newsrc) gnus-active-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4606 (setq newsrc (cdr newsrc)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4607 (or newsrc (progn (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4608 (forward-line -1)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4609 ;; Adjust cursor point.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4610 (gnus-group-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4611
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4612 (defun gnus-group-list-level (level &optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4613 "List groups on LEVEL.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4614 If ALL (the prefix), also list groups that have no unread articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4615 (interactive "nList groups on level: \nP")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4616 (gnus-group-list-groups level all level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4617
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4618 (defun gnus-group-prepare-flat (level &optional all lowest regexp)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4619 "List all newsgroups with unread articles of level LEVEL or lower.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4620 If ALL is non-nil, list groups that have no unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4621 If LOWEST is non-nil, list all newsgroups of level LOWEST or higher.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4622 If REGEXP, only list groups matching REGEXP."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4623 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4624 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4625 (newsrc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4626 (lowest (or lowest 1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4627 info clevel unread group params)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4628 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4629 (if (< lowest gnus-level-zombie)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4630 ;; List living groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4631 (while newsrc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4632 (setq info (car newsrc)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4633 group (gnus-info-group info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4634 params (gnus-info-params info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4635 newsrc (cdr newsrc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4636 unread (car (gnus-gethash group gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4637 (and unread ; This group might be bogus
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4638 (or (not regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4639 (string-match regexp group))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4640 (<= (setq clevel (gnus-info-level info)) level)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4641 (>= clevel lowest)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4642 (or all ; We list all groups?
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4643 (if (eq unread t) ; Unactivated?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4644 gnus-group-list-inactive-groups ; We list unactivated
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4645 (> unread 0)) ; We list groups with unread articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4646 (and gnus-list-groups-with-ticked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4647 (cdr (assq 'tick (gnus-info-marks info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4648 ; And groups with tickeds
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4649 ;; Check for permanent visibility.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4650 (and gnus-permanently-visible-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4651 (string-match gnus-permanently-visible-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4652 group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4653 (memq 'visible params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4654 (cdr (assq 'visible params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4655 (gnus-group-insert-group-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4656 group (gnus-info-level info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4657 (gnus-info-marks info) unread (gnus-info-method info)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4658
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4659 ;; List dead groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4660 (and (>= level gnus-level-zombie) (<= lowest gnus-level-zombie)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4661 (gnus-group-prepare-flat-list-dead
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4662 (setq gnus-zombie-list (sort gnus-zombie-list 'string<))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4663 gnus-level-zombie ?Z
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4664 regexp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4665 (and (>= level gnus-level-killed) (<= lowest gnus-level-killed)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4666 (gnus-group-prepare-flat-list-dead
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4667 (setq gnus-killed-list (sort gnus-killed-list 'string<))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4668 gnus-level-killed ?K regexp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4669
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4670 (gnus-group-set-mode-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4671 (setq gnus-group-list-mode (cons level all))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4672 (run-hooks 'gnus-group-prepare-hook)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4673
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4674 (defun gnus-group-prepare-flat-list-dead (groups level mark regexp)
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
4675 ;; List zombies and killed lists somewhat faster, which was
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4676 ;; suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>. It does
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4677 ;; this by ignoring the group format specification altogether.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4678 (let (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4679 (if regexp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4680 ;; This loop is used when listing groups that match some
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4681 ;; regexp.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4682 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4683 (setq group (pop groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4684 (when (string-match regexp group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4685 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4686 (point) (prog1 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4687 (insert " " mark " *: " group "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4688 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4689 'gnus-unread t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4690 'gnus-level level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4691 ;; This loop is used when listing all groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4692 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4693 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4694 (point) (prog1 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4695 (insert " " mark " *: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4696 (setq group (pop groups)) "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4697 (list 'gnus-group (gnus-intern-safe group gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4698 'gnus-unread t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4699 'gnus-level level))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4700
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4701 (defmacro gnus-group-real-name (group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4702 "Find the real name of a foreign newsgroup."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4703 `(let ((gname ,group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4704 (if (string-match ":[^:]+$" gname)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4705 (substring gname (1+ (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4706 gname)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4707
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4708 (defsubst gnus-server-add-address (method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4709 (let ((method-name (symbol-name (car method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4710 (if (and (memq 'address (assoc method-name gnus-valid-select-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4711 (not (assq (intern (concat method-name "-address")) method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4712 (append method (list (list (intern (concat method-name "-address"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4713 (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4714 method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4715
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4716 (defsubst gnus-server-get-method (group method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4717 ;; Input either a server name, and extended server name, or a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4718 ;; select method, and return a select method.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4719 (cond ((stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4720 (gnus-server-to-method method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4721 ((equal method gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4722 gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4723 ((and (stringp (car method)) group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4724 (gnus-server-extend-method group method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4725 ((and method (not group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4726 (equal (cadr method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4727 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4728 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4729 (gnus-server-add-address method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4730
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4731 (defun gnus-server-to-method (server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4732 "Map virtual server names to select methods."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4733 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4734 ;; Is this a method, perhaps?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4735 (and server (listp server) server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4736 ;; Perhaps this is the native server?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4737 (and (equal server "native") gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4738 ;; It should be in the server alist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4739 (cdr (assoc server gnus-server-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4740 ;; If not, we look through all the opened server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4741 ;; to see whether we can find it there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4742 (let ((opened gnus-opened-servers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4743 (while (and opened
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4744 (not (equal server (format "%s:%s" (caaar opened)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4745 (cadaar opened)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4746 (pop opened))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4747 (caar opened))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4748
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4749 (defmacro gnus-method-equal (ss1 ss2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4750 "Say whether two servers are equal."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4751 `(let ((s1 ,ss1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4752 (s2 ,ss2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4753 (or (equal s1 s2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4754 (and (= (length s1) (length s2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4755 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4756 (while (and s1 (member (car s1) s2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4757 (setq s1 (cdr s1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4758 (null s1))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4759
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4760 (defun gnus-server-equal (m1 m2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4761 "Say whether two methods are equal."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4762 (let ((m1 (cond ((null m1) gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4763 ((stringp m1) (gnus-server-to-method m1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4764 (t m1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4765 (m2 (cond ((null m2) gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4766 ((stringp m2) (gnus-server-to-method m2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4767 (t m2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4768 (gnus-method-equal m1 m2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4769
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4770 (defun gnus-servers-using-backend (backend)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4771 "Return a list of known servers using BACKEND."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4772 (let ((opened gnus-opened-servers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4773 out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4774 (while opened
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4775 (when (eq backend (caaar opened))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4776 (push (caar opened) out))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4777 (pop opened))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4778 out))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4779
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4780 (defun gnus-archive-server-wanted-p ()
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4781 "Say whether the user wants to use the archive server."
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4782 (cond
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4783 ((or (not gnus-message-archive-method)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4784 (not gnus-message-archive-group))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4785 nil)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4786 ((and gnus-message-archive-method gnus-message-archive-group)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4787 t)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4788 (t
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4789 (let ((active (cadr (assq 'nnfolder-active-file
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4790 gnus-message-archive-method))))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4791 (and active
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4792 (file-exists-p active))))))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
4793
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4794 (defun gnus-group-prefixed-name (group method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4795 "Return the whole name from GROUP and METHOD."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4796 (and (stringp method) (setq method (gnus-server-to-method method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4797 (concat (format "%s" (car method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4798 (if (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4799 (or (assoc (format "%s" (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4800 (gnus-methods-using 'address))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4801 (gnus-server-equal method gnus-message-archive-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4802 (nth 1 method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4803 (not (string= (nth 1 method) "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4804 (concat "+" (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4805 ":" group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4806
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4807 (defun gnus-group-real-prefix (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4808 "Return the prefix of the current group name."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4809 (if (string-match "^[^:]+:" group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4810 (substring group 0 (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4811 ""))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4812
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4813 (defun gnus-group-method (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4814 "Return the server or method used for selecting GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4815 (let ((prefix (gnus-group-real-prefix group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4816 (if (equal prefix "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4817 gnus-select-method
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4818 (let ((servers gnus-opened-servers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4819 (server "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4820 backend possible found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4821 (if (string-match "^[^\\+]+\\+" prefix)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4822 (setq backend (intern (substring prefix 0 (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4823 server (substring prefix (match-end 0) (1- (length prefix))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4824 (setq backend (intern (substring prefix 0 (1- (length prefix))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4825 (while servers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4826 (when (eq (caaar servers) backend)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4827 (setq possible (caar servers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4828 (when (equal (cadaar servers) server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4829 (setq found (caar servers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4830 (pop servers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4831 (or (car (rassoc found gnus-server-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4832 found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4833 (car (rassoc possible gnus-server-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4834 possible
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4835 (list backend server))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4836
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4837 (defsubst gnus-secondary-method-p (method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4838 "Return whether METHOD is a secondary select method."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4839 (let ((methods gnus-secondary-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4840 (gmethod (gnus-server-get-method nil method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4841 (while (and methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4842 (not (equal (gnus-server-get-method nil (car methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4843 gmethod)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4844 (setq methods (cdr methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4845 methods))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4846
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4847 (defun gnus-group-foreign-p (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4848 "Say whether a group is foreign or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4849 (and (not (gnus-group-native-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4850 (not (gnus-group-secondary-p group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4851
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4852 (defun gnus-group-native-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4853 "Say whether the group is native or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4854 (not (string-match ":" group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4855
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4856 (defun gnus-group-secondary-p (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4857 "Say whether the group is secondary or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4858 (gnus-secondary-method-p (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4859
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4860 (defun gnus-group-get-parameter (group &optional symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4861 "Returns the group parameters for GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4862 If SYMBOL, return the value of that symbol in the group parameters."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4863 (let ((params (gnus-info-params (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4864 (if symbol
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4865 (gnus-group-parameter-value params symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4866 params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4867
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4868 (defun gnus-group-parameter-value (params symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4869 "Return the value of SYMBOL in group PARAMS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4870 (or (car (memq symbol params)) ; It's either a simple symbol
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4871 (cdr (assq symbol params)))) ; or a cons.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4872
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4873 (defun gnus-group-add-parameter (group param)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4874 "Add parameter PARAM to GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4875 (let ((info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4876 (if (not info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4877 () ; This is a dead group. We just ignore it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4878 ;; Cons the new param to the old one and update.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4879 (gnus-group-set-info (cons param (gnus-info-params info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4880 group 'params))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4881
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4882 (defun gnus-group-set-parameter (group name value)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4883 "Set parameter NAME to VALUE in GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4884 (let ((info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4885 (if (not info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4886 () ; This is a dead group. We just ignore it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4887 (let ((old-params (gnus-info-params info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4888 (new-params (list (cons name value))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4889 (while old-params
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4890 (if (or (not (listp (car old-params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4891 (not (eq (caar old-params) name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4892 (setq new-params (append new-params (list (car old-params)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4893 (setq old-params (cdr old-params)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4894 (gnus-group-set-info new-params group 'params)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4895
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4896 (defun gnus-group-add-score (group &optional score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4897 "Add SCORE to the GROUP score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4898 If SCORE is nil, add 1 to the score of GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4899 (let ((info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4900 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4901 (gnus-info-set-score info (+ (gnus-info-score info) (or score 1))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4902
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4903 (defun gnus-summary-bubble-group ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4904 "Increase the score of the current group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4905 This is a handy function to add to `gnus-summary-exit-hook' to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4906 increase the score of each group you read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4907 (gnus-group-add-score gnus-newsgroup-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4908
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4909 (defun gnus-group-set-info (info &optional method-only-group part)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4910 (let* ((entry (gnus-gethash
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4911 (or method-only-group (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4912 gnus-newsrc-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4913 (part-info info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4914 (info (if method-only-group (nth 2 entry) info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4915 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4916 (when method-only-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4917 (unless entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4918 (error "Trying to change non-existent group %s" method-only-group))
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
4919 ;; We have received parts of the actual group info - either the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4920 ;; select method or the group parameters. We first check
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4921 ;; whether we have to extend the info, and if so, do that.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4922 (let ((len (length info))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4923 (total (if (eq part 'method) 5 6)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4924 (when (< len total)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4925 (setcdr (nthcdr (1- len) info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4926 (make-list (- total len) nil)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4927 ;; Then we enter the new info.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4928 (setcar (nthcdr (1- total) info) part-info)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4929 (unless entry
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4930 ;; This is a new group, so we just create it.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4931 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4932 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4933 (setq method (gnus-info-method info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4934 (when (gnus-server-equal method "native")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4935 (setq method nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4936 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4937 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4938 (if method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4939 ;; It's a foreign group...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4940 (gnus-group-make-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4941 (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4942 (if (stringp method) method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4943 (prin1-to-string (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4944 (and (consp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4945 (nth 1 (gnus-info-method info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4946 ;; It's a native group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4947 (gnus-group-make-group (gnus-info-group info))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4948 (gnus-message 6 "Note: New group created")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4949 (setq entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4950 (gnus-gethash (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4951 (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4952 (or (gnus-info-method info) gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4953 gnus-newsrc-hashtb))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4954 ;; Whether it was a new group or not, we now have the entry, so we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4955 ;; can do the update.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4956 (if entry
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4957 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4958 (setcar (nthcdr 2 entry) info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4959 (when (and (not (eq (car entry) t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4960 (gnus-active (gnus-info-group info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4961 (setcar entry (length (gnus-list-of-unread-articles (car info))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4962 (error "No such group: %s" (gnus-info-group info)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4963
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4964 (defun gnus-group-set-method-info (group select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4965 (gnus-group-set-info select-method group 'method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4966
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4967 (defun gnus-group-set-params-info (group params)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4968 (gnus-group-set-info params group 'params))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4969
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4970 (defun gnus-group-update-group-line ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4971 "Update the current line in the group buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4972 (let* ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4973 (group (gnus-group-group-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4974 (entry (and group (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4975 gnus-group-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4976 (when group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4977 (and entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4978 (not (gnus-ephemeral-group-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4979 (gnus-dribble-enter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4980 (concat "(gnus-group-set-info '"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4981 (prin1-to-string (nth 2 entry)) ")")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4982 (setq gnus-group-indentation (gnus-group-group-indentation))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4983 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4984 (gnus-group-insert-group-line-info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4985 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4986 (gnus-group-position-point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4987
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4988 (defun gnus-group-insert-group-line-info (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4989 "Insert GROUP on the current line."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4990 (let ((entry (gnus-gethash group gnus-newsrc-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4991 active info)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4992 (if entry
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4993 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4994 ;; (Un)subscribed group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
4995 (setq info (nth 2 entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4996 (gnus-group-insert-group-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4997 group (gnus-info-level info) (gnus-info-marks info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4998 (or (car entry) t) (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
4999 ;; This group is dead.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5000 (gnus-group-insert-group-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5001 group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5002 (if (member group gnus-zombie-list) gnus-level-zombie gnus-level-killed)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5003 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5004 (if (setq active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5005 (- (1+ (cdr active)) (car active)) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5006 nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5007
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5008 (defun gnus-group-insert-group-line (gnus-tmp-group gnus-tmp-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5009 gnus-tmp-marked number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5010 gnus-tmp-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5011 "Insert a group line in the group buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5012 (let* ((gnus-tmp-active (gnus-active gnus-tmp-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5013 (gnus-tmp-number-total
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5014 (if gnus-tmp-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5015 (1+ (- (cdr gnus-tmp-active) (car gnus-tmp-active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5016 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5017 (gnus-tmp-number-of-unread
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5018 (if (numberp number) (int-to-string (max 0 number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5019 "*"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5020 (gnus-tmp-number-of-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5021 (if (numberp number)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5022 (int-to-string (max 0 (- gnus-tmp-number-total number)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5023 "*"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5024 (gnus-tmp-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5025 (cond ((<= gnus-tmp-level gnus-level-subscribed) ? )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5026 ((<= gnus-tmp-level gnus-level-unsubscribed) ?U)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5027 ((= gnus-tmp-level gnus-level-zombie) ?Z)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5028 (t ?K)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5029 (gnus-tmp-qualified-group (gnus-group-real-name gnus-tmp-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5030 (gnus-tmp-newsgroup-description
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5031 (if gnus-description-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5032 (or (gnus-gethash gnus-tmp-group gnus-description-hashtb) "")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5033 ""))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5034 (gnus-tmp-moderated
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5035 (if (member gnus-tmp-group gnus-moderated-list) ?m ? ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5036 (gnus-tmp-moderated-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5037 (if (eq gnus-tmp-moderated ?m) "(m)" ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5038 (gnus-tmp-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5039 (gnus-server-get-method gnus-tmp-group gnus-tmp-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5040 (gnus-tmp-news-server (or (cadr gnus-tmp-method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5041 (gnus-tmp-news-method (or (car gnus-tmp-method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5042 (gnus-tmp-news-method-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5043 (if gnus-tmp-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5044 (format "(%s:%s)" (car gnus-tmp-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5045 (cadr gnus-tmp-method)) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5046 (gnus-tmp-marked-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5047 (if (and (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5048 (zerop number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5049 (cdr (assq 'tick gnus-tmp-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5050 ?* ? ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5051 (gnus-tmp-process-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5052 (if (member gnus-tmp-group gnus-group-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5053 gnus-process-mark ? ))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5054 (gnus-tmp-grouplens
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5055 (or (and gnus-use-grouplens
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5056 (bbb-grouplens-group-p gnus-tmp-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5057 ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5058 (buffer-read-only nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5059 header gnus-tmp-header) ; passed as parameter to user-funcs.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5060 (beginning-of-line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5061 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5062 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5063 (prog1 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5064 ;; Insert the text.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5065 (eval gnus-group-line-format-spec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5066 `(gnus-group ,(gnus-intern-safe gnus-tmp-group gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5067 gnus-unread ,(if (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5068 (string-to-int gnus-tmp-number-of-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5069 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5070 gnus-marked ,gnus-tmp-marked-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5071 gnus-indentation ,gnus-group-indentation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5072 gnus-level ,gnus-tmp-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5073 (when (inline (gnus-visual-p 'group-highlight 'highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5074 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5075 (run-hooks 'gnus-group-update-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5076 (forward-line))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5077 ;; Allow XEmacs to remove front-sticky text properties.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5078 (gnus-group-remove-excess-properties)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5079
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5080 (defun gnus-group-update-group (group &optional visible-only)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5081 "Update all lines where GROUP appear.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5082 If VISIBLE-ONLY is non-nil, the group won't be displayed if it isn't
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5083 already."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5084 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5085 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5086 ;; The buffer may be narrowed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5087 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5088 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5089 (let ((ident (gnus-intern-safe group gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5090 (loc (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5091 found buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5092 ;; Enter the current status into the dribble buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5093 (let ((entry (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5094 (if (and entry (not (gnus-ephemeral-group-p group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5095 (gnus-dribble-enter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5096 (concat "(gnus-group-set-info '" (prin1-to-string (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5097 ")"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5098 ;; Find all group instances. If topics are in use, each group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5099 ;; may be listed in more than once.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5100 (while (setq loc (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5101 loc (point-max) 'gnus-group ident))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5102 (setq found t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5103 (goto-char loc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5104 (let ((gnus-group-indentation (gnus-group-group-indentation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5105 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5106 (gnus-group-insert-group-line-info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5107 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5108 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5109 (run-hooks 'gnus-group-update-group-hook)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5110 (setq loc (1+ loc)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5111 (unless (or found visible-only)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5112 ;; No such line in the buffer, find out where it's supposed to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5113 ;; go, and insert it there (or at the end of the buffer).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5114 (if gnus-goto-missing-group-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5115 (funcall gnus-goto-missing-group-function group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5116 (let ((entry (cddr (gnus-gethash group gnus-newsrc-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5117 (while (and entry (car entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5118 (not
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5119 (gnus-goto-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5120 (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5121 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5122 'gnus-group (gnus-intern-safe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5123 (caar entry) gnus-active-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5124 (setq entry (cdr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5125 (or entry (goto-char (point-max)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5126 ;; Finally insert the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5127 (let ((gnus-group-indentation (gnus-group-group-indentation)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5128 (gnus-group-insert-group-line-info group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5129 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5130 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5131 (run-hooks 'gnus-group-update-group-hook))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5132 (gnus-group-set-mode-line)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5133
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5134 (defun gnus-group-set-mode-line ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5135 "Update the mode line in the group buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5136 (when (memq 'group gnus-updated-mode-lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5137 ;; Yes, we want to keep this mode line updated.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5138 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5139 (set-buffer gnus-group-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5140 (let* ((gformat (or gnus-group-mode-line-format-spec
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5141 (setq gnus-group-mode-line-format-spec
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5142 (gnus-parse-format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5143 gnus-group-mode-line-format
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5144 gnus-group-mode-line-format-alist))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5145 (gnus-tmp-news-server (cadr gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5146 (gnus-tmp-news-method (car gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5147 (gnus-tmp-colon (if (equal gnus-tmp-news-server "") "" ":"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5148 (max-len 60)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5149 gnus-tmp-header ;Dummy binding for user-defined formats
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5150 ;; Get the resulting string.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5151 (modified
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5152 (and gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5153 (buffer-name gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5154 (buffer-modified-p gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5155 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5156 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5157 (not (zerop (buffer-size))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5158 (mode-string (eval gformat)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5159 ;; Say whether the dribble buffer has been modified.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5160 (setq mode-line-modified
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5161 (if modified "---*- " "----- "))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5162 ;; If the line is too long, we chop it off.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5163 (when (> (length mode-string) max-len)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5164 (setq mode-string (substring mode-string 0 (- max-len 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5165 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5166 (setq mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5167 (gnus-mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5168 (list mode-string)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5169 (set-buffer-modified-p modified))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5170
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5171 (defun gnus-group-group-name ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5172 "Get the name of the newsgroup on the current line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5173 (let ((group (get-text-property (gnus-point-at-bol) 'gnus-group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5174 (and group (symbol-name group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5175
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5176 (defun gnus-group-group-level ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5177 "Get the level of the newsgroup on the current line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5178 (get-text-property (gnus-point-at-bol) 'gnus-level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5179
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5180 (defun gnus-group-group-indentation ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5181 "Get the indentation of the newsgroup on the current line."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5182 (or (get-text-property (gnus-point-at-bol) 'gnus-indentation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5183 (and gnus-group-indentation-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5184 (funcall gnus-group-indentation-function))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5185 ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5186
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5187 (defun gnus-group-group-unread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5188 "Get the number of unread articles of the newsgroup on the current line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5189 (get-text-property (gnus-point-at-bol) 'gnus-unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5190
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5191 (defun gnus-group-search-forward (&optional backward all level first-too)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5192 "Find the next newsgroup with unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5193 If BACKWARD is non-nil, find the previous newsgroup instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5194 If ALL is non-nil, just find any newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5195 If LEVEL is non-nil, find group with level LEVEL, or higher if no such
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5196 group exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5197 If FIRST-TOO, the current line is also eligible as a target."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5198 (let ((way (if backward -1 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5199 (low gnus-level-killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5200 (beg (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5201 pos found lev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5202 (if (and backward (progn (beginning-of-line)) (bobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5203 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5204 (or first-too (forward-line way))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5205 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5206 (not (eobp))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5207 (not (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5208 found
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5209 (and (or all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5210 (and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5211 (let ((unread
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5212 (get-text-property (point) 'gnus-unread)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5213 (and (numberp unread) (> unread 0)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5214 (setq lev (get-text-property (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5215 'gnus-level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5216 (<= lev gnus-level-subscribed)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5217 (or (not level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5218 (and (setq lev (get-text-property (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5219 'gnus-level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5220 (or (= lev level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5221 (and (< lev low)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5222 (< level lev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5223 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5224 (setq low lev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5225 (setq pos (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5226 nil))))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5227 (zerop (forward-line way)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5228 (if found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5229 (progn (gnus-group-position-point) t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5230 (goto-char (or pos beg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5231 (and pos t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5232
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5233 ;;; Gnus group mode commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5234
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5235 ;; Group marking.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5236
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5237 (defun gnus-group-mark-group (n &optional unmark no-advance)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5238 "Mark the current group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5239 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5240 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5241 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5242 (while (and (> n 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5243 (not (eobp)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5244 (when (setq group (gnus-group-group-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5245 ;; Update the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5246 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5247 (forward-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5248 (or (cdr (assq 'process gnus-group-mark-positions)) 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5249 (delete-char 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5250 (if unmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5251 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5252 (insert " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5253 (setq gnus-group-marked (delete group gnus-group-marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5254 (insert "#")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5255 (setq gnus-group-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5256 (cons group (delete group gnus-group-marked)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5257 (or no-advance (gnus-group-next-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5258 (decf n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5259 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5260 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5261
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5262 (defun gnus-group-unmark-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5263 "Remove the mark from the current group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5264 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5265 (gnus-group-mark-group n 'unmark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5266 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5267
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5268 (defun gnus-group-unmark-all-groups ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5269 "Unmark all groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5270 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5271 (let ((groups gnus-group-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5272 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5273 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5274 (gnus-group-remove-mark (pop groups)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5275 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5276
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5277 (defun gnus-group-mark-region (unmark beg end)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5278 "Mark all groups between point and mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5279 If UNMARK, remove the mark instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5280 (interactive "P\nr")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5281 (let ((num (count-lines beg end)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5282 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5283 (goto-char beg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5284 (- num (gnus-group-mark-group num unmark)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5285
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5286 (defun gnus-group-mark-buffer (&optional unmark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5287 "Mark all groups in the buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5288 If UNMARK, remove the mark instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5289 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5290 (gnus-group-mark-region unmark (point-min) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5291
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5292 (defun gnus-group-mark-regexp (regexp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5293 "Mark all groups that match some regexp."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5294 (interactive "sMark (regexp): ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5295 (let ((alist (cdr gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5296 group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5297 (while alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5298 (when (string-match regexp (setq group (gnus-info-group (pop alist))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5299 (gnus-group-set-mark group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5300 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5301
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5302 (defun gnus-group-remove-mark (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5303 "Remove the process mark from GROUP and move point there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5304 Return nil if the group isn't displayed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5305 (if (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5306 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5307 (gnus-group-mark-group 1 'unmark t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5308 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5309 (setq gnus-group-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5310 (delete group gnus-group-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5311 nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5312
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5313 (defun gnus-group-set-mark (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5314 "Set the process mark on GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5315 (if (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5316 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5317 (gnus-group-mark-group 1 nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5318 (setq gnus-group-marked (cons group (delete group gnus-group-marked)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5319
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5320 (defun gnus-group-universal-argument (arg &optional groups func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5321 "Perform any command on all groups accoring to the process/prefix convention."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5322 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5323 (let ((groups (or groups (gnus-group-process-prefix arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5324 group func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5325 (if (eq (setq func (or func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5326 (key-binding
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5327 (read-key-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5328 (substitute-command-keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5329 "\\<gnus-group-mode-map>\\[gnus-group-universal-argument]")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5330 'undefined)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5331 (gnus-error 1 "Undefined key")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5332 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5333 (gnus-group-remove-mark (setq group (pop groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5334 (command-execute func))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5335 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5336
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5337 (defun gnus-group-process-prefix (n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5338 "Return a list of groups to work on.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5339 Take into consideration N (the prefix) and the list of marked groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5340 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5341 (n
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5342 (setq n (prefix-numeric-value n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5343 ;; There is a prefix, so we return a list of the N next
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5344 ;; groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5345 (let ((way (if (< n 0) -1 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5346 (n (abs n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5347 group groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5348 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5349 (while (and (> n 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5350 (setq group (gnus-group-group-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5351 (setq groups (cons group groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5352 (setq n (1- n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5353 (gnus-group-next-group way)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5354 (nreverse groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5355 ((and (boundp 'transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5356 transient-mark-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5357 (boundp 'mark-active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5358 mark-active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5359 ;; Work on the region between point and mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5360 (let ((max (max (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5361 groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5362 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5363 (goto-char (min (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5364 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5365 (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5366 (push (gnus-group-group-name) groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5367 (zerop (gnus-group-next-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5368 (< (point) max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5369 (nreverse groups))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5370 (gnus-group-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5371 ;; No prefix, but a list of marked articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5372 (reverse gnus-group-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5373 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5374 ;; Neither marked articles or a prefix, so we return the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5375 ;; current group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5376 (let ((group (gnus-group-group-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5377 (and group (list group))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5378
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5379 ;; Selecting groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5380
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5381 (defun gnus-group-read-group (&optional all no-article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5382 "Read news in this newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5383 If the prefix argument ALL is non-nil, already read articles become
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5384 readable. IF ALL is a number, fetch this number of articles. If the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5385 optional argument NO-ARTICLE is non-nil, no article will be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5386 auto-selected upon group entry. If GROUP is non-nil, fetch that
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5387 group."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5388 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5389 (let ((group (or group (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5390 number active marked entry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5391 (or group (error "No group on current line"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5392 (setq marked (nth 3 (nth 2 (setq entry (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5393 group gnus-newsrc-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5394 ;; This group might be a dead group. In that case we have to get
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5395 ;; the number of unread articles from `gnus-active-hashtb'.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5396 (setq number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5397 (cond ((numberp all) all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5398 (entry (car entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5399 ((setq active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5400 (- (1+ (cdr active)) (car active)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5401 (gnus-summary-read-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5402 group (or all (and (numberp number)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5403 (zerop (+ number (length (cdr (assq 'tick marked)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5404 (length (cdr (assq 'dormant marked)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5405 no-article)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5406
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5407 (defun gnus-group-select-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5408 "Select this newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5409 No article is selected automatically.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5410 If ALL is non-nil, already read articles become readable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5411 If ALL is a number, fetch this number of articles."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5412 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5413 (gnus-group-read-group all t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5414
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5415 (defun gnus-group-quick-select-group (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5416 "Select the current group \"quickly\".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5417 This means that no highlighting or scoring will be performed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5418 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5419 (let (gnus-visual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5420 gnus-score-find-score-files-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5421 gnus-apply-kill-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5422 gnus-summary-expunge-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5423 (gnus-group-read-group all t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5424
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5425 (defun gnus-group-visible-select-group (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5426 "Select the current group without hiding any articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5427 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5428 (let ((gnus-inhibit-limiting t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5429 (gnus-group-read-group all t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5430
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5431 ;;;###autoload
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5432 (defun gnus-fetch-group (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5433 "Start Gnus if necessary and enter GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5434 Returns whether the fetching was successful or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5435 (interactive "sGroup name: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5436 (or (get-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5437 (gnus))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5438 (gnus-group-read-group nil nil group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5439
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5440 ;; Enter a group that is not in the group buffer. Non-nil is returned
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5441 ;; if selection was successful.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5442 (defun gnus-group-read-ephemeral-group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5443 (group method &optional activate quit-config)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5444 (let ((group (if (gnus-group-foreign-p group) group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5445 (gnus-group-prefixed-name group method))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5446 (gnus-sethash
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5447 group
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5448 `(t nil (,group ,gnus-level-default-subscribed nil nil ,method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5449 ((quit-config . ,(if quit-config quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5450 (cons (current-buffer) 'summary))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5451 gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5452 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5453 (or (gnus-check-server method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5454 (error "Unable to contact server: %s" (gnus-status-message method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5455 (if activate (or (gnus-request-group group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5456 (error "Couldn't request group")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5457 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5458 (gnus-group-read-group t t group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5459 (error nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5460 (quit nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5461
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5462 (defun gnus-group-jump-to-group (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5463 "Jump to newsgroup GROUP."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5464 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5465 (list (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5466 "Group: " gnus-active-hashtb nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5467 (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5468 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5469 'gnus-group-history)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5470
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5471 (when (equal group "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5472 (error "Empty group name"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5473
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5474 (when (string-match "[\000-\032]" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5475 (error "Control characters in group: %s" group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5476
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5477 (let ((b (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5478 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5479 'gnus-group (gnus-intern-safe group gnus-active-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5480 (unless (gnus-ephemeral-group-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5481 (if b
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5482 ;; Either go to the line in the group buffer...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5483 (goto-char b)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5484 ;; ... or insert the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5485 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5486 (gnus-active group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5487 (gnus-activate-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5488 (error "%s error: %s" group (gnus-status-message group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5489
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5490 (gnus-group-update-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5491 (goto-char (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5492 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5493 'gnus-group (gnus-intern-safe group gnus-active-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5494 ;; Adjust cursor point.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5495 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5496
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5497 (defun gnus-group-goto-group (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5498 "Goto to newsgroup GROUP."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5499 (when group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5500 (let ((b (text-property-any (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5501 'gnus-group (gnus-intern-safe
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5502 group gnus-active-hashtb))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5503 (and b (goto-char b)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5504
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5505 (defun gnus-group-next-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5506 "Go to next N'th newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5507 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5508 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5509 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5510 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5511 (gnus-group-next-unread-group n t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5512
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5513 (defun gnus-group-next-unread-group (n &optional all level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5514 "Go to next N'th unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5515 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5516 If ALL is non-nil, choose any newsgroup, unread or not.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5517 If LEVEL is non-nil, choose the next group with level LEVEL, or, if no
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5518 such group can be found, the next group with a level higher than
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5519 LEVEL.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5520 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5521 made."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5522 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5523 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5524 (n (abs n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5525 (while (and (> n 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5526 (gnus-group-search-forward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5527 backward (or (not gnus-group-goto-unread) all) level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5528 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5529 (if (/= 0 n) (gnus-message 7 "No more%s newsgroups%s" (if all "" " unread")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5530 (if level " on this level or higher" "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5531 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5532
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5533 (defun gnus-group-prev-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5534 "Go to previous N'th newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5535 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5536 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5537 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5538 (gnus-group-next-unread-group (- n) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5539
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5540 (defun gnus-group-prev-unread-group (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5541 "Go to previous N'th unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5542 Returns the difference between N and the number of skips actually
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5543 done."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5544 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5545 (gnus-group-next-unread-group (- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5546
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5547 (defun gnus-group-next-unread-group-same-level (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5548 "Go to next N'th unread newsgroup on the same level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5549 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5550 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5551 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5552 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5553 (gnus-group-next-unread-group n t (gnus-group-group-level))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5554 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5555
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5556 (defun gnus-group-prev-unread-group-same-level (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5557 "Go to next N'th unread newsgroup on the same level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5558 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5559 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5560 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5561 (gnus-group-next-unread-group (- n) t (gnus-group-group-level))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5562 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5563
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5564 (defun gnus-group-best-unread-group (&optional exclude-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5565 "Go to the group with the highest level.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5566 If EXCLUDE-GROUP, do not go to that group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5567 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5568 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5569 (let ((best 100000)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5570 unread best-point)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5571 (while (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5572 (setq unread (get-text-property (point) 'gnus-unread))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5573 (if (and (numberp unread) (> unread 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5574 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5575 (if (and (get-text-property (point) 'gnus-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5576 (< (get-text-property (point) 'gnus-level) best)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5577 (or (not exclude-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5578 (not (equal exclude-group (gnus-group-group-name)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5579 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5580 (setq best (get-text-property (point) 'gnus-level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5581 (setq best-point (point))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5582 (forward-line 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5583 (if best-point (goto-char best-point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5584 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5585 (and best-point (gnus-group-group-name))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5586
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5587 (defun gnus-group-first-unread-group ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5588 "Go to the first group with unread articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5589 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5590 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5591 (let ((opoint (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5592 unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5593 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5594 (if (or (eq (setq unread (gnus-group-group-unread)) t) ; Not active.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5595 (and (numberp unread) ; Not a topic.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5596 (not (zerop unread))) ; Has unread articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5597 (zerop (gnus-group-next-unread-group 1))) ; Next unread group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5598 (point) ; Success.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5599 (goto-char opoint)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5600 nil)) ; Not success.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5601 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5602
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5603 (defun gnus-group-enter-server-mode ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5604 "Jump to the server buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5605 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5606 (gnus-enter-server-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5607
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5608 (defun gnus-group-make-group (name &optional method address)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5609 "Add a new newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5610 The user will be prompted for a NAME, for a select METHOD, and an
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5611 ADDRESS."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5612 (interactive
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5613 (cons
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5614 (read-string "Group name: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5615 (let ((method
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5616 (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5617 "Method: " (append gnus-valid-select-methods gnus-server-alist)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5618 nil t nil 'gnus-method-history)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5619 (cond ((assoc method gnus-valid-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5620 (list method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5621 (if (memq 'prompt-address
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5622 (assoc method gnus-valid-select-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5623 (read-string "Address: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5624 "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5625 ((assoc method gnus-server-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5626 (list method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5627 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5628 (list method ""))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5629
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5630 (let* ((meth (and method (if address (list (intern method) address)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5631 method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5632 (nname (if method (gnus-group-prefixed-name name meth) name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5633 backend info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5634 (when (gnus-gethash nname gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5635 (error "Group %s already exists" nname))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5636 ;; Subscribe to the new group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5637 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5638 (setq info (list t nname gnus-level-default-subscribed nil nil meth))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5639 gnus-level-default-subscribed gnus-level-killed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5640 (and (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5641 (gnus-gethash (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5642 gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5643 t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5644 ;; Make it active.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5645 (gnus-set-active nname (cons 1 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5646 (or (gnus-ephemeral-group-p name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5647 (gnus-dribble-enter
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5648 (concat "(gnus-group-set-info '" (prin1-to-string (cdr info)) ")")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5649 ;; Insert the line.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5650 (gnus-group-insert-group-line-info nname)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5651 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5652 (gnus-group-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5653
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5654 ;; Load the backend and try to make the backend create
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5655 ;; the group as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5656 (when (assoc (symbol-name (setq backend (car (gnus-server-get-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5657 nil meth))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5658 gnus-valid-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5659 (require backend))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5660 (gnus-check-server meth)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5661 (and (gnus-check-backend-function 'request-create-group nname)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5662 (gnus-request-create-group nname))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5663 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5664
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5665 (defun gnus-group-delete-group (group &optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5666 "Delete the current group. Only meaningful with mail groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5667 If FORCE (the prefix) is non-nil, all the articles in the group will
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5668 be deleted. This is \"deleted\" as in \"removed forever from the face
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5669 of the Earth\". There is no undo. The user will be prompted before
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5670 doing the deletion."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5671 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5672 (list (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5673 current-prefix-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5674 (or group (error "No group to rename"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5675 (or (gnus-check-backend-function 'request-delete-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5676 (error "This backend does not support group deletion"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5677 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5678 (if (not (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5679 (format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5680 "Do you really want to delete %s%s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5681 group (if force " and all its contents" ""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5682 () ; Whew!
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5683 (gnus-message 6 "Deleting group %s..." group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5684 (if (not (gnus-request-delete-group group force))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5685 (gnus-error 3 "Couldn't delete group %s" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5686 (gnus-message 6 "Deleting group %s...done" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5687 (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5688 (gnus-group-kill-group 1 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5689 (gnus-sethash group nil gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5690 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5691 (gnus-group-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5692
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5693 (defun gnus-group-rename-group (group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5694 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5695 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5696 (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5697 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5698 (or (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5699 'request-rename-group (gnus-group-group-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5700 (error "This backend does not support renaming groups"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5701 (read-string "New group name: "))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5702
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5703 (or (gnus-check-backend-function 'request-rename-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5704 (error "This backend does not support renaming groups"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5705
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5706 (or group (error "No group to rename"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5707 (and (string-match "^[ \t]*$" new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5708 (error "Not a valid group name"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5709
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5710 ;; We find the proper prefixed name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5711 (setq new-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5712 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5713 (gnus-group-real-name new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5714 (gnus-info-method (gnus-get-info group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5715
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5716 (gnus-message 6 "Renaming group %s to %s..." group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5717 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5718 (if (not (gnus-request-rename-group group new-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5719 (gnus-error 3 "Couldn't rename group %s to %s" group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5720 ;; We rename the group internally by killing it...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5721 (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5722 (gnus-group-kill-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5723 ;; ... changing its name ...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5724 (setcar (cdar gnus-list-of-killed-groups) new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5725 ;; ... and then yanking it. Magic!
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5726 (gnus-group-yank-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5727 (gnus-set-active new-name (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5728 (gnus-message 6 "Renaming group %s to %s...done" group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5729 new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5730 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5731
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5732 (defun gnus-group-edit-group (group &optional part)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5733 "Edit the group on the current line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5734 (interactive (list (gnus-group-group-name)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5735 (let* ((part (or part 'info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5736 (done-func `(lambda ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5737 "Exit editing mode and update the information."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5738 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5739 (gnus-group-edit-group-done ',part ,group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5740 (winconf (current-window-configuration))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5741 info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5742 (or group (error "No group on current line"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5743 (or (setq info (gnus-get-info group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5744 (error "Killed group; can't be edited"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5745 (set-buffer (get-buffer-create gnus-group-edit-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5746 (gnus-configure-windows 'edit-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5747 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5748 (emacs-lisp-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5749 ;; Suggested by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5750 (use-local-map (copy-keymap emacs-lisp-mode-map))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5751 (local-set-key "\C-c\C-c" done-func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5752 (make-local-variable 'gnus-prev-winconf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5753 (setq gnus-prev-winconf winconf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5754 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5755 (insert
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5756 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5757 ((eq part 'method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5758 ";; Type `C-c C-c' after editing the select method.\n\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5759 ((eq part 'params)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5760 ";; Type `C-c C-c' after editing the group parameters.\n\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5761 ((eq part 'info)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5762 ";; Type `C-c C-c' after editing the group info.\n\n")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5763 (insert
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5764 (pp-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5765 (cond ((eq part 'method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5766 (or (gnus-info-method info) "native"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5767 ((eq part 'params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5768 (gnus-info-params info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5769 (t info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5770 "\n")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5771
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5772 (defun gnus-group-edit-group-method (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5773 "Edit the select method of GROUP."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5774 (interactive (list (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5775 (gnus-group-edit-group group 'method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5776
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5777 (defun gnus-group-edit-group-parameters (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5778 "Edit the group parameters of GROUP."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5779 (interactive (list (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5780 (gnus-group-edit-group group 'params))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5781
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5782 (defun gnus-group-edit-group-done (part group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5783 "Get info from buffer, update variables and jump to the group buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5784 (set-buffer (get-buffer-create gnus-group-edit-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5785 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5786 (let* ((form (read (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5787 (winconf gnus-prev-winconf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5788 (method (cond ((eq part 'info) (nth 4 form))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5789 ((eq part 'method) form)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5790 (t nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5791 (info (cond ((eq part 'info) form)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5792 ((eq part 'method) (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5793 (t nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5794 (new-group (if info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5795 (if (or (not method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5796 (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5797 gnus-select-method method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5798 (gnus-group-real-name (car info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5799 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5800 (gnus-group-real-name (car info)) method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5801 nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5802 (when (and new-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5803 (not (equal new-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5804 (when (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5805 (gnus-group-kill-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5806 (gnus-activate-group new-group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5807 ;; Set the info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5808 (if (and info new-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5809 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5810 (setq info (gnus-copy-sequence info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5811 (setcar info new-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5812 (unless (gnus-server-equal method "native")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5813 (unless (nthcdr 3 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5814 (nconc info (list nil nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5815 (unless (nthcdr 4 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5816 (nconc info (list nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5817 (gnus-info-set-method info method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5818 (gnus-group-set-info info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5819 (gnus-group-set-info form (or new-group group) part))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5820 (kill-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5821 (and winconf (set-window-configuration winconf))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5822 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5823 (gnus-group-update-group (or new-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5824 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5825
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5826 (defun gnus-group-make-help-group ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5827 "Create the Gnus documentation group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5828 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5829 (let ((path load-path)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5830 (name (gnus-group-prefixed-name "gnus-help" '(nndoc "gnus-help")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5831 file dir)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5832 (and (gnus-gethash name gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5833 (error "Documentation group already exists"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5834 (while path
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5835 (setq dir (file-name-as-directory (expand-file-name (pop path)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5836 file nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5837 (when (or (file-exists-p (setq file (concat dir "gnus-tut.txt")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5838 (file-exists-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5839 (setq file (concat (file-name-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5840 (directory-file-name dir))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5841 "etc/gnus-tut.txt"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5842 (setq path nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5843 (if (not file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5844 (gnus-message 1 "Couldn't find doc group")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5845 (gnus-group-make-group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5846 (gnus-group-real-name name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5847 (list 'nndoc "gnus-help"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5848 (list 'nndoc-address file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5849 (list 'nndoc-article-type 'mbox)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5850 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5851
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5852 (defun gnus-group-make-doc-group (file type)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5853 "Create a group that uses a single file as the source."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5854 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5855 (list (read-file-name "File name: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5856 (and current-prefix-arg 'ask)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5857 (when (eq type 'ask)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5858 (let ((err "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5859 char found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5860 (while (not found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5861 (message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5862 "%sFile type (mbox, babyl, digest, forward, mmfd, guess) [mbdfag]: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5863 err)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5864 (setq found (cond ((= (setq char (read-char)) ?m) 'mbox)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5865 ((= char ?b) 'babyl)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5866 ((= char ?d) 'digest)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5867 ((= char ?f) 'forward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5868 ((= char ?a) 'mmfd)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5869 (t (setq err (format "%c unknown. " char))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5870 nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5871 (setq type found)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5872 (let* ((file (expand-file-name file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5873 (name (gnus-generate-new-group-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5874 (gnus-group-prefixed-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5875 (file-name-nondirectory file) '(nndoc "")))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5876 (gnus-group-make-group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5877 (gnus-group-real-name name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5878 (list 'nndoc (file-name-nondirectory file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5879 (list 'nndoc-address file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5880 (list 'nndoc-article-type (or type 'guess))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5881
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5882 (defun gnus-group-make-archive-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5883 "Create the (ding) Gnus archive group of the most recent articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5884 Given a prefix, create a full group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5885 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5886 (let ((group (gnus-group-prefixed-name
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5887 (if all "ding.archives" "ding.recent") '(nndir ""))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5888 (and (gnus-gethash group gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5889 (error "Archive group already exists"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5890 (gnus-group-make-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5891 (gnus-group-real-name group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5892 (list 'nndir (if all "hpc" "edu")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5893 (list 'nndir-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5894 (if all gnus-group-archive-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5895 gnus-group-recent-archive-directory))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5896
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5897 (defun gnus-group-make-directory-group (dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5898 "Create an nndir group.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5899 The user will be prompted for a directory. The contents of this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5900 directory will be used as a newsgroup. The directory should contain
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5901 mail messages or news articles in files that have numeric names."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5902 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5903 (list (read-file-name "Create group from directory: ")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5904 (or (file-exists-p dir) (error "No such directory"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5905 (or (file-directory-p dir) (error "Not a directory"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5906 (let ((ext "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5907 (i 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5908 group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5909 (while (or (not group) (gnus-gethash group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5910 (setq group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5911 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5912 (concat (file-name-as-directory (directory-file-name dir))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5913 ext)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5914 '(nndir "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5915 (setq ext (format "<%d>" (setq i (1+ i)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5916 (gnus-group-make-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5917 (gnus-group-real-name group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5918 (list 'nndir group (list 'nndir-directory dir)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5919
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5920 (defun gnus-group-make-kiboze-group (group address scores)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5921 "Create an nnkiboze group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5922 The user will be prompted for a name, a regexp to match groups, and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5923 score file entries for articles to include in the group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5924 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5925 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5926 (read-string "nnkiboze group name: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5927 (read-string "Source groups (regexp): ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5928 (let ((headers (mapcar (lambda (group) (list group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5929 '("subject" "from" "number" "date" "message-id"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5930 "references" "chars" "lines" "xref"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5931 "followup" "all" "body" "head")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5932 scores header regexp regexps)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5933 (while (not (equal "" (setq header (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5934 "Match on header: " headers nil t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5935 (setq regexps nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5936 (while (not (equal "" (setq regexp (read-string
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5937 (format "Match on %s (string): "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5938 header)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5939 (setq regexps (cons (list regexp nil nil 'r) regexps)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5940 (setq scores (cons (cons header regexps) scores)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5941 scores)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5942 (gnus-group-make-group group "nnkiboze" address)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5943 (nnheader-temp-write (gnus-score-file-name (concat "nnkiboze:" group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5944 (let (emacs-lisp-mode-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5945 (pp scores (current-buffer)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5946
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5947 (defun gnus-group-add-to-virtual (n vgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5948 "Add the current group to a virtual group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5949 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5950 (list current-prefix-arg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5951 (completing-read "Add to virtual group: " gnus-newsrc-hashtb nil t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5952 "nnvirtual:")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5953 (or (eq (car (gnus-find-method-for-group vgroup)) 'nnvirtual)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5954 (error "%s is not an nnvirtual group" vgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5955 (let* ((groups (gnus-group-process-prefix n))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5956 (method (gnus-info-method (gnus-get-info vgroup))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5957 (setcar (cdr method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5958 (concat
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5959 (nth 1 method) "\\|"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5960 (mapconcat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5961 (lambda (s)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5962 (gnus-group-remove-mark s)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5963 (concat "\\(^" (regexp-quote s) "$\\)"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5964 groups "\\|"))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5965 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5966
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5967 (defun gnus-group-make-empty-virtual (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5968 "Create a new, fresh, empty virtual group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5969 (interactive "sCreate new, empty virtual group: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5970 (let* ((method (list 'nnvirtual "^$"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5971 (pgroup (gnus-group-prefixed-name group method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5972 ;; Check whether it exists already.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5973 (and (gnus-gethash pgroup gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5974 (error "Group %s already exists." pgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5975 ;; Subscribe the new group after the group on the current line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5976 (gnus-subscribe-group pgroup (gnus-group-group-name) method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5977 (gnus-group-update-group pgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5978 (forward-line -1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5979 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5980
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5981 (defun gnus-group-enter-directory (dir)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5982 "Enter an ephemeral nneething group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5983 (interactive "DDirectory to read: ")
15915
cba4fbcb4aa0 (gnus-group-enter-directory): Virtual server definition
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15914
diff changeset
5984 (let* ((method (list 'nneething dir '(nneething-read-only t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5985 (leaf (gnus-group-prefixed-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5986 (file-name-nondirectory (directory-file-name dir))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5987 method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5988 (name (gnus-generate-new-group-name leaf)))
15914
68b9d495fe4f Sat Aug 24 23:32:02 1996 Lars Magne Ingebrigtsen <larsi@ylfing.ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15669
diff changeset
5989 (unless (gnus-group-read-ephemeral-group
68b9d495fe4f Sat Aug 24 23:32:02 1996 Lars Magne Ingebrigtsen <larsi@ylfing.ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15669
diff changeset
5990 name method t
68b9d495fe4f Sat Aug 24 23:32:02 1996 Lars Magne Ingebrigtsen <larsi@ylfing.ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15669
diff changeset
5991 (cons (current-buffer)
68b9d495fe4f Sat Aug 24 23:32:02 1996 Lars Magne Ingebrigtsen <larsi@ylfing.ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15669
diff changeset
5992 (if (eq major-mode 'gnus-summary-mode)
68b9d495fe4f Sat Aug 24 23:32:02 1996 Lars Magne Ingebrigtsen <larsi@ylfing.ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15669
diff changeset
5993 'summary 'group)))
68b9d495fe4f Sat Aug 24 23:32:02 1996 Lars Magne Ingebrigtsen <larsi@ylfing.ifi.uio.no>
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15669
diff changeset
5994 (error "Couldn't enter %s" dir))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5995
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5996 ;; Group sorting commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5997 ;; Suggested by Joe Hildebrand <hildjj@idaho.fuentez.com>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
5998
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
5999 (defun gnus-group-sort-groups (func &optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6000 "Sort the group buffer according to FUNC.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6001 If REVERSE, reverse the sorting order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6002 (interactive (list gnus-group-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6003 current-prefix-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6004 (let ((func (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6005 ((not (listp func)) func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6006 ((null func) func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6007 ((= 1 (length func)) (car func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6008 (t `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6009 ,(gnus-make-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6010 (reverse func)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6011 ;; We peel off the dummy group from the alist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6012 (when func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6013 (when (equal (car (gnus-info-group gnus-newsrc-alist)) "dummy.group")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6014 (pop gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6015 ;; Do the sorting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6016 (setq gnus-newsrc-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6017 (sort gnus-newsrc-alist func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6018 (when reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6019 (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6020 ;; Regenerate the hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6021 (gnus-make-hashtable-from-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6022 (gnus-group-list-groups))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6023
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6024 (defun gnus-group-sort-groups-by-alphabet (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6025 "Sort the group buffer alphabetically by group name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6026 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6027 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6028 (gnus-group-sort-groups 'gnus-group-sort-by-alphabet reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6029
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6030 (defun gnus-group-sort-groups-by-unread (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6031 "Sort the group buffer by number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6032 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6033 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6034 (gnus-group-sort-groups 'gnus-group-sort-by-unread reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6035
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6036 (defun gnus-group-sort-groups-by-level (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6037 "Sort the group buffer by group level.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6038 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6039 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6040 (gnus-group-sort-groups 'gnus-group-sort-by-level reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6041
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6042 (defun gnus-group-sort-groups-by-score (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6043 "Sort the group buffer by group score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6044 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6045 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6046 (gnus-group-sort-groups 'gnus-group-sort-by-score reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6047
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6048 (defun gnus-group-sort-groups-by-rank (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6049 "Sort the group buffer by group rank.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6050 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6051 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6052 (gnus-group-sort-groups 'gnus-group-sort-by-rank reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6053
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6054 (defun gnus-group-sort-groups-by-method (&optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6055 "Sort the group buffer alphabetically by backend name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6056 If REVERSE, sort in reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6057 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6058 (gnus-group-sort-groups 'gnus-group-sort-by-method reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6059
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6060 (defun gnus-group-sort-by-alphabet (info1 info2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6061 "Sort alphabetically."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6062 (string< (gnus-info-group info1) (gnus-info-group info2)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6063
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6064 (defun gnus-group-sort-by-unread (info1 info2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6065 "Sort by number of unread articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6066 (let ((n1 (car (gnus-gethash (gnus-info-group info1) gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6067 (n2 (car (gnus-gethash (gnus-info-group info2) gnus-newsrc-hashtb))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6068 (< (or (and (numberp n1) n1) 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6069 (or (and (numberp n2) n2) 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6070
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6071 (defun gnus-group-sort-by-level (info1 info2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6072 "Sort by level."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6073 (< (gnus-info-level info1) (gnus-info-level info2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6074
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6075 (defun gnus-group-sort-by-method (info1 info2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6076 "Sort alphabetically by backend name."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6077 (string< (symbol-name (car (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6078 (gnus-info-group info1) info1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6079 (symbol-name (car (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6080 (gnus-info-group info2) info2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6081
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6082 (defun gnus-group-sort-by-score (info1 info2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6083 "Sort by group score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6084 (< (gnus-info-score info1) (gnus-info-score info2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6085
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6086 (defun gnus-group-sort-by-rank (info1 info2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6087 "Sort by level and score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6088 (let ((level1 (gnus-info-level info1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6089 (level2 (gnus-info-level info2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6090 (or (< level1 level2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6091 (and (= level1 level2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6092 (> (gnus-info-score info1) (gnus-info-score info2))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6093
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6094 ;; Group catching up.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6095
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6096 (defun gnus-group-clear-data (n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6097 "Clear all marks and read ranges from the current group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6098 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6099 (let ((groups (gnus-group-process-prefix n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6100 group info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6101 (while (setq group (pop groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6102 (setq info (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6103 (gnus-info-set-read info nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6104 (when (gnus-info-marks info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6105 (gnus-info-set-marks info nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6106 (gnus-get-unread-articles-in-group info (gnus-active group) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6107 (when (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6108 (gnus-group-remove-mark group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6109 (gnus-group-update-group-line)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6110
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6111 (defun gnus-group-catchup-current (&optional n all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6112 "Mark all articles not marked as unread in current newsgroup as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6113 If prefix argument N is numeric, the ARG next newsgroups will be
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6114 caught up. If ALL is non-nil, marked articles will also be marked as
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6115 read. Cross references (Xref: header) of articles are ignored.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6116 The difference between N and actual number of newsgroups that were
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6117 caught up is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6118 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6119 (unless (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6120 (error "No group on the current line"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6121 (if (not (or (not gnus-interactive-catchup) ;Without confirmation?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6122 gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6123 (gnus-y-or-n-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6124 (if all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6125 "Do you really want to mark all articles as read? "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6126 "Mark all unread articles as read? "))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6127 n
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6128 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6129 (ret 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6130 (while groups
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6131 ;; Virtual groups have to be given special treatment.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6132 (let ((method (gnus-find-method-for-group (car groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6133 (if (eq 'nnvirtual (car method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6134 (nnvirtual-catchup-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6135 (gnus-group-real-name (car groups)) (nth 1 method) all)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6136 (gnus-group-remove-mark (car groups))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6137 (if (>= (gnus-group-group-level) gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6138 (gnus-message 2 "Dead groups can't be caught up")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6139 (if (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6140 (gnus-group-goto-group (car groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6141 (gnus-group-catchup (car groups) all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6142 (gnus-group-update-group-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6143 (setq ret (1+ ret))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6144 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6145 (gnus-group-next-unread-group 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6146 ret)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6147
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6148 (defun gnus-group-catchup-current-all (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6149 "Mark all articles in current newsgroup as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6150 Cross references (Xref: header) of articles are ignored."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6151 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6152 (gnus-group-catchup-current n 'all))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6153
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6154 (defun gnus-group-catchup (group &optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6155 "Mark all articles in GROUP as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6156 If ALL is non-nil, all articles are marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6157 The return value is the number of articles that were marked as read,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6158 or nil if no action could be taken."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6159 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6160 (num (car entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6161 ;; Do the updating only if the newsgroup isn't killed.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6162 (if (not (numberp (car entry)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6163 (gnus-message 1 "Can't catch up; non-active group")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6164 ;; Do auto-expirable marks if that's required.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6165 (when (gnus-group-auto-expirable-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6166 (gnus-add-marked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6167 group 'expire (gnus-list-of-unread-articles group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6168 (when all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6169 (let ((marks (nth 3 (nth 2 entry))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6170 (gnus-add-marked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6171 group 'expire (gnus-uncompress-range (cdr (assq 'tick marks))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6172 (gnus-add-marked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6173 group 'expire (gnus-uncompress-range (cdr (assq 'tick marks)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6174 (when entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6175 (gnus-update-read-articles group nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6176 ;; Also nix out the lists of marks and dormants.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6177 (when all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6178 (gnus-add-marked-articles group 'tick nil nil 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6179 (gnus-add-marked-articles group 'dormant nil nil 'force))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6180 (run-hooks 'gnus-group-catchup-group-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6181 num))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6182
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6183 (defun gnus-group-expire-articles (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6184 "Expire all expirable articles in the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6185 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6186 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6187 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6188 (unless groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6189 (error "No groups to expire"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6190 (while (setq group (pop groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6191 (gnus-group-remove-mark group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6192 (when (gnus-check-backend-function 'request-expire-articles group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6193 (gnus-message 6 "Expiring articles in %s..." group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6194 (let* ((info (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6195 (expirable (if (gnus-group-total-expirable-p group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6196 (cons nil (gnus-list-of-read-articles group))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6197 (assq 'expire (gnus-info-marks info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6198 (expiry-wait (gnus-group-get-parameter group 'expiry-wait)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6199 (when expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6200 (setcdr
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6201 expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6202 (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6203 (if expiry-wait
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6204 ;; We set the expiry variables to the groupp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6205 ;; parameter.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6206 (let ((nnmail-expiry-wait-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6207 (nnmail-expiry-wait expiry-wait))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6208 (gnus-request-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6209 (gnus-uncompress-sequence (cdr expirable)) group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6210 ;; Just expire using the normal expiry values.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6211 (gnus-request-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6212 (gnus-uncompress-sequence (cdr expirable)) group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6213 (gnus-close-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6214 (gnus-message 6 "Expiring articles in %s...done" group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6215 (gnus-group-position-point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6216
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6217 (defun gnus-group-expire-all-groups ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6218 "Expire all expirable articles in all newsgroups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6219 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6220 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6221 (gnus-message 5 "Expiring...")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6222 (let ((gnus-group-marked (mapcar (lambda (info) (gnus-info-group info))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6223 (cdr gnus-newsrc-alist))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6224 (gnus-group-expire-articles nil)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6225 (gnus-group-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6226 (gnus-message 5 "Expiring...done"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6227
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6228 (defun gnus-group-set-current-level (n level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6229 "Set the level of the next N groups to LEVEL."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6230 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6231 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6232 current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6233 (string-to-int
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6234 (let ((s (read-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6235 (format "Level (default %s): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6236 (or (gnus-group-group-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6237 gnus-level-default-subscribed)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6238 (if (string-match "^\\s-*$" s)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6239 (int-to-string (or (gnus-group-group-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6240 gnus-level-default-subscribed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6241 s)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6242 (or (and (>= level 1) (<= level gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6243 (error "Illegal level: %d" level))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6244 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6245 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6246 (while (setq group (pop groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6247 (gnus-group-remove-mark group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6248 (gnus-message 6 "Changed level of %s from %d to %d"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6249 group (or (gnus-group-group-level) gnus-level-killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6250 level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6251 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6252 group level (or (gnus-group-group-level) gnus-level-killed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6253 (gnus-group-update-group-line)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6254 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6255
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6256 (defun gnus-group-unsubscribe-current-group (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6257 "Toggle subscription of the current group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6258 If given numerical prefix, toggle the N next groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6259 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6260 (let ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6261 group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6262 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6263 (setq group (car groups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6264 groups (cdr groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6265 (gnus-group-remove-mark group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6266 (gnus-group-unsubscribe-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6267 group (if (<= (gnus-group-group-level) gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6268 gnus-level-default-unsubscribed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6269 gnus-level-default-subscribed) t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6270 (gnus-group-update-group-line))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6271 (gnus-group-next-group 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6272
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6273 (defun gnus-group-unsubscribe-group (group &optional level silent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6274 "Toggle subscription to GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6275 Killed newsgroups are subscribed. If SILENT, don't try to update the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6276 group line."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6277 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6278 (list (completing-read
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6279 "Group: " gnus-active-hashtb nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6280 (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6281 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6282 'gnus-group-history)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6283 (let ((newsrc (gnus-gethash group gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6284 (cond
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6285 ((string-match "^[ \t]$" group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6286 (error "Empty group name"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6287 (newsrc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6288 ;; Toggle subscription flag.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6289 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6290 newsrc (if level level (if (<= (nth 1 (nth 2 newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6291 gnus-level-subscribed)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6292 (1+ gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6293 gnus-level-default-subscribed)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6294 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6295 (gnus-group-update-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6296 ((and (stringp group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6297 (or (not (gnus-read-active-file-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6298 (gnus-active group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6299 ;; Add new newsgroup.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6300 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6301 group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6302 (if level level gnus-level-default-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6303 (or (and (member group gnus-zombie-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6304 gnus-level-zombie)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6305 gnus-level-killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6306 (and (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6307 (gnus-gethash (gnus-group-group-name) gnus-newsrc-hashtb)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6308 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6309 (gnus-group-update-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6310 (t (error "No such newsgroup: %s" group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6311 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6312
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6313 (defun gnus-group-transpose-groups (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6314 "Move the current newsgroup up N places.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6315 If given a negative prefix, move down instead. The difference between
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6316 N and the number of steps taken is returned."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6317 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6318 (or (gnus-group-group-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6319 (error "No group on current line"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6320 (gnus-group-kill-group 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6321 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6322 (forward-line (- n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6323 (gnus-group-yank-group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6324 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6325
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6326 (defun gnus-group-kill-all-zombies ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6327 "Kill all zombie newsgroups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6328 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6329 (setq gnus-killed-list (nconc gnus-zombie-list gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6330 (setq gnus-zombie-list nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6331 (gnus-group-list-groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6332
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6333 (defun gnus-group-kill-region (begin end)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6334 "Kill newsgroups in current region (excluding current point).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6335 The killed newsgroups can be yanked by using \\[gnus-group-yank-group]."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6336 (interactive "r")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6337 (let ((lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6338 ;; Count lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6339 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6340 (count-lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6341 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6342 (goto-char begin)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6343 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6344 (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6345 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6346 (goto-char end)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6347 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6348 (point))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6349 (goto-char begin)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6350 (beginning-of-line) ;Important when LINES < 1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6351 (gnus-group-kill-group lines)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6352
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6353 (defun gnus-group-kill-group (&optional n discard)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6354 "Kill the next N groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6355 The killed newsgroups can be yanked by using \\[gnus-group-yank-group].
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6356 However, only groups that were alive can be yanked; already killed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6357 groups or zombie groups can't be yanked.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6358 The return value is the name of the group that was killed, or a list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6359 of groups killed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6360 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6361 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6362 (groups (gnus-group-process-prefix n))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6363 group entry level out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6364 (if (< (length groups) 10)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6365 ;; This is faster when there are few groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6366 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6367 (push (setq group (pop groups)) out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6368 (gnus-group-remove-mark group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6369 (setq level (gnus-group-group-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6370 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6371 (when (and (not discard)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6372 (setq entry (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6373 (push (cons (car entry) (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6374 gnus-list-of-killed-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6375 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6376 (if entry entry group) gnus-level-killed (if entry nil level)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6377 ;; If there are lots and lots of groups to be killed, we use
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6378 ;; this thing instead.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6379 (let (entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6380 (setq groups (nreverse groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6381 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6382 (gnus-group-remove-mark (setq group (pop groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6383 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6384 (push group gnus-killed-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6385 (setq gnus-newsrc-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6386 (delq (assoc group gnus-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6387 gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6388 (when gnus-group-change-level-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6389 (funcall gnus-group-change-level-function group 9 3))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6390 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6391 ((setq entry (gnus-gethash group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6392 (push (cons (car entry) (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6393 gnus-list-of-killed-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6394 (setcdr (cdr entry) (cdddr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6395 ((member group gnus-zombie-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6396 (setq gnus-zombie-list (delete group gnus-zombie-list)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6397 (gnus-make-hashtable-from-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6398
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6399 (gnus-group-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6400 (if (< (length out) 2) (car out) (nreverse out))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6402 (defun gnus-group-yank-group (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6403 "Yank the last newsgroups killed with \\[gnus-group-kill-group],
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6404 inserting it before the current newsgroup. The numeric ARG specifies
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6405 how many newsgroups are to be yanked. The name of the newsgroup yanked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6406 is returned, or (if several groups are yanked) a list of yanked groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6407 is returned."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6408 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6409 (setq arg (or arg 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6410 (let (info group prev out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6411 (while (>= (decf arg) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6412 (if (not (setq info (pop gnus-list-of-killed-groups)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6413 (error "No more newsgroups to yank"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6414 (push (setq group (nth 1 info)) out)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6415 ;; Find which newsgroup to insert this one before - search
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6416 ;; backward until something suitable is found. If there are no
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6417 ;; other newsgroups in this buffer, just make this newsgroup the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6418 ;; first newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6419 (setq prev (gnus-group-group-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6420 (gnus-group-change-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6421 info (gnus-info-level (cdr info)) gnus-level-killed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6422 (and prev (gnus-gethash prev gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6423 t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6424 (gnus-group-insert-group-line-info group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6425 (forward-line -1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6426 (gnus-group-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6427 (if (< (length out) 2) (car out) (nreverse out))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6428
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6429 (defun gnus-group-kill-level (level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6430 "Kill all groups that is on a certain LEVEL."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6431 (interactive "nKill all groups on level: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6432 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6433 ((= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6434 (setq gnus-killed-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6435 (nconc gnus-zombie-list gnus-killed-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6436 (setq gnus-zombie-list nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6437 ((and (< level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6438 (> level 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6439 (or gnus-expert-user
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6440 (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6441 (format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6442 "Do you really want to kill all groups on level %d? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6443 level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6444 (let* ((prev gnus-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6445 (alist (cdr prev)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6446 (while alist
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6447 (if (= (gnus-info-level (car alist)) level)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6448 (progn
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6449 (push (gnus-info-group (car alist)) gnus-killed-list)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6450 (setcdr prev (cdr alist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6451 (setq prev alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6452 (setq alist (cdr alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6453 (gnus-make-hashtable-from-newsrc-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6454 (gnus-group-list-groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6455 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6456 (error "Can't kill; illegal level: %d" level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6457
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6458 (defun gnus-group-list-all-groups (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6459 "List all newsgroups with level ARG or lower.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6460 Default is gnus-level-unsubscribed, which lists all subscribed and most
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6461 unsubscribed groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6462 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6463 (gnus-group-list-groups (or arg gnus-level-unsubscribed) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6464
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6465 ;; Redefine this to list ALL killed groups if prefix arg used.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6466 ;; Rewritten by engstrom@src.honeywell.com (Eric Engstrom).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6467 (defun gnus-group-list-killed (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6468 "List all killed newsgroups in the group buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6469 If ARG is non-nil, list ALL killed groups known to Gnus. This may
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6470 entail asking the server for the groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6471 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6472 ;; Find all possible killed newsgroups if arg.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6473 (when arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6474 (gnus-get-killed-groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6475 (if (not gnus-killed-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6476 (gnus-message 6 "No killed groups")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6477 (let (gnus-group-list-mode)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6478 (funcall gnus-group-prepare-function
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6479 gnus-level-killed t gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6480 (goto-char (point-min)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6481 (gnus-group-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6482
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6483 (defun gnus-group-list-zombies ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6484 "List all zombie newsgroups in the group buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6485 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6486 (if (not gnus-zombie-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6487 (gnus-message 6 "No zombie groups")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6488 (let (gnus-group-list-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6489 (funcall gnus-group-prepare-function
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6490 gnus-level-zombie t gnus-level-zombie))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6491 (goto-char (point-min)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6492 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6493
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6494 (defun gnus-group-list-active ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6495 "List all groups that are available from the server(s)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6496 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6497 ;; First we make sure that we have really read the active file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6498 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6499 (let ((gnus-read-active-file t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6500 (gnus-read-active-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6501 ;; Find all groups and sort them.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6502 (let ((groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6503 (sort
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6504 (let (list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6505 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6506 (lambda (sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6507 (and (boundp sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6508 (symbol-value sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6509 (setq list (cons (symbol-name sym) list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6510 gnus-active-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6511 list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6512 'string<))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6513 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6514 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6515 (while groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6516 (gnus-group-insert-group-line-info (pop groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6517 (goto-char (point-min))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6518
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6519 (defun gnus-activate-all-groups (level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6520 "Activate absolutely all groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6521 (interactive (list 7))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6522 (let ((gnus-activate-level level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6523 (gnus-activate-foreign-newsgroups level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6524 (gnus-group-get-new-news)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6525
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6526 (defun gnus-group-get-new-news (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6527 "Get newly arrived articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6528 If ARG is a number, it specifies which levels you are interested in
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6529 re-scanning. If ARG is non-nil and not a number, this will force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6530 \"hard\" re-reading of the active files from all servers."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6531 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6532 (run-hooks 'gnus-get-new-news-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6533 ;; We might read in new NoCeM messages here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6534 (when (and gnus-use-nocem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6535 (null arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6536 (gnus-nocem-scan-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6537 ;; If ARG is not a number, then we read the active file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6538 (when (and arg (not (numberp arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6539 (let ((gnus-read-active-file t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6540 (gnus-read-active-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6541 (setq arg nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6542
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6543 (setq arg (gnus-group-default-level arg t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6544 (if (and gnus-read-active-file (not arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6545 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6546 (gnus-read-active-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6547 (gnus-get-unread-articles arg))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6548 (let ((gnus-read-active-file (if arg nil gnus-read-active-file)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6549 (gnus-get-unread-articles arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6550 (run-hooks 'gnus-after-getting-new-news-hook)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6551 (gnus-group-list-groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6552
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6553 (defun gnus-group-get-new-news-this-group (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6554 "Check for newly arrived news in the current group (and the N-1 next groups).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6555 The difference between N and the number of newsgroup checked is returned.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6556 If N is negative, this group and the N-1 previous groups will be checked."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6557 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6558 (let* ((groups (gnus-group-process-prefix n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6559 (ret (if (numberp n) (- n (length groups)) 0))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6560 (beg (unless n (point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6561 group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6562 (while (setq group (pop groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6563 (gnus-group-remove-mark group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6564 (if (gnus-activate-group group 'scan)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6565 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6566 (gnus-get-unread-articles-in-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6567 (gnus-get-info group) (gnus-active group) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6568 (unless (gnus-virtual-group-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6569 (gnus-close-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6570 (gnus-group-update-group group))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6571 (if (eq (gnus-server-status (gnus-find-method-for-group group))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6572 'denied)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6573 (gnus-error "Server denied access")
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6574 (gnus-error 3 "%s error: %s" group (gnus-status-message group)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6575 (when beg (goto-char beg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6576 (when gnus-goto-next-group-when-activating
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6577 (gnus-group-next-unread-group 1 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6578 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6579 ret))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6580
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6581 (defun gnus-group-fetch-faq (group &optional faq-dir)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6582 "Fetch the FAQ for the current group."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6583 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6584 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6585 (and (gnus-group-group-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6586 (gnus-group-real-name (gnus-group-group-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6587 (cond (current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6588 (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6589 "Faq dir: " (and (listp gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6590 (mapcar (lambda (file) (list file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6591 gnus-group-faq-directory)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6592 (or faq-dir
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6593 (setq faq-dir (if (listp gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6594 (car gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6595 gnus-group-faq-directory)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6596 (or group (error "No group name given"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6597 (let ((file (concat (file-name-as-directory faq-dir)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6598 (gnus-group-real-name group))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6599 (if (not (file-exists-p file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6600 (error "No such file: %s" file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6601 (find-file file))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6602
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6603 (defun gnus-group-describe-group (force &optional group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6604 "Display a description of the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6605 (interactive (list current-prefix-arg (gnus-group-group-name)))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6606 (let* ((method (gnus-find-method-for-group group))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6607 (mname (gnus-group-prefixed-name "" method))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6608 desc)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6609 (when (and force
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6610 gnus-description-hashtb)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6611 (gnus-sethash mname nil gnus-description-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6612 (or group (error "No group name given"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6613 (and (or (and gnus-description-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6614 ;; We check whether this group's method has been
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6615 ;; queried for a description file.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
6616 (gnus-gethash mname gnus-description-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6617 (setq desc (gnus-group-get-description group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6618 (gnus-read-descriptions-file method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6619 (gnus-message 1
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6620 (or desc (gnus-gethash group gnus-description-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6621 "No description available")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6622
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6623 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6624 (defun gnus-group-describe-all-groups (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6625 "Pop up a buffer with descriptions of all newsgroups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6626 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6627 (and force (setq gnus-description-hashtb nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6628 (if (not (or gnus-description-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6629 (gnus-read-all-descriptions-files)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6630 (error "Couldn't request descriptions file"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6631 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6632 b)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6633 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6634 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6635 (lambda (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6636 (setq b (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6637 (insert (format " *: %-20s %s\n" (symbol-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6638 (symbol-value group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6639 (gnus-add-text-properties
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6640 b (1+ b) (list 'gnus-group group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6641 'gnus-unread t 'gnus-marked nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6642 'gnus-level (1+ gnus-level-subscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6643 gnus-description-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6644 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6645 (gnus-group-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6646
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6647 ;; Suggested by by Daniel Quinlan <quinlan@best.com>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6648 (defun gnus-group-apropos (regexp &optional search-description)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6649 "List all newsgroups that have names that match a regexp."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6650 (interactive "sGnus apropos (regexp): ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6651 (let ((prev "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6652 (obuf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6653 groups des)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6654 ;; Go through all newsgroups that are known to Gnus.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6655 (mapatoms
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6656 (lambda (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6657 (and (symbol-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6658 (string-match regexp (symbol-name group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6659 (setq groups (cons (symbol-name group) groups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6660 gnus-active-hashtb)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6661 ;; Also go through all descriptions that are known to Gnus.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6662 (when search-description
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6663 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6664 (lambda (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6665 (and (string-match regexp (symbol-value group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6666 (gnus-active (symbol-name group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6667 (setq groups (cons (symbol-name group) groups))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6668 gnus-description-hashtb))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6669 (if (not groups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6670 (gnus-message 3 "No groups matched \"%s\"." regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6671 ;; Print out all the groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6672 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6673 (pop-to-buffer "*Gnus Help*")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6674 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6675 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6676 (setq groups (sort groups 'string<))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6677 (while groups
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6678 ;; Groups may be entered twice into the list of groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6679 (if (not (string= (car groups) prev))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6680 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6681 (insert (setq prev (car groups)) "\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6682 (if (and gnus-description-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6683 (setq des (gnus-gethash (car groups)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6684 gnus-description-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6685 (insert " " des "\n"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6686 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6687 (goto-char (point-min))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6688 (pop-to-buffer obuf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6689
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6690 (defun gnus-group-description-apropos (regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6691 "List all newsgroups that have names or descriptions that match a regexp."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6692 (interactive "sGnus description apropos (regexp): ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6693 (if (not (or gnus-description-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6694 (gnus-read-all-descriptions-files)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6695 (error "Couldn't request descriptions file"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6696 (gnus-group-apropos regexp t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6697
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6698 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6699 (defun gnus-group-list-matching (level regexp &optional all lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6700 "List all groups with unread articles that match REGEXP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6701 If the prefix LEVEL is non-nil, it should be a number that says which
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6702 level to cut off listing groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6703 If ALL, also list groups with no unread articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6704 If LOWEST, don't list groups with level lower than LOWEST.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6705
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6706 This command may read the active file."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6707 (interactive "P\nsList newsgroups matching: ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6708 ;; First make sure active file has been read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6709 (when (and level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6710 (> (prefix-numeric-value level) gnus-level-killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6711 (gnus-get-killed-groups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6712 (gnus-group-prepare-flat (or level gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6713 all (or lowest 1) regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6714 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6715 (gnus-group-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6716
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6717 (defun gnus-group-list-all-matching (level regexp &optional lowest)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6718 "List all groups that match REGEXP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6719 If the prefix LEVEL is non-nil, it should be a number that says which
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6720 level to cut off listing groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6721 If LOWEST, don't list groups with level lower than LOWEST."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6722 (interactive "P\nsList newsgroups matching: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6723 (gnus-group-list-matching (or level gnus-level-killed) regexp t lowest))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6724
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6725 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6726 (defun gnus-group-save-newsrc (&optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6727 "Save the Gnus startup files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6728 If FORCE, force saving whether it is necessary or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6729 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6730 (gnus-save-newsrc-file force))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6731
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6732 (defun gnus-group-restart (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6733 "Force Gnus to read the .newsrc file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6734 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6735 (when (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6736 (format "Are you sure you want to read %s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6737 gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6738 (gnus-save-newsrc-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6739 (gnus-setup-news 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6740 (gnus-group-list-groups arg)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6741
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6742 (defun gnus-group-read-init-file ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6743 "Read the Gnus elisp init file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6744 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6745 (gnus-read-init-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6746
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6747 (defun gnus-group-check-bogus-groups (&optional silent)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6748 "Check bogus newsgroups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6749 If given a prefix, don't ask for confirmation before removing a bogus
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6750 group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6751 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6752 (gnus-check-bogus-newsgroups (and (not silent) (not gnus-expert-user)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6753 (gnus-group-list-groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6754
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6755 (defun gnus-group-edit-global-kill (&optional article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6756 "Edit the global kill file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6757 If GROUP, edit that local kill file instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6758 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6759 (setq gnus-current-kill-article article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6760 (gnus-kill-file-edit-file group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6761 (gnus-message
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6762 6
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6763 (substitute-command-keys
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6764 (format "Editing a %s kill file (Type \\[gnus-kill-file-exit] to exit)"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6765 (if group "local" "global")))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6766
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6767 (defun gnus-group-edit-local-kill (article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6768 "Edit a local kill file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6769 (interactive (list nil (gnus-group-group-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6770 (gnus-group-edit-global-kill article group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6771
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6772 (defun gnus-group-force-update ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6773 "Update `.newsrc' file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6774 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6775 (gnus-save-newsrc-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6776
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6777 (defun gnus-group-suspend ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6778 "Suspend the current Gnus session.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6779 In fact, cleanup buffers except for group mode buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6780 The hook gnus-suspend-gnus-hook is called before actually suspending."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6781 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6782 (run-hooks 'gnus-suspend-gnus-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6783 ;; Kill Gnus buffers except for group mode buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6784 (let* ((group-buf (get-buffer gnus-group-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6785 ;; Do this on a separate list in case the user does a ^G before we finish
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6786 (gnus-buffer-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6787 (delete group-buf (delete gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6788 (append gnus-buffer-list nil)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6789 (while gnus-buffer-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6790 (gnus-kill-buffer (pop gnus-buffer-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6791 (gnus-kill-gnus-frames)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6792 (when group-buf
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6793 (setq gnus-buffer-list (list group-buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6794 (bury-buffer group-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6795 (delete-windows-on group-buf t))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6796
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6797 (defun gnus-group-clear-dribble ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6798 "Clear all information from the dribble buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6799 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6800 (gnus-dribble-clear)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6801 (gnus-message 7 "Cleared dribble buffer"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6802
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6803 (defun gnus-group-exit ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6804 "Quit reading news after updating .newsrc.eld and .newsrc.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6805 The hook `gnus-exit-gnus-hook' is called before actually exiting."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6806 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6807 (when
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6808 (or noninteractive ;For gnus-batch-kill
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6809 (not gnus-interactive-exit) ;Without confirmation
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6810 gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6811 (gnus-y-or-n-p "Are you sure you want to quit reading news? "))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6812 (run-hooks 'gnus-exit-gnus-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6813 ;; Offer to save data from non-quitted summary buffers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6814 (gnus-offer-save-summaries)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6815 ;; Save the newsrc file(s).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6816 (gnus-save-newsrc-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6817 ;; Kill-em-all.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6818 (gnus-close-backends)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6819 ;; Reset everything.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6820 (gnus-clear-system)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6821 ;; Allow the user to do things after cleaning up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6822 (run-hooks 'gnus-after-exiting-gnus-hook)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6823
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6824 (defun gnus-close-backends ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6825 ;; Send a close request to all backends that support such a request.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6826 (let ((methods gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6827 func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6828 (while methods
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6829 (if (fboundp (setq func (intern (concat (caar methods)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6830 "-request-close"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6831 (funcall func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6832 (setq methods (cdr methods)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6833
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6834 (defun gnus-group-quit ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6835 "Quit reading news without updating .newsrc.eld or .newsrc.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6836 The hook `gnus-exit-gnus-hook' is called before actually exiting."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6837 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6838 (when (or noninteractive ;For gnus-batch-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6839 (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6840 (not (gnus-server-opened gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6841 gnus-expert-user
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6842 (not gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6843 (gnus-yes-or-no-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6844 (format "Quit reading news without saving %s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6845 (file-name-nondirectory gnus-current-startup-file))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6846 (run-hooks 'gnus-exit-gnus-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6847 (if gnus-use-full-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6848 (delete-other-windows)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6849 (gnus-remove-some-windows))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6850 (gnus-dribble-save)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6851 (gnus-close-backends)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6852 (gnus-clear-system)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6853 ;; Allow the user to do things after cleaning up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6854 (run-hooks 'gnus-after-exiting-gnus-hook)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6855
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6856 (defun gnus-offer-save-summaries ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6857 "Offer to save all active summary buffers."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6858 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6859 (let ((buflist (buffer-list))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6860 buffers bufname)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6861 ;; Go through all buffers and find all summaries.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6862 (while buflist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6863 (and (setq bufname (buffer-name (car buflist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6864 (string-match "Summary" bufname)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6865 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6866 (set-buffer bufname)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6867 ;; We check that this is, indeed, a summary buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6868 (and (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6869 ;; Also make sure this isn't bogus.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6870 gnus-newsgroup-prepared))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6871 (push bufname buffers))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6872 (setq buflist (cdr buflist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6873 ;; Go through all these summary buffers and offer to save them.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6874 (when buffers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6875 (map-y-or-n-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6876 "Update summary buffer %s? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6877 (lambda (buf) (set-buffer buf) (gnus-summary-exit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6878 buffers)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6879
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6880 (defun gnus-group-describe-briefly ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6881 "Give a one line description of the group mode commands."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6882 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6883 (gnus-message 7 (substitute-command-keys "\\<gnus-group-mode-map>\\[gnus-group-read-group]:Select \\[gnus-group-next-unread-group]:Forward \\[gnus-group-prev-unread-group]:Backward \\[gnus-group-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-group-describe-briefly]:This help")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6884
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6885 (defun gnus-group-browse-foreign-server (method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6886 "Browse a foreign news server.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6887 If called interactively, this function will ask for a select method
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6888 (nntp, nnspool, etc.) and a server address (eg. nntp.some.where).
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6889 If not, METHOD should be a list where the first element is the method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6890 and the second element is the address."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6891 (interactive
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6892 (list (let ((how (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6893 "Which backend: "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6894 (append gnus-valid-select-methods gnus-server-alist)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6895 nil t (cons "nntp" 0) 'gnus-method-history)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6896 ;; We either got a backend name or a virtual server name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6897 ;; If the first, we also need an address.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6898 (if (assoc how gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6899 (list (intern how)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6900 ;; Suggested by mapjph@bath.ac.uk.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6901 (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6902 "Address: "
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6903 (mapcar (lambda (server) (list server))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6904 gnus-secondary-servers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6905 ;; We got a server name, so we find the method.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6906 (gnus-server-to-method how)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6907 (gnus-browse-foreign-server method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6908
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6909
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6910 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6911 ;;; Gnus summary mode
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6912 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6913
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6914 (defvar gnus-summary-mode-map nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6915
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6916 (put 'gnus-summary-mode 'mode-class 'special)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6917
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6918 (unless gnus-summary-mode-map
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6919 (setq gnus-summary-mode-map (make-keymap))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6920 (suppress-keymap gnus-summary-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6921
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6922 ;; Non-orthogonal keys
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
6923
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6924 (gnus-define-keys gnus-summary-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6925 " " gnus-summary-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6926 "\177" gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6927 [delete] gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6928 "\r" gnus-summary-scroll-up
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6929 "n" gnus-summary-next-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6930 "p" gnus-summary-prev-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6931 "N" gnus-summary-next-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6932 "P" gnus-summary-prev-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6933 "\M-\C-n" gnus-summary-next-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6934 "\M-\C-p" gnus-summary-prev-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6935 "\M-n" gnus-summary-next-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6936 "\M-p" gnus-summary-prev-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6937 "." gnus-summary-first-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6938 "," gnus-summary-best-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6939 "\M-s" gnus-summary-search-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6940 "\M-r" gnus-summary-search-article-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6941 "<" gnus-summary-beginning-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6942 ">" gnus-summary-end-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6943 "j" gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6944 "^" gnus-summary-refer-parent-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6945 "\M-^" gnus-summary-refer-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6946 "u" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6947 "!" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6948 "U" gnus-summary-tick-article-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6949 "d" gnus-summary-mark-as-read-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6950 "D" gnus-summary-mark-as-read-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6951 "E" gnus-summary-mark-as-expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6952 "\M-u" gnus-summary-clear-mark-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6953 "\M-U" gnus-summary-clear-mark-backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6954 "k" gnus-summary-kill-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6955 "\C-k" gnus-summary-kill-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6956 "\M-\C-k" gnus-summary-kill-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6957 "\M-\C-l" gnus-summary-lower-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6958 "e" gnus-summary-edit-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6959 "#" gnus-summary-mark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6960 "\M-#" gnus-summary-unmark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6961 "\M-\C-t" gnus-summary-toggle-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6962 "\M-\C-s" gnus-summary-show-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6963 "\M-\C-h" gnus-summary-hide-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6964 "\M-\C-f" gnus-summary-next-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6965 "\M-\C-b" gnus-summary-prev-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6966 "\M-\C-u" gnus-summary-up-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6967 "\M-\C-d" gnus-summary-down-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6968 "&" gnus-summary-execute-command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6969 "c" gnus-summary-catchup-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6970 "\C-w" gnus-summary-mark-region-as-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6971 "\C-t" gnus-summary-toggle-truncation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6972 "?" gnus-summary-mark-as-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6973 "\C-c\M-\C-s" gnus-summary-limit-include-expunged
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6974 "\C-c\C-s\C-n" gnus-summary-sort-by-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6975 "\C-c\C-s\C-a" gnus-summary-sort-by-author
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6976 "\C-c\C-s\C-s" gnus-summary-sort-by-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6977 "\C-c\C-s\C-d" gnus-summary-sort-by-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6978 "\C-c\C-s\C-i" gnus-summary-sort-by-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6979 "=" gnus-summary-expand-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6980 "\C-x\C-s" gnus-summary-reselect-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6981 "\M-g" gnus-summary-rescan-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6982 "w" gnus-summary-stop-page-breaking
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6983 "\C-c\C-r" gnus-summary-caesar-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6984 "\M-t" gnus-summary-toggle-mime
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6985 "f" gnus-summary-followup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6986 "F" gnus-summary-followup-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6987 "C" gnus-summary-cancel-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6988 "r" gnus-summary-reply
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6989 "R" gnus-summary-reply-with-original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6990 "\C-c\C-f" gnus-summary-mail-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6991 "o" gnus-summary-save-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6992 "\C-o" gnus-summary-save-article-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6993 "|" gnus-summary-pipe-output
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6994 "\M-k" gnus-summary-edit-local-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6995 "\M-K" gnus-summary-edit-global-kill
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6996 "V" gnus-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6997 "\C-c\C-d" gnus-summary-describe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6998 "q" gnus-summary-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
6999 "Q" gnus-summary-exit-no-update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7000 "\C-c\C-i" gnus-info-find-node
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7001 gnus-mouse-2 gnus-mouse-pick-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7002 "m" gnus-summary-mail-other-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7003 "a" gnus-summary-post-news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7004 "x" gnus-summary-limit-to-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7005 "s" gnus-summary-isearch-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7006 "t" gnus-article-hide-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7007 "g" gnus-summary-show-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7008 "l" gnus-summary-goto-last-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7009 "\C-c\C-v\C-v" gnus-uu-decode-uu-view
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7010 "\C-d" gnus-summary-enter-digest-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7011 "\C-c\C-b" gnus-bug
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7012 "*" gnus-cache-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7013 "\M-*" gnus-cache-remove-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7014 "\M-&" gnus-summary-universal-argument
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7015 "\C-l" gnus-recenter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7016 "I" gnus-summary-increase-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7017 "L" gnus-summary-lower-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7018
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7019 "V" gnus-summary-score-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7020 "X" gnus-uu-extract-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7021 "S" gnus-summary-send-map)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7022
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7023 ;; Sort of orthogonal keymap
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7024 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7025 "t" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7026 "!" gnus-summary-tick-article-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7027 "d" gnus-summary-mark-as-read-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7028 "r" gnus-summary-mark-as-read-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7029 "c" gnus-summary-clear-mark-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7030 " " gnus-summary-clear-mark-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7031 "e" gnus-summary-mark-as-expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7032 "x" gnus-summary-mark-as-expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7033 "?" gnus-summary-mark-as-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7034 "b" gnus-summary-set-bookmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7035 "B" gnus-summary-remove-bookmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7036 "#" gnus-summary-mark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7037 "\M-#" gnus-summary-unmark-as-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7038 "S" gnus-summary-limit-include-expunged
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7039 "C" gnus-summary-catchup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7040 "H" gnus-summary-catchup-to-here
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7041 "\C-c" gnus-summary-catchup-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7042 "k" gnus-summary-kill-same-subject-and-select
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7043 "K" gnus-summary-kill-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7044 "P" gnus-uu-mark-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7045
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7046 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7047 "c" gnus-summary-clear-above
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7048 "u" gnus-summary-tick-above
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7049 "m" gnus-summary-mark-above
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7050 "k" gnus-summary-kill-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7051
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7052 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7053 "/" gnus-summary-limit-to-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7054 "n" gnus-summary-limit-to-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7055 "w" gnus-summary-pop-limit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7056 "s" gnus-summary-limit-to-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7057 "a" gnus-summary-limit-to-author
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7058 "u" gnus-summary-limit-to-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7059 "m" gnus-summary-limit-to-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7060 "v" gnus-summary-limit-to-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7061 "D" gnus-summary-limit-include-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7062 "d" gnus-summary-limit-exclude-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7063 ;; "t" gnus-summary-limit-exclude-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7064 "E" gnus-summary-limit-include-expunged
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7065 "c" gnus-summary-limit-exclude-childless-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7066 "C" gnus-summary-limit-mark-excluded-as-read)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7067
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7068 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7069 "n" gnus-summary-next-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7070 "p" gnus-summary-prev-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7071 "N" gnus-summary-next-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7072 "P" gnus-summary-prev-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7073 "\C-n" gnus-summary-next-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7074 "\C-p" gnus-summary-prev-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7075 "\M-n" gnus-summary-next-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7076 "\M-p" gnus-summary-prev-unread-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7077 "f" gnus-summary-first-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7078 "b" gnus-summary-best-unread-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7079 "j" gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7080 "g" gnus-summary-goto-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7081 "l" gnus-summary-goto-last-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7082 "p" gnus-summary-pop-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7083
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7084 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7085 "k" gnus-summary-kill-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7086 "l" gnus-summary-lower-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7087 "i" gnus-summary-raise-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7088 "T" gnus-summary-toggle-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7089 "t" gnus-summary-rethread-current
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7090 "^" gnus-summary-reparent-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7091 "s" gnus-summary-show-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7092 "S" gnus-summary-show-all-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7093 "h" gnus-summary-hide-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7094 "H" gnus-summary-hide-all-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7095 "n" gnus-summary-next-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7096 "p" gnus-summary-prev-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7097 "u" gnus-summary-up-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7098 "o" gnus-summary-top-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7099 "d" gnus-summary-down-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7100 "#" gnus-uu-mark-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7101 "\M-#" gnus-uu-unmark-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7102
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7103 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7104 "c" gnus-summary-catchup-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7105 "C" gnus-summary-catchup-all-and-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7106 "E" gnus-summary-exit-no-update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7107 "Q" gnus-summary-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7108 "Z" gnus-summary-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7109 "n" gnus-summary-catchup-and-goto-next-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7110 "R" gnus-summary-reselect-current-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7111 "G" gnus-summary-rescan-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7112 "N" gnus-summary-next-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7113 "P" gnus-summary-prev-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7114
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7115 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7116 " " gnus-summary-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7117 "n" gnus-summary-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7118 "\177" gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7119 [delete] gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7120 "p" gnus-summary-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7121 "\r" gnus-summary-scroll-up
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7122 "<" gnus-summary-beginning-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7123 ">" gnus-summary-end-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7124 "b" gnus-summary-beginning-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7125 "e" gnus-summary-end-of-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7126 "^" gnus-summary-refer-parent-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7127 "r" gnus-summary-refer-parent-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7128 "R" gnus-summary-refer-references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7129 "g" gnus-summary-show-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7130 "s" gnus-summary-isearch-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7131
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7132 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7133 "b" gnus-article-add-buttons
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7134 "B" gnus-article-add-buttons-to-head
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7135 "o" gnus-article-treat-overstrike
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7136 ;; "w" gnus-article-word-wrap
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7137 "w" gnus-article-fill-cited-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7138 "c" gnus-article-remove-cr
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7139 "L" gnus-article-remove-trailing-blank-lines
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7140 "q" gnus-article-de-quoted-unreadable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7141 "f" gnus-article-display-x-face
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7142 "l" gnus-summary-stop-page-breaking
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7143 "r" gnus-summary-caesar-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7144 "t" gnus-article-hide-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7145 "v" gnus-summary-verbose-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7146 "m" gnus-summary-toggle-mime)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7147
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7148 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7149 "a" gnus-article-hide
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7150 "h" gnus-article-hide-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7151 "b" gnus-article-hide-boring-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7152 "s" gnus-article-hide-signature
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7153 "c" gnus-article-hide-citation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7154 "p" gnus-article-hide-pgp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7155 "\C-c" gnus-article-hide-citation-maybe)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7156
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7157 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7158 "a" gnus-article-highlight
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7159 "h" gnus-article-highlight-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7160 "c" gnus-article-highlight-citation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7161 "s" gnus-article-highlight-signature)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7162
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7163 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7164 "z" gnus-article-date-ut
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7165 "u" gnus-article-date-ut
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7166 "l" gnus-article-date-local
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7167 "e" gnus-article-date-lapsed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7168 "o" gnus-article-date-original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7169
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7170 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7171 "v" gnus-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7172 "f" gnus-summary-fetch-faq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7173 "d" gnus-summary-describe-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7174 "h" gnus-summary-describe-briefly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7175 "i" gnus-info-find-node)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7176
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7177 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7178 "e" gnus-summary-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7179 "\M-\C-e" gnus-summary-expire-articles-now
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7180 "\177" gnus-summary-delete-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7181 [delete] gnus-summary-delete-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7182 "m" gnus-summary-move-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7183 "r" gnus-summary-respool-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7184 "w" gnus-summary-edit-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7185 "c" gnus-summary-copy-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7186 "B" gnus-summary-crosspost-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7187 "q" gnus-summary-respool-query
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7188 "i" gnus-summary-import-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7189
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7190 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7191 "o" gnus-summary-save-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7192 "m" gnus-summary-save-article-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7193 "r" gnus-summary-save-article-rmail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7194 "f" gnus-summary-save-article-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7195 "b" gnus-summary-save-article-body-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7196 "h" gnus-summary-save-article-folder
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7197 "v" gnus-summary-save-article-vm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7198 "p" gnus-summary-pipe-output
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7199 "s" gnus-soup-add-article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7200 )
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7201
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7202
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7203
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7204 (defun gnus-summary-mode (&optional group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7205 "Major mode for reading articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7206
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7207 All normal editing commands are switched off.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7208 \\<gnus-summary-mode-map>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7209 Each line in this buffer represents one article. To read an
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7210 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7211 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]',
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7212 respectively.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7213
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7214 You can also post articles and send mail from this buffer. To
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7215 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7216 of an article, type `\\[gnus-summary-reply]'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7217
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7218 There are approx. one gazillion commands you can execute in this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7219 buffer; read the info pages for more information (`\\[gnus-info-find-node]').
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7220
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7221 The following commands are available:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7222
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7223 \\{gnus-summary-mode-map}"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7224 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7225 (when (and menu-bar-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7226 (gnus-visual-p 'summary-menu 'menu))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7227 (gnus-summary-make-menu-bar))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7228 (kill-all-local-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7229 (gnus-summary-make-local-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7230 (gnus-make-thread-indent-array)
13700
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
7231 (gnus-simplify-mode-line)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7232 (setq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7233 (setq mode-name "Summary")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7234 (make-local-variable 'minor-mode-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7235 (use-local-map gnus-summary-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7236 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7237 (setq buffer-read-only t) ;Disable modification
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7238 (setq truncate-lines t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7239 (setq selective-display t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7240 (setq selective-display-ellipses t) ;Display `...'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7241 (setq buffer-display-table gnus-summary-display-table)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7242 (setq gnus-newsgroup-name group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7243 (make-local-variable 'gnus-summary-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7244 (make-local-variable 'gnus-summary-line-format-spec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7245 (make-local-variable 'gnus-summary-mark-positions)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
7246 (gnus-make-local-hook 'post-command-hook)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
7247 (gnus-add-hook 'post-command-hook 'gnus-clear-inboxes-moved nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7248 (run-hooks 'gnus-summary-mode-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7249
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7250 (defun gnus-summary-make-local-variables ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7251 "Make all the local summary buffer variables."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7252 (let ((locals gnus-summary-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7253 global local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7254 (while (setq local (pop locals))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7255 (if (consp local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7256 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7257 (if (eq (cdr local) 'global)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7258 ;; Copy the global value of the variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7259 (setq global (symbol-value (car local)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7260 ;; Use the value from the list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7261 (setq global (eval (cdr local))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7262 (make-local-variable (car local))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7263 (set (car local) global))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7264 ;; Simple nil-valued local variable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7265 (make-local-variable local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7266 (set local nil)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7267
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7268 (defun gnus-summary-make-display-table ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7269 ;; Change the display table. Odd characters have a tendency to mess
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7270 ;; up nicely formatted displays - we make all possible glyphs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7271 ;; display only a single character.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7272
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7273 ;; We start from the standard display table, if any.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7274 (setq gnus-summary-display-table
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7275 (or (copy-sequence standard-display-table)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7276 (make-display-table)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7277 ;; Nix out all the control chars...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7278 (let ((i 32))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7279 (while (>= (setq i (1- i)) 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7280 (aset gnus-summary-display-table i [??])))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7281 ;; ... but not newline and cr, of course. (cr is necessary for the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7282 ;; selective display).
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7283 (aset gnus-summary-display-table ?\n nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7284 (aset gnus-summary-display-table ?\r nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7285 ;; We nix out any glyphs over 126 that are not set already.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7286 (let ((i 256))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7287 (while (>= (setq i (1- i)) 127)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7288 ;; Only modify if the entry is nil.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7289 (or (aref gnus-summary-display-table i)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7290 (aset gnus-summary-display-table i [??])))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7291
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7292 (defun gnus-summary-clear-local-variables ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7293 (let ((locals gnus-summary-local-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7294 (while locals
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7295 (if (consp (car locals))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7296 (and (vectorp (caar locals))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7297 (set (caar locals) nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7298 (and (vectorp (car locals))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7299 (set (car locals) nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7300 (setq locals (cdr locals)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7301
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7302 ;; Summary data functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7303
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7304 (defmacro gnus-data-number (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7305 `(car ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7306
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7307 (defmacro gnus-data-set-number (data number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7308 `(setcar ,data ,number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7309
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7310 (defmacro gnus-data-mark (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7311 `(nth 1 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7312
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7313 (defmacro gnus-data-set-mark (data mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7314 `(setcar (nthcdr 1 ,data) ,mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7315
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7316 (defmacro gnus-data-pos (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7317 `(nth 2 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7318
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7319 (defmacro gnus-data-set-pos (data pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7320 `(setcar (nthcdr 2 ,data) ,pos))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7321
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7322 (defmacro gnus-data-header (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7323 `(nth 3 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7324
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7325 (defmacro gnus-data-level (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7326 `(nth 4 ,data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7327
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7328 (defmacro gnus-data-unread-p (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7329 `(= (nth 1 ,data) gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7330
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7331 (defmacro gnus-data-pseudo-p (data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7332 `(consp (nth 3 ,data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7333
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7334 (defmacro gnus-data-find (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7335 `(assq ,number gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7336
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7337 (defmacro gnus-data-find-list (number &optional data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7338 `(let ((bdata ,(or data 'gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7339 (memq (assq ,number bdata)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7340 bdata)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7341
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7342 (defmacro gnus-data-make (number mark pos header level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7343 `(list ,number ,mark ,pos ,header ,level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7344
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7345 (defun gnus-data-enter (after-article number mark pos header level offset)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7346 (let ((data (gnus-data-find-list after-article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7347 (or data (error "No such article: %d" after-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7348 (setcdr data (cons (gnus-data-make number mark pos header level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7349 (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7350 (setq gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7351 (gnus-data-update-list (cddr data) offset)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7352
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7353 (defun gnus-data-enter-list (after-article list &optional offset)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7354 (when list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7355 (let ((data (and after-article (gnus-data-find-list after-article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7356 (ilist list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7357 (or data (not after-article) (error "No such article: %d" after-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7358 ;; Find the last element in the list to be spliced into the main
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7359 ;; list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7360 (while (cdr list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7361 (setq list (cdr list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7362 (if (not data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7363 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7364 (setcdr list gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7365 (setq gnus-newsgroup-data ilist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7366 (and offset (gnus-data-update-list (cdr list) offset)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7367 (setcdr list (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7368 (setcdr data ilist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7369 (and offset (gnus-data-update-list (cdr data) offset)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7370 (setq gnus-newsgroup-data-reverse nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7371
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7372 (defun gnus-data-remove (article &optional offset)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7373 (let ((data gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7374 (if (= (gnus-data-number (car data)) article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7375 (setq gnus-newsgroup-data (cdr gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7376 gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7377 (while (cdr data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7378 (and (= (gnus-data-number (cadr data)) article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7379 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7380 (setcdr data (cddr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7381 (and offset (gnus-data-update-list (cdr data) offset))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7382 (setq data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7383 gnus-newsgroup-data-reverse nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7384 (setq data (cdr data))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7385
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7386 (defmacro gnus-data-list (backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7387 `(if ,backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7388 (or gnus-newsgroup-data-reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7389 (setq gnus-newsgroup-data-reverse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7390 (reverse gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7391 gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7392
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7393 (defun gnus-data-update-list (data offset)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7394 "Add OFFSET to the POS of all data entries in DATA."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7395 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7396 (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7397 (setq data (cdr data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7398
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7399 (defun gnus-data-compute-positions ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7400 "Compute the positions of all articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7401 (let ((data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7402 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7403 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7404 (when (setq pos (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7405 (point-min) (point-max)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7406 'gnus-number (gnus-data-number (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7407 (gnus-data-set-pos (car data) (+ pos 3)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7408 (setq data (cdr data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7409
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7410 (defun gnus-summary-article-pseudo-p (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7411 "Say whether this article is a pseudo article or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7412 (not (vectorp (gnus-data-header (gnus-data-find article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7413
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7414 (defun gnus-article-parent-p (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7415 "Say whether this article is a parent or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7416 (let ((data (gnus-data-find-list number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7417 (and (cdr data) ; There has to be an article after...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7418 (< (gnus-data-level (car data)) ; And it has to have a higher level.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7419 (gnus-data-level (nth 1 data))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7420
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7421 (defun gnus-article-children (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7422 "Return a list of all children to NUMBER."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7423 (let* ((data (gnus-data-find-list number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7424 (level (gnus-data-level (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7425 children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7426 (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7427 (while (and data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7428 (= (gnus-data-level (car data)) (1+ level)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7429 (push (gnus-data-number (car data)) children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7430 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7431 children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7432
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7433 (defmacro gnus-summary-skip-intangible ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7434 "If the current article is intangible, then jump to a different article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7435 '(let ((to (get-text-property (point) 'gnus-intangible)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7436 (and to (gnus-summary-goto-subject to))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7437
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7438 (defmacro gnus-summary-article-intangible-p ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7439 "Say whether this article is intangible or not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7440 '(get-text-property (point) 'gnus-intangible))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7441
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7442 ;; Some summary mode macros.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7443
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7444 (defmacro gnus-summary-article-number ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7445 "The article number of the article on the current line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7446 If there isn's an article number here, then we return the current
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7447 article number."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7448 '(progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7449 (gnus-summary-skip-intangible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7450 (or (get-text-property (point) 'gnus-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7451 (gnus-summary-last-subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7452
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7453 (defmacro gnus-summary-article-header (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7454 `(gnus-data-header (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7455 ,(or number '(gnus-summary-article-number)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7456
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7457 (defmacro gnus-summary-thread-level (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7458 `(if (and (eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7459 (get-text-property (point) 'gnus-intangible))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7460 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7461 (gnus-data-level (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7462 ,(or number '(gnus-summary-article-number))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7463
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7464 (defmacro gnus-summary-article-mark (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7465 `(gnus-data-mark (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7466 ,(or number '(gnus-summary-article-number)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7467
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7468 (defmacro gnus-summary-article-pos (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7469 `(gnus-data-pos (gnus-data-find
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7470 ,(or number '(gnus-summary-article-number)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7471
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7472 (defalias 'gnus-summary-subject-string 'gnus-summary-article-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7473 (defmacro gnus-summary-article-subject (&optional number)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7474 "Return current subject string or nil if nothing."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7475 `(let ((headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7476 ,(if number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7477 `(gnus-data-header (assq ,number gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7478 '(gnus-data-header (assq (gnus-summary-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7479 gnus-newsgroup-data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7480 (and headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7481 (vectorp headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7482 (mail-header-subject headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7483
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7484 (defmacro gnus-summary-article-score (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7485 "Return current article score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7486 `(or (cdr (assq ,(or number '(gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7487 gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7488 gnus-summary-default-score 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7489
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7490 (defun gnus-summary-article-children (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7491 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7492 (level (gnus-data-level (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7493 l children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7494 (while (and (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7495 (> (setq l (gnus-data-level (car data))) level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7496 (and (= (1+ level) l)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7497 (setq children (cons (gnus-data-number (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7498 children))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7499 (nreverse children)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7500
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7501 (defun gnus-summary-article-parent (&optional number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7502 (let* ((data (gnus-data-find-list (or number (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7503 (gnus-data-list t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7504 (level (gnus-data-level (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7505 (if (zerop level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7506 () ; This is a root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7507 ;; We search until we find an article with a level less than
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7508 ;; this one. That function has to be the parent.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7509 (while (and (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7510 (not (< (gnus-data-level (car data)) level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7511 (and data (gnus-data-number (car data))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7512
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7513 (defun gnus-unread-mark-p (mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7514 "Say whether MARK is the unread mark."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7515 (= mark gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7516
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7517 (defun gnus-read-mark-p (mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7518 "Say whether MARK is one of the marks that mark as read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7519 This is all marks except unread, ticked, dormant, and expirable."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7520 (not (or (= mark gnus-unread-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7521 (= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7522 (= mark gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7523 (= mark gnus-expirable-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7524
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7525 ;; Saving hidden threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7526
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7527 (put 'gnus-save-hidden-threads 'lisp-indent-function 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7528 (put 'gnus-save-hidden-threads 'lisp-indent-hook 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7529 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7530
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7531 (defmacro gnus-save-hidden-threads (&rest forms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7532 "Save hidden threads, eval FORMS, and restore the hidden threads."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7533 (let ((config (make-symbol "config")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7534 `(let ((,config (gnus-hidden-threads-configuration)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7535 (unwind-protect
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7536 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7537 ,@forms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7538 (gnus-restore-hidden-threads-configuration ,config)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7539
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7540 (defun gnus-hidden-threads-configuration ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7541 "Return the current hidden threads configuration."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7542 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7543 (let (config)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7544 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7545 (while (search-forward "\r" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7546 (push (1- (point)) config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7547 config)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7548
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7549 (defun gnus-restore-hidden-threads-configuration (config)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7550 "Restore hidden threads configuration from CONFIG."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7551 (let (point buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7552 (while (setq point (pop config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7553 (when (and (< point (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7554 (goto-char point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7555 (= (following-char) ?\n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7556 (subst-char-in-region point (1+ point) ?\n ?\r)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7557
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7558 ;; Various summary mode internalish functions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7559
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7560 (defun gnus-mouse-pick-article (e)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7561 (interactive "e")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7562 (mouse-set-point e)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7563 (gnus-summary-next-page nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7564
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7565 (defun gnus-summary-setup-buffer (group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7566 "Initialize summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7567 (let ((buffer (concat "*Summary " group "*")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7568 (if (get-buffer buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7569 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7570 (set-buffer buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7571 (setq gnus-summary-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7572 (not gnus-newsgroup-prepared))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7573 ;; Fix by Sudish Joseph <joseph@cis.ohio-state.edu>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7574 (setq gnus-summary-buffer (set-buffer (get-buffer-create buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7575 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7576 (gnus-summary-mode group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7577 (when gnus-carpal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7578 (gnus-carpal-setup-buffer 'summary))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7579 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7580 (make-local-variable 'gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7581 (make-local-variable 'gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7582 (make-local-variable 'gnus-original-article-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7583 (setq gnus-newsgroup-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7584 t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7585
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7586 (defun gnus-set-global-variables ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7587 ;; Set the global equivalents of the summary buffer-local variables
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7588 ;; to the latest values they had. These reflect the summary buffer
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7589 ;; that was in action when the last article was fetched.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7590 (when (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7591 (setq gnus-summary-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7592 (let ((name gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7593 (marked gnus-newsgroup-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7594 (unread gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7595 (headers gnus-current-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7596 (data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7597 (summary gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7598 (article-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7599 (original gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7600 (gac gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7601 (score-file gnus-current-score-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7602 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7603 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7604 (setq gnus-newsgroup-name name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7605 (setq gnus-newsgroup-marked marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7606 (setq gnus-newsgroup-unreads unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7607 (setq gnus-current-headers headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7608 (setq gnus-newsgroup-data data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7609 (setq gnus-article-current gac)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7610 (setq gnus-summary-buffer summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7611 (setq gnus-article-buffer article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7612 (setq gnus-original-article-buffer original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7613 (setq gnus-current-score-file score-file)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7614
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7615 (defun gnus-summary-last-article-p (&optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7616 "Return whether ARTICLE is the last article in the buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7617 (if (not (setq article (or article (gnus-summary-article-number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7618 t ; All non-existant numbers are the last article. :-)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7619 (not (cdr (gnus-data-find-list article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7620
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7621 (defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7622 "Insert a dummy root in the summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7623 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7624 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7625 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7626 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7627
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7628 (defun gnus-make-thread-indent-array ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7629 (let ((n 200))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7630 (unless (and gnus-thread-indent-array
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7631 (= gnus-thread-indent-level gnus-thread-indent-array-level))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7632 (setq gnus-thread-indent-array (make-vector 201 "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7633 gnus-thread-indent-array-level gnus-thread-indent-level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7634 (while (>= n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7635 (aset gnus-thread-indent-array n
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7636 (make-string (* n gnus-thread-indent-level) ? ))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7637 (setq n (1- n))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7638
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7639 (defun gnus-summary-insert-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7640 (gnus-tmp-header gnus-tmp-level gnus-tmp-current gnus-tmp-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7641 gnus-tmp-replied gnus-tmp-expirable gnus-tmp-subject-or-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7642 &optional gnus-tmp-dummy gnus-tmp-score gnus-tmp-process)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7643 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7644 (gnus-tmp-lines (mail-header-lines gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7645 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7646 (gnus-tmp-score-char
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7647 (if (or (null gnus-summary-default-score)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7648 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7649 gnus-summary-zcore-fuzz)) ?
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7650 (if (< gnus-tmp-score gnus-summary-default-score)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7651 gnus-score-below-mark gnus-score-over-mark)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7652 (gnus-tmp-replied (cond (gnus-tmp-process gnus-process-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7653 ((memq gnus-tmp-current gnus-newsgroup-cached)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7654 gnus-cached-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7655 (gnus-tmp-replied gnus-replied-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7656 ((memq gnus-tmp-current gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7657 gnus-saved-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7658 (t gnus-unread-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7659 (gnus-tmp-from (mail-header-from gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7660 (gnus-tmp-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7661 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7662 ((string-match "(.+)" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7663 (substring gnus-tmp-from
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7664 (1+ (match-beginning 0)) (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7665 ((string-match "<[^>]+> *$" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7666 (let ((beg (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7667 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7668 (substring gnus-tmp-from (1+ (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7669 (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7670 (substring gnus-tmp-from 0 beg))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7671 (t gnus-tmp-from)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7672 (gnus-tmp-subject (mail-header-subject gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7673 (gnus-tmp-number (mail-header-number gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7674 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7675 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\]))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7676 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7677 (when (string= gnus-tmp-name "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7678 (setq gnus-tmp-name gnus-tmp-from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7679 (or (numberp gnus-tmp-lines) (setq gnus-tmp-lines 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7680 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7681 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7682 (progn (eval gnus-summary-line-format-spec) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7683 'gnus-number gnus-tmp-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7684 (when (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7685 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7686 (run-hooks 'gnus-summary-update-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7687 (forward-line 1))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7688
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7689 (defun gnus-summary-update-line (&optional dont-update)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7690 ;; Update summary line after change.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7691 (when (and gnus-summary-default-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7692 (not gnus-summary-inhibit-highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7693 (let* ((gnus-summary-inhibit-highlight t) ; Prevent recursion.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7694 (article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7695 (score (gnus-summary-article-score article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7696 (unless dont-update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7697 (if (and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7698 (< (gnus-summary-article-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7699 gnus-summary-mark-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7700 ;; This article has a low score, so we mark it as read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7701 (when (memq article gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7702 (gnus-summary-mark-article-as-read gnus-low-score-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7703 (when (eq (gnus-summary-article-mark) gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7704 ;; This article was previously marked as read on account
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7705 ;; of a low score, but now it has risen, so we mark it as
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7706 ;; unread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7707 (gnus-summary-mark-article-as-unread gnus-unread-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7708 (gnus-summary-update-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7709 (if (or (null gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7710 (<= (abs (- score gnus-summary-default-score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7711 gnus-summary-zcore-fuzz)) ?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7712 (if (< score gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7713 gnus-score-below-mark gnus-score-over-mark)) 'score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7714 ;; Do visual highlighting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7715 (when (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7716 (run-hooks 'gnus-summary-update-hook)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7717
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7718 (defvar gnus-tmp-new-adopts nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7719
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7720 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7721 ;; Sum up all elements (and sub-elements) in a list.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7722 (let* ((number
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7723 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7724 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7725 ((and (consp thread) (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7726 (apply
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7727 '+ 1 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7728 'gnus-summary-number-of-articles-in-thread (cdr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7729 ((null thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7730 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7731 ((memq (mail-header-number (car thread)) gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7732 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7733 (t 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7734 (when (and level (zerop level) gnus-tmp-new-adopts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7735 (incf number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7736 (apply '+ (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7737 'gnus-summary-number-of-articles-in-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7738 gnus-tmp-new-adopts))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7739 (if char
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7740 (if (> number 1) gnus-not-empty-thread-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7741 gnus-empty-thread-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7742 number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7743
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7744 (defun gnus-summary-set-local-parameters (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7745 "Go through the local params of GROUP and set all variable specs in that list."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7746 (let ((params (gnus-info-params (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7747 elem)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7748 (while params
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7749 (setq elem (car params)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7750 params (cdr params))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7751 (and (consp elem) ; Has to be a cons.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7752 (consp (cdr elem)) ; The cdr has to be a list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7753 (symbolp (car elem)) ; Has to be a symbol in there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7754 (not (memq (car elem)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7755 '(quit-config to-address to-list to-group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7756 (progn ; So we set it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7757 (make-local-variable (car elem))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7758 (set (car elem) (eval (nth 1 elem))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7759
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7760 (defun gnus-summary-read-group (group &optional show-all no-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7761 kill-buffer no-display)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7762 "Start reading news in newsgroup GROUP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7763 If SHOW-ALL is non-nil, already read articles are also listed.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7764 If NO-ARTICLE is non-nil, no article is selected initially.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7765 If NO-DISPLAY, don't generate a summary buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7766 (gnus-message 5 "Retrieving newsgroup: %s..." group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7767 (let* ((new-group (gnus-summary-setup-buffer group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7768 (quit-config (gnus-group-quit-config group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7769 (did-select (and new-group (gnus-select-newsgroup group show-all))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7770 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7771 ;; This summary buffer exists already, so we just select it.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7772 ((not new-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7773 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7774 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7775 (gnus-kill-or-deaden-summary kill-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7776 (gnus-configure-windows 'summary 'force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7777 (gnus-set-mode-line 'summary)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7778 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7779 (message "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7780 t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7781 ;; We couldn't select this group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7782 ((null did-select)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7783 (when (and (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7784 (not (equal (current-buffer) kill-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7785 (kill-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7786 (if (not quit-config)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7787 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7788 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7789 (gnus-group-jump-to-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7790 (gnus-group-next-unread-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7791 (if (not (buffer-name (car quit-config)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7792 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7793 (set-buffer (car quit-config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7794 (and (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7795 (gnus-set-global-variables))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7796 (gnus-configure-windows (cdr quit-config)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7797 (gnus-message 3 "Can't select group")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7798 nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7799 ;; The user did a `C-g' while prompting for number of articles,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7800 ;; so we exit this group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7801 ((eq did-select 'quit)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7802 (and (eq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7803 (not (equal (current-buffer) kill-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7804 (kill-buffer (current-buffer)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7805 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7806 (gnus-kill-or-deaden-summary kill-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7807 (if (not quit-config)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7808 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7809 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7810 (gnus-group-jump-to-group group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7811 (gnus-group-next-unread-group 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7812 (gnus-configure-windows 'group 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7813 (if (not (buffer-name (car quit-config)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7814 (gnus-configure-windows 'group 'force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7815 (set-buffer (car quit-config))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7816 (and (eq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7817 (gnus-set-global-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7818 (gnus-configure-windows (cdr quit-config))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7819 ;; Finally signal the quit.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7820 (signal 'quit nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7821 ;; The group was successfully selected.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7822 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7823 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7824 ;; Save the active value in effect when the group was entered.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7825 (setq gnus-newsgroup-active
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7826 (gnus-copy-sequence
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7827 (gnus-active gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7828 ;; You can change the summary buffer in some way with this hook.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7829 (run-hooks 'gnus-select-group-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7830 ;; Set any local variables in the group parameters.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7831 (gnus-summary-set-local-parameters gnus-newsgroup-name)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7832 (gnus-update-format-specifications)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7833 ;; Do score processing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7834 (when gnus-use-scoring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7835 (gnus-possibly-score-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7836 ;; Check whether to fill in the gaps in the threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7837 (when gnus-build-sparse-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7838 (gnus-build-sparse-threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7839 ;; Find the initial limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7840 (if gnus-show-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7841 (if show-all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7842 (let ((gnus-newsgroup-dormant nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7843 (gnus-summary-initial-limit show-all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7844 (gnus-summary-initial-limit show-all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7845 (setq gnus-newsgroup-limit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7846 (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7847 (lambda (header) (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7848 gnus-newsgroup-headers)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7849 ;; Generate the summary buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7850 (unless no-display
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7851 (gnus-summary-prepare))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7852 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7853 (gnus-tree-open group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7854 (setq gnus-summary-highlight-line-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7855 'gnus-tree-highlight-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7856 ;; If the summary buffer is empty, but there are some low-scored
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7857 ;; articles or some excluded dormants, we include these in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7858 ;; buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7859 (when (and (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7860 (not no-display))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7861 (cond (gnus-newsgroup-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7862 (gnus-summary-limit-include-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7863 ((and gnus-newsgroup-scored show-all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7864 (gnus-summary-limit-include-expunged))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7865 ;; Function `gnus-apply-kill-file' must be called in this hook.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7866 (run-hooks 'gnus-apply-kill-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7867 (if (and (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7868 (not no-display))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7869 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7870 ;; This newsgroup is empty.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7871 (gnus-summary-catchup-and-exit nil t) ;Without confirmations.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7872 (gnus-message 6 "No unread news")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7873 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7874 (gnus-kill-or-deaden-summary kill-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7875 ;; Return nil from this function.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7876 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7877 ;; Hide conversation thread subtrees. We cannot do this in
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7878 ;; gnus-summary-prepare-hook since kill processing may not
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7879 ;; work with hidden articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7880 (and gnus-show-threads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7881 gnus-thread-hide-subtree
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7882 (gnus-summary-hide-all-threads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7883 ;; Show first unread article if requested.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7884 (if (and (not no-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7885 (not no-display)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7886 gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7887 gnus-auto-select-first)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7888 (unless (if (eq gnus-auto-select-first 'best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7889 (gnus-summary-best-unread-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7890 (gnus-summary-first-unread-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7891 (gnus-configure-windows 'summary))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7892 ;; Don't select any articles, just move point to the first
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7893 ;; article in the group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7894 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7895 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7896 (gnus-set-mode-line 'summary)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7897 (gnus-configure-windows 'summary 'force))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7898 ;; If we are in async mode, we send some info to the backend.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7899 (when gnus-newsgroup-async
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7900 (gnus-request-asynchronous gnus-newsgroup-name gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7901 (when kill-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7902 (gnus-kill-or-deaden-summary kill-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7903 (when (get-buffer-window gnus-group-buffer t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7904 ;; Gotta use windows, because recenter does wierd stuff if
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7905 ;; the current buffer ain't the displayed window.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7906 (let ((owin (selected-window)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7907 (select-window (get-buffer-window gnus-group-buffer t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7908 (when (gnus-group-goto-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7909 (recenter))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7910 (select-window owin))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7911 ;; Mark this buffer as "prepared".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7912 (setq gnus-newsgroup-prepared t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7913 t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7914
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7915 (defun gnus-summary-prepare ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7916 "Generate the summary buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7917 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7918 (erase-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7919 (setq gnus-newsgroup-data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7920 gnus-newsgroup-data-reverse nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7921 (run-hooks 'gnus-summary-generate-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7922 ;; Generate the buffer, either with threads or without.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7923 (when gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7924 (gnus-summary-prepare-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7925 (if gnus-show-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7926 (gnus-sort-gathered-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7927 (funcall gnus-summary-thread-gathering-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7928 (gnus-sort-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7929 (gnus-cut-threads (gnus-make-threads)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7930 ;; Unthreaded display.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7931 (gnus-sort-articles gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7932 (setq gnus-newsgroup-data (nreverse gnus-newsgroup-data))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7933 ;; Call hooks for modifying summary buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7934 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7935 (run-hooks 'gnus-summary-prepare-hook)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7936
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7937 (defun gnus-gather-threads-by-subject (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7938 "Gather threads by looking at Subject headers."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7939 (if (not gnus-summary-make-false-root)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7940 threads
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7941 (let ((hashtb (gnus-make-hashtable 1023))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7942 (prev threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7943 (result threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7944 subject hthread whole-subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7945 (while threads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7946 (setq whole-subject (mail-header-subject (caar threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7947 (setq subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7948 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7949 ;; Truncate the subject.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7950 ((numberp gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7951 (setq subject (gnus-simplify-subject-re whole-subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7952 (if (> (length subject) gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7953 (substring subject 0 gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7954 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7955 ;; Fuzzily simplify it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7956 ((eq 'fuzzy gnus-summary-gather-subject-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7957 (gnus-simplify-subject-fuzzy whole-subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7958 ;; Just remove the leading "Re:".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7959 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7960 (gnus-simplify-subject-re whole-subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7961
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7962 (if (and gnus-summary-gather-exclude-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7963 (string-match gnus-summary-gather-exclude-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7964 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7965 () ; We don't want to do anything with this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7966 ;; We simplify the subject before looking it up in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7967 ;; hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7968
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7969 (if (setq hthread (gnus-gethash subject hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7970 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7971 ;; We enter a dummy root into the thread, if we
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7972 ;; haven't done that already.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7973 (unless (stringp (caar hthread))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7974 (setcar hthread (list whole-subject (car hthread))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7975 ;; We add this new gathered thread to this gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7976 ;; thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7977 (setcdr (car hthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7978 (nconc (cdar hthread) (list (car threads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7979 ;; Remove it from the list of threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7980 (setcdr prev (cdr threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7981 (setq threads prev))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7982 ;; Enter this thread into the hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7983 (gnus-sethash subject threads hashtb)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7984 (setq prev threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7985 (setq threads (cdr threads)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7986 result)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
7987
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7988 (defun gnus-gather-threads-by-references (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7989 "Gather threads by looking at References headers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7990 (let ((idhashtb (gnus-make-hashtable 1023))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7991 (thhashtb (gnus-make-hashtable 1023))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7992 (prev threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7993 (result threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7994 ids references id gthread gid entered)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7995 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7996 (when (setq references (mail-header-references (caar threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7997 (setq id (mail-header-id (caar threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7998 (setq ids (gnus-split-references references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
7999 (setq entered nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8000 (while ids
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8001 (if (not (setq gid (gnus-gethash (car ids) idhashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8002 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8003 (gnus-sethash (car ids) id idhashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8004 (gnus-sethash id threads thhashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8005 (setq gthread (gnus-gethash gid thhashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8006 (unless entered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8007 ;; We enter a dummy root into the thread, if we
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8008 ;; haven't done that already.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8009 (unless (stringp (caar gthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8010 (setcar gthread (list (mail-header-subject (caar gthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8011 (car gthread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8012 ;; We add this new gathered thread to this gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8013 ;; thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8014 (setcdr (car gthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8015 (nconc (cdar gthread) (list (car threads)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8016 ;; Add it into the thread hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8017 (gnus-sethash id gthread thhashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8018 (setq entered t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8019 ;; Remove it from the list of threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8020 (setcdr prev (cdr threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8021 (setq threads prev))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8022 (setq ids (cdr ids))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8023 (setq prev threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8024 (setq threads (cdr threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8025 result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8026
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8027 (defun gnus-sort-gathered-threads (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8028 "Sort subtreads inside each gathered thread by article number."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8029 (let ((result threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8030 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8031 (when (stringp (caar threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8032 (setcdr (car threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8033 (sort (cdar threads) 'gnus-thread-sort-by-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8034 (setq threads (cdr threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8035 result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8036
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8037 (defun gnus-make-threads ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8038 "Go through the dependency hashtb and find the roots. Return all threads."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8039 (let (threads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8040 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8041 (lambda (refs)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8042 (unless (car (symbol-value refs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8043 ;; These threads do not refer back to any other articles,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8044 ;; so they're roots.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8045 (setq threads (append (cdr (symbol-value refs)) threads))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8046 gnus-newsgroup-dependencies)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8047 threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8048
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8049 (defun gnus-build-sparse-threads ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8050 (let ((headers gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8051 (deps gnus-newsgroup-dependencies)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8052 header references generation relations
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8053 cthread subject child end pthread relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8054 ;; First we create an alist of generations/relations, where
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8055 ;; generations is how much we trust the ralation, and the relation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8056 ;; is parent/child.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8057 (gnus-message 7 "Making sparse threads...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8058 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8059 (nnheader-set-temp-buffer " *gnus sparse threads*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8060 (while (setq header (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8061 (when (and (setq references (mail-header-references header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8062 (not (string= references "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8063 (insert references)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8064 (setq child (mail-header-id header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8065 subject (mail-header-subject header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8066 (setq generation 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8067 (while (search-backward ">" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8068 (setq end (1+ (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8069 (when (search-backward "<" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8070 (push (list (incf generation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8071 child (setq child (buffer-substring (point) end))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8072 subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8073 relations)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8074 (push (list (1+ generation) child nil subject) relations)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8075 (erase-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8076 (kill-buffer (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8077 ;; Sort over trustworthiness.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8078 (setq relations (sort relations (lambda (r1 r2) (< (car r1) (car r2)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8079 (while (setq relation (pop relations))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8080 (when (if (boundp (setq cthread (intern (cadr relation) deps)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8081 (unless (car (symbol-value cthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8082 ;; Make this article the parent of these threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8083 (setcar (symbol-value cthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8084 (vector gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8085 (cadddr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8086 "" ""
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8087 (cadr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8088 (or (caddr relation) "") 0 0 "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8089 (set cthread (list (vector gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8090 (cadddr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8091 "" "" (cadr relation)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8092 (or (caddr relation) "") 0 0 ""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8093 (push gnus-reffed-article-number gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8094 (push gnus-reffed-article-number gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8095 (push (cons gnus-reffed-article-number gnus-sparse-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8096 gnus-newsgroup-reads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8097 (decf gnus-reffed-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8098 ;; Make this new thread the child of its parent.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8099 (if (boundp (setq pthread (intern (or (caddr relation) "none") deps)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8100 (setcdr (symbol-value pthread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8101 (nconc (cdr (symbol-value pthread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8102 (list (symbol-value cthread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8103 (set pthread (list nil (symbol-value cthread))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8104 (gnus-message 7 "Making sparse threads...done")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8105
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8106 (defun gnus-build-old-threads ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8107 ;; Look at all the articles that refer back to old articles, and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8108 ;; fetch the headers for the articles that aren't there. This will
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8109 ;; build complete threads - if the roots haven't been expired by the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8110 ;; server, that is.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8111 (let (id heads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8112 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8113 (lambda (refs)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8114 (when (not (car (symbol-value refs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8115 (setq heads (cdr (symbol-value refs)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8116 (while heads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8117 (if (memq (mail-header-number (caar heads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8118 gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8119 (setq heads (cdr heads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8120 (setq id (symbol-name refs))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8121 (while (and (setq id (gnus-build-get-header id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8122 (not (car (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8123 id gnus-newsgroup-dependencies)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8124 (setq heads nil)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8125 gnus-newsgroup-dependencies)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8126
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8127 (defun gnus-build-get-header (id)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8128 ;; Look through the buffer of NOV lines and find the header to
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8129 ;; ID. Enter this line into the dependencies hash table, and return
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8130 ;; the id of the parent article (if any).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8131 (let ((deps gnus-newsgroup-dependencies)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8132 found header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8133 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8134 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8135 (set-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8136 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8137 (while (and (not found) (search-forward id nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8138 (beginning-of-line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8139 (setq found (looking-at
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8140 (format "^[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t%s"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8141 (regexp-quote id))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8142 (or found (beginning-of-line 2)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8143 (when found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8144 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8145 (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8146 (setq header (gnus-nov-parse-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8147 (read (current-buffer)) deps))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8148 (gnus-parent-id (mail-header-references header)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8149 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8150 (let ((number (mail-header-number header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8151 (push number gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8152 (push header gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8153 (if (memq number gnus-newsgroup-unselected)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8154 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8155 (push number gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8156 (setq gnus-newsgroup-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8157 (delq number gnus-newsgroup-unselected)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8158 (push number gnus-newsgroup-ancient)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8159
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8160 (defun gnus-summary-update-article (article &optional iheader)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8161 "Update ARTICLE in the summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8162 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8163 (let* ((header (or iheader (gnus-summary-article-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8164 (id (mail-header-id header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8165 (data (gnus-data-find article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8166 (thread (gnus-id-to-thread id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8167 (references (mail-header-references header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8168 (parent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8169 (gnus-id-to-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8170 (or (gnus-parent-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8171 (if (and references
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8172 (not (equal "" references)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8173 references))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8174 "none")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8175 (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8176 (old (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8177 (number (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8178 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8179 (when thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8180 ;; !!! Should this be in or not?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8181 (unless iheader
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8182 (setcar thread nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8183 (when parent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8184 (delq thread parent))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8185 (if (gnus-summary-insert-subject id header iheader)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8186 ;; Set the (possibly) new article number in the data structure.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8187 (gnus-data-set-number data (gnus-id-to-article id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8188 (setcar thread old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8189 nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8190
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8191 (defun gnus-rebuild-thread (id)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8192 "Rebuild the thread containing ID."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8193 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8194 current thread data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8195 (if (not gnus-show-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8196 (setq thread (list (car (gnus-id-to-thread id))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8197 ;; Get the thread this article is part of.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8198 (setq thread (gnus-remove-thread id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8199 (setq current (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8200 (and (zerop (forward-line -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8201 (gnus-summary-article-number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8202 ;; If this is a gathered thread, we have to go some re-gathering.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8203 (when (stringp (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8204 (let ((subject (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8205 roots thr)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8206 (setq thread (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8207 (while thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8208 (unless (memq (setq thr (gnus-id-to-thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8209 (gnus-root-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8210 (mail-header-id (caar thread)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8211 roots)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8212 (push thr roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8213 (setq thread (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8214 ;; We now have all (unique) roots.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8215 (if (= (length roots) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8216 ;; All the loose roots are now one solid root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8217 (setq thread (car roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8218 (setq thread (cons subject (gnus-sort-threads roots))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8219 (let (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8220 ;; We then insert this thread into the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8221 (let (gnus-newsgroup-data gnus-newsgroup-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8222 (gnus-summary-prepare-threads (gnus-cut-threads (list thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8223 (setq data (nreverse gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8224 (setq threads gnus-newsgroup-threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8225 ;; We splice the new data into the data structure.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8226 (gnus-data-enter-list current data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8227 (gnus-data-compute-positions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8228 (setq gnus-newsgroup-threads (nconc threads gnus-newsgroup-threads)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8229
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8230 (defun gnus-number-to-header (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8231 "Return the header for article NUMBER."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8232 (let ((headers gnus-newsgroup-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8233 (while (and headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8234 (not (= number (mail-header-number (car headers)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8235 (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8236 (when headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8237 (car headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8238
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8239 (defun gnus-id-to-thread (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8240 "Return the (sub-)thread where ID appears."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8241 (gnus-gethash id gnus-newsgroup-dependencies))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8242
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8243 (defun gnus-id-to-article (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8244 "Return the article number of ID."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8245 (let ((thread (gnus-id-to-thread id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8246 (when (and thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8247 (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8248 (mail-header-number (car thread)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8249
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8250 (defun gnus-id-to-header (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8251 "Return the article headers of ID."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8252 (car (gnus-id-to-thread id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8253
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8254 (defun gnus-article-displayed-root-p (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8255 "Say whether ARTICLE is a root(ish) article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8256 (let ((level (gnus-summary-thread-level article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8257 (refs (mail-header-references (gnus-summary-article-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8258 particle)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8259 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8260 ((null level) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8261 ((zerop level) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8262 ((null refs) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8263 ((null (gnus-parent-id refs)) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8264 ((and (= 1 level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8265 (null (setq particle (gnus-id-to-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8266 (gnus-parent-id refs))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8267 (null (gnus-summary-thread-level particle)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8268
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8269 (defun gnus-root-id (id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8270 "Return the id of the root of the thread where ID appears."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8271 (let (last-id prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8272 (while (and id (setq prev (car (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8273 id gnus-newsgroup-dependencies))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8274 (setq last-id id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8275 id (gnus-parent-id (mail-header-references prev))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8276 last-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8277
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8278 (defun gnus-remove-thread (id &optional dont-remove)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8279 "Remove the thread that has ID in it."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8280 (let ((dep gnus-newsgroup-dependencies)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8281 headers thread last-id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8282 ;; First go up in this thread until we find the root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8283 (setq last-id (gnus-root-id id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8284 (setq headers (list (car (gnus-id-to-thread last-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8285 (caadr (gnus-id-to-thread last-id))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8286 ;; We have now found the real root of this thread. It might have
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8287 ;; been gathered into some loose thread, so we have to search
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8288 ;; through the threads to find the thread we wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8289 (let ((threads gnus-newsgroup-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8290 sub)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8291 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8292 (setq sub (car threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8293 (if (stringp (car sub))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8294 ;; This is a gathered threads, so we look at the roots
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8295 ;; below it to find whether this article in in this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8296 ;; gathered root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8297 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8298 (setq sub (cdr sub))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8299 (while sub
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8300 (when (member (caar sub) headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8301 (setq thread (car threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8302 threads nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8303 sub nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8304 (setq sub (cdr sub))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8305 ;; It's an ordinary thread, so we check it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8306 (when (eq (car sub) (car headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8307 (setq thread sub
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8308 threads nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8309 (setq threads (cdr threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8310 ;; If this article is in no thread, then it's a root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8311 (if thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8312 (unless dont-remove
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8313 (setq gnus-newsgroup-threads (delq thread gnus-newsgroup-threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8314 (setq thread (gnus-gethash last-id dep)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8315 (when thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8316 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8317 thread ; We return this thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8318 (unless dont-remove
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8319 (if (stringp (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8320 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8321 ;; If we use dummy roots, then we have to remove the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8322 ;; dummy root as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8323 (when (eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8324 ;; Uhm.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8325 )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8326 (setq thread (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8327 (while thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8328 (gnus-remove-thread-1 (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8329 (setq thread (cdr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8330 (gnus-remove-thread-1 thread))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8331
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8332 (defun gnus-remove-thread-1 (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8333 "Remove the thread THREAD recursively."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8334 (let ((number (mail-header-number (car thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8335 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8336 (when (setq pos (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8337 (point-min) (point-max) 'gnus-number number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8338 (goto-char pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8339 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8340 (gnus-data-remove number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8341 (setq thread (cdr thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8342 (while thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8343 (gnus-remove-thread-1 (pop thread)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8344
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8345 (defun gnus-sort-threads (threads)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8346 "Sort THREADS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8347 (if (not gnus-thread-sort-functions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8348 threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8349 (let ((func (if (= 1 (length gnus-thread-sort-functions))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8350 (car gnus-thread-sort-functions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8351 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8352 ,(gnus-make-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8353 (reverse gnus-thread-sort-functions))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8354 (gnus-message 7 "Sorting threads...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8355 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8356 (sort threads func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8357 (gnus-message 7 "Sorting threads...done")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8358
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8359 (defun gnus-sort-articles (articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8360 "Sort ARTICLES."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8361 (when gnus-article-sort-functions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8362 (let ((func (if (= 1 (length gnus-article-sort-functions))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8363 (car gnus-article-sort-functions)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8364 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8365 ,(gnus-make-sort-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8366 (reverse gnus-article-sort-functions))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8367 (gnus-message 7 "Sorting articles...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8368 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8369 (setq gnus-newsgroup-headers (sort articles func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8370 (gnus-message 7 "Sorting articles...done")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8371
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8372 (defun gnus-make-sort-function (funs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8373 "Return a composite sort condition based on the functions in FUNC."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8374 (if (cdr funs)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8375 `(or (,(car funs) t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8376 (and (not (,(car funs) t2 t1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8377 ,(gnus-make-sort-function (cdr funs))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8378 `(,(car funs) t1 t2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8379
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8380 ;; Written by Hallvard B Furuseth <h.b.furuseth@usit.uio.no>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8381 (defmacro gnus-thread-header (thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8382 ;; Return header of first article in THREAD.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8383 ;; Note that THREAD must never, ever be anything else than a variable -
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8384 ;; using some other form will lead to serious barfage.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8385 (or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8386 ;; (8% speedup to gnus-summary-prepare, just for fun :-)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8387 (list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207" ;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8388 (vector thread) 2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8389
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8390 (defsubst gnus-article-sort-by-number (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8391 "Sort articles by article number."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8392 (< (mail-header-number h1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8393 (mail-header-number h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8394
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8395 (defun gnus-thread-sort-by-number (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8396 "Sort threads by root article number."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8397 (gnus-article-sort-by-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8398 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8399
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8400 (defsubst gnus-article-sort-by-author (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8401 "Sort articles by root author."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8402 (string-lessp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8403 (let ((extract (funcall
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8404 gnus-extract-address-components
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8405 (mail-header-from h1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8406 (or (car extract) (cdr extract)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8407 (let ((extract (funcall
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8408 gnus-extract-address-components
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8409 (mail-header-from h2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8410 (or (car extract) (cdr extract)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8411
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8412 (defun gnus-thread-sort-by-author (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8413 "Sort threads by root author."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8414 (gnus-article-sort-by-author
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8415 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8416
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8417 (defsubst gnus-article-sort-by-subject (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8418 "Sort articles by root subject."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8419 (string-lessp
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8420 (downcase (gnus-simplify-subject-re (mail-header-subject h1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8421 (downcase (gnus-simplify-subject-re (mail-header-subject h2)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8422
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8423 (defun gnus-thread-sort-by-subject (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8424 "Sort threads by root subject."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8425 (gnus-article-sort-by-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8426 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8427
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8428 (defsubst gnus-article-sort-by-date (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8429 "Sort articles by root article date."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8430 (string-lessp
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8431 (inline (gnus-sortable-date (mail-header-date h1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8432 (inline (gnus-sortable-date (mail-header-date h2)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8433
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8434 (defun gnus-thread-sort-by-date (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8435 "Sort threads by root article date."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8436 (gnus-article-sort-by-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8437 (gnus-thread-header h1) (gnus-thread-header h2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8438
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8439 (defsubst gnus-article-sort-by-score (h1 h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8440 "Sort articles by root article score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8441 Unscored articles will be counted as having a score of zero."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8442 (> (or (cdr (assq (mail-header-number h1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8443 gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8444 gnus-summary-default-score 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8445 (or (cdr (assq (mail-header-number h2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8446 gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8447 gnus-summary-default-score 0)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8448
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8449 (defun gnus-thread-sort-by-score (h1 h2)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8450 "Sort threads by root article score."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8451 (gnus-article-sort-by-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8452 (gnus-thread-header h1) (gnus-thread-header h2)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8453
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8454 (defun gnus-thread-sort-by-total-score (h1 h2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8455 "Sort threads by the sum of all scores in the thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8456 Unscored articles will be counted as having a score of zero."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8457 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8458
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8459 (defun gnus-thread-total-score (thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8460 ;; This function find the total score of THREAD.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8461 (cond ((null thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8462 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8463 ((consp thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8464 (if (stringp (car thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8465 (apply gnus-thread-score-function 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8466 (mapcar 'gnus-thread-total-score-1 (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8467 (gnus-thread-total-score-1 thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8468 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8469 (gnus-thread-total-score-1 (list thread)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8470
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8471 (defun gnus-thread-total-score-1 (root)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8472 ;; This function find the total score of the thread below ROOT.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8473 (setq root (car root))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8474 (apply gnus-thread-score-function
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8475 (or (append
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8476 (mapcar 'gnus-thread-total-score
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8477 (cdr (gnus-gethash (mail-header-id root)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8478 gnus-newsgroup-dependencies)))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8479 (if (> (mail-header-number root) 0)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8480 (list (or (cdr (assq (mail-header-number root)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8481 gnus-newsgroup-scored))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8482 gnus-summary-default-score 0))))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8483 (list gnus-summary-default-score)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8484 '(0))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8485
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8486 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8487 (defvar gnus-tmp-prev-subject nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8488 (defvar gnus-tmp-false-parent nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8489 (defvar gnus-tmp-root-expunged nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8490 (defvar gnus-tmp-dummy-line nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8491
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8492 (defun gnus-summary-prepare-threads (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8493 "Prepare summary buffer from THREADS and indentation LEVEL.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8494 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8495 or a straight list of headers."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8496 (gnus-message 7 "Generating summary...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8497
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8498 (setq gnus-newsgroup-threads threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8499 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8500
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8501 (let ((gnus-tmp-level 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8502 (default-score (or gnus-summary-default-score 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8503 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8504 thread number subject stack state gnus-tmp-gathered beg-match
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8505 new-roots gnus-tmp-new-adopts thread-end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8506 gnus-tmp-header gnus-tmp-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8507 gnus-tmp-replied gnus-tmp-subject-or-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8508 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8509 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8510 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8512 (setq gnus-tmp-prev-subject nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8513
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8514 (if (vectorp (car threads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8515 ;; If this is a straight (sic) list of headers, then a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8516 ;; threaded summary display isn't required, so we just create
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8517 ;; an unthreaded one.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8518 (gnus-summary-prepare-unthreaded threads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8519
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8520 ;; Do the threaded display.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8521
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8522 (while (or threads stack gnus-tmp-new-adopts new-roots)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8523
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8524 (if (and (= gnus-tmp-level 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8525 (not (setq gnus-tmp-dummy-line nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8526 (or (not stack)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8527 (= (caar stack) 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8528 (not gnus-tmp-false-parent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8529 (or gnus-tmp-new-adopts new-roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8530 (if gnus-tmp-new-adopts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8531 (setq gnus-tmp-level (if gnus-tmp-root-expunged 0 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8532 thread (list (car gnus-tmp-new-adopts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8533 gnus-tmp-header (caar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8534 gnus-tmp-new-adopts (cdr gnus-tmp-new-adopts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8535 (if new-roots
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8536 (setq thread (list (car new-roots))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8537 gnus-tmp-header (caar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8538 new-roots (cdr new-roots))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8539
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8540 (if threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8541 ;; If there are some threads, we do them before the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8542 ;; threads on the stack.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8543 (setq thread threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8544 gnus-tmp-header (caar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8545 ;; There were no current threads, so we pop something off
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8546 ;; the stack.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8547 (setq state (car stack)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8548 gnus-tmp-level (car state)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8549 thread (cdr state)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8550 stack (cdr stack)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8551 gnus-tmp-header (caar thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8552
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8553 (setq gnus-tmp-false-parent nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8554 (setq gnus-tmp-root-expunged nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8555 (setq thread-end nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8556
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8557 (if (stringp gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8558 ;; The header is a dummy root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8559 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8560 ((eq gnus-summary-make-false-root 'adopt)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8561 ;; We let the first article adopt the rest.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8562 (setq gnus-tmp-new-adopts (nconc gnus-tmp-new-adopts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8563 (cddar thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8564 (setq gnus-tmp-gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8565 (nconc (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8566 (lambda (h) (mail-header-number (car h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8567 (cddar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8568 gnus-tmp-gathered))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8569 (setq thread (cons (list (caar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8570 (cadar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8571 (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8572 (setq gnus-tmp-level -1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8573 gnus-tmp-false-parent t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8574 ((eq gnus-summary-make-false-root 'empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8575 ;; We print adopted articles with empty subject fields.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8576 (setq gnus-tmp-gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8577 (nconc (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8578 (lambda (h) (mail-header-number (car h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8579 (cddar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8580 gnus-tmp-gathered))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8581 (setq gnus-tmp-level -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8582 ((eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8583 ;; We remember that we probably want to output a dummy
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8584 ;; root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8585 (setq gnus-tmp-dummy-line gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8586 (setq gnus-tmp-prev-subject gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8587 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8588 ;; We do not make a root for the gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8589 ;; sub-threads at all.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8590 (setq gnus-tmp-level -1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8591
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8592 (setq number (mail-header-number gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8593 subject (mail-header-subject gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8594
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8595 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8596 ;; If the thread has changed subject, we might want to make
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8597 ;; this subthread into a root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8598 ((and (null gnus-thread-ignore-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8599 (not (zerop gnus-tmp-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8600 gnus-tmp-prev-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8601 (not (inline
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8602 (gnus-subject-equal gnus-tmp-prev-subject subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8603 (setq new-roots (nconc new-roots (list (car thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8604 thread-end t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8605 gnus-tmp-header nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8606 ;; If the article lies outside the current limit,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8607 ;; then we do not display it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8608 ((and (not (memq number gnus-newsgroup-limit))
15594
d4c3b52a5591 Would infloop under certain conditions.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15577
diff changeset
8609 (not gnus-tmp-dummy-line))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8610 (setq gnus-tmp-gathered
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8611 (nconc (mapcar
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8612 (lambda (h) (mail-header-number (car h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8613 (cdar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8614 gnus-tmp-gathered))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8615 (setq gnus-tmp-new-adopts (if (cdar thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8616 (append gnus-tmp-new-adopts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8617 (cdar thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8618 gnus-tmp-new-adopts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8619 thread-end t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8620 gnus-tmp-header nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8621 (when (zerop gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8622 (setq gnus-tmp-root-expunged t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8623 ;; Perhaps this article is to be marked as read?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8624 ((and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8625 (< (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8626 default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8627 gnus-summary-mark-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8628 ;; Don't touch sparse articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8629 (not (memq number gnus-newsgroup-sparse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8630 (not (memq number gnus-newsgroup-ancient)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8631 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8632 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8633 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8634 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8635 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8636 gnus-newsgroup-reads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8637
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8638 (when gnus-tmp-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8639 ;; We may have an old dummy line to output before this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8640 ;; article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8641 (when gnus-tmp-dummy-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8642 (gnus-summary-insert-dummy-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8643 gnus-tmp-dummy-line (mail-header-number gnus-tmp-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8644 (setq gnus-tmp-dummy-line nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8645
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8646 ;; Compute the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8647 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8648 gnus-tmp-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8649 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8650 ((memq number gnus-newsgroup-unreads) gnus-unread-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8651 ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8652 ((memq number gnus-newsgroup-dormant) gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8653 ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8654 (t (or (cdr (assq number gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8655 gnus-ancient-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8656
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8657 (push (gnus-data-make number gnus-tmp-unread (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8658 gnus-tmp-header gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8659 gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8660
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8661 ;; Actually insert the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8662 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8663 gnus-tmp-subject-or-nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8664 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8665 ((and gnus-thread-ignore-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8666 gnus-tmp-prev-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8667 (not (inline (gnus-subject-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8668 gnus-tmp-prev-subject subject))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8669 subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8670 ((zerop gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8671 (if (and (eq gnus-summary-make-false-root 'empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8672 (memq number gnus-tmp-gathered)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8673 gnus-tmp-prev-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8674 (inline (gnus-subject-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8675 gnus-tmp-prev-subject subject)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8676 gnus-summary-same-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8677 subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8678 (t gnus-summary-same-subject)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8679 (if (and (eq gnus-summary-make-false-root 'adopt)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8680 (= gnus-tmp-level 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8681 (memq number gnus-tmp-gathered))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8682 (setq gnus-tmp-opening-bracket ?\<
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8683 gnus-tmp-closing-bracket ?\>)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8684 (setq gnus-tmp-opening-bracket ?\[
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8685 gnus-tmp-closing-bracket ?\]))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8686 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8687 gnus-tmp-indentation
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8688 (aref gnus-thread-indent-array gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8689 gnus-tmp-lines (mail-header-lines gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8690 gnus-tmp-score (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8691 gnus-summary-default-score 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8692 gnus-tmp-score-char
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8693 (if (or (null gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8694 (<= (abs (- gnus-tmp-score gnus-summary-default-score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8695 gnus-summary-zcore-fuzz)) ?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8696 (if (< gnus-tmp-score gnus-summary-default-score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8697 gnus-score-below-mark gnus-score-over-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8698 gnus-tmp-replied
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8699 (cond ((memq number gnus-newsgroup-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8700 gnus-process-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8701 ((memq number gnus-newsgroup-cached)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8702 gnus-cached-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8703 ((memq number gnus-newsgroup-replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8704 gnus-replied-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8705 ((memq number gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8706 gnus-saved-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8707 (t gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8708 gnus-tmp-from (mail-header-from gnus-tmp-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8709 gnus-tmp-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8710 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8711 ((string-match "(.+)" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8712 (substring gnus-tmp-from
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8713 (1+ (match-beginning 0)) (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8714 ((string-match "<[^>]+> *$" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8715 (setq beg-match (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8716 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8717 (substring gnus-tmp-from (1+ (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8718 (1- (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8719 (substring gnus-tmp-from 0 beg-match)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8720 (t gnus-tmp-from)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8721 (when (string= gnus-tmp-name "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8722 (setq gnus-tmp-name gnus-tmp-from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8723 (or (numberp gnus-tmp-lines) (setq gnus-tmp-lines 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8724 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8725 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8726 (progn (eval gnus-summary-line-format-spec) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8727 'gnus-number number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8728 (when gnus-visual-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8729 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8730 (run-hooks 'gnus-summary-update-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8731 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8732
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8733 (setq gnus-tmp-prev-subject subject)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8734
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8735 (when (nth 1 thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8736 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8737 (incf gnus-tmp-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8738 (setq threads (if thread-end nil (cdar thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8739 (unless threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8740 (setq gnus-tmp-level 0)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8741 (gnus-message 7 "Generating summary...done"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8742
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8743 (defun gnus-summary-prepare-unthreaded (headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8744 "Generate an unthreaded summary buffer based on HEADERS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8745 (let (header number mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8746
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8747 (while headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8748 ;; We may have to root out some bad articles...
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8749 (when (memq (setq number (mail-header-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8750 (setq header (pop headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8751 gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8752 ;; Mark article as read when it has a low score.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8753 (when (and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8754 (< (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8755 gnus-summary-default-score 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8756 gnus-summary-mark-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8757 (not (memq number gnus-newsgroup-ancient)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8758 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8759 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8760 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8761 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8762 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8763 gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8764
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8765 (setq mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8766 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8767 ((memq number gnus-newsgroup-marked) gnus-ticked-mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8768 ((memq number gnus-newsgroup-dormant) gnus-dormant-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8769 ((memq number gnus-newsgroup-unreads) gnus-unread-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8770 ((memq number gnus-newsgroup-expirable) gnus-expirable-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8771 (t (or (cdr (assq number gnus-newsgroup-reads))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8772 gnus-ancient-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8773 (setq gnus-newsgroup-data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8774 (cons (gnus-data-make number mark (1+ (point)) header 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8775 gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8776 (gnus-summary-insert-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8777 header 0 nil mark (memq number gnus-newsgroup-replied)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8778 (memq number gnus-newsgroup-expirable)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8779 (mail-header-subject header) nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8780 (cdr (assq number gnus-newsgroup-scored))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8781 (memq number gnus-newsgroup-processable))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8782
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8783 (defun gnus-select-newsgroup (group &optional read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8784 "Select newsgroup GROUP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8785 If READ-ALL is non-nil, all articles in the group are selected."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8786 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8787 (info (nth 2 entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8788 articles fetched-articles cached)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8789
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8790 (or (gnus-check-server
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8791 (setq gnus-current-select-method (gnus-find-method-for-group group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8792 (error "Couldn't open server"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8793
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8794 (or (and entry (not (eq (car entry) t))) ; Either it's active...
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8795 (gnus-activate-group group) ; Or we can activate it...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8796 (progn ; Or we bug out.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8797 (when (equal major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8798 (kill-buffer (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8799 (error "Couldn't request group %s: %s"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8800 group (gnus-status-message group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8801
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8802 (unless (gnus-request-group group t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8803 (when (equal major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8804 (kill-buffer (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8805 (error "Couldn't request group %s: %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8806 group (gnus-status-message group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8807
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8808 (setq gnus-newsgroup-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8809 (setq gnus-newsgroup-unselected nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8810 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8811
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8812 (and gnus-asynchronous
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8813 (gnus-check-backend-function
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8814 'request-asynchronous gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8815 (setq gnus-newsgroup-async
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8816 (gnus-request-asynchronous gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8817
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8818 ;; Adjust and set lists of article marks.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8819 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8820 (gnus-adjust-marked-articles info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8821
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8822 ;; Kludge to avoid having cached articles nixed out in virtual groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8823 (when (gnus-virtual-group-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8824 (setq cached gnus-newsgroup-cached))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8825
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8826 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8827 (gnus-set-difference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8828 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8829 gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8830
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8831 (setq gnus-newsgroup-processable nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8832
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8833 (setq articles (gnus-articles-to-read group read-all))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8834
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8835 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8836 ((null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8837 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8838 'quit)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8839 ((eq articles 0) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8840 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8841 ;; Init the dependencies hash table.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8842 (setq gnus-newsgroup-dependencies
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8843 (gnus-make-hashtable (length articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8844 ;; Retrieve the headers and read them in.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8845 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8846 (setq gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8847 (if (eq 'nov
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8848 (setq gnus-headers-retrieved-by
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8849 (gnus-retrieve-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8850 articles gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8851 ;; We might want to fetch old headers, but
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8852 ;; not if there is only 1 article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8853 (and gnus-fetch-old-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8854 (or (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8855 (not (eq gnus-fetch-old-headers 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8856 (not (numberp gnus-fetch-old-headers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8857 (> (length articles) 1))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8858 (gnus-get-newsgroup-headers-xover articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8859 (gnus-get-newsgroup-headers)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8860 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8861
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8862 ;; Kludge to avoid having cached articles nixed out in virtual groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8863 (when cached
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8864 (setq gnus-newsgroup-cached cached))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8865
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8866 ;; Set the initial limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8867 (setq gnus-newsgroup-limit (copy-sequence articles))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8868 ;; Remove canceled articles from the list of unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8869 (setq gnus-newsgroup-unreads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8870 (gnus-set-sorted-intersection
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8871 gnus-newsgroup-unreads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8872 (setq fetched-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8873 (mapcar (lambda (headers) (mail-header-number headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8874 gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8875 ;; Removed marked articles that do not exist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8876 (gnus-update-missing-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8877 (gnus-sorted-complement fetched-articles articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8878 ;; We might want to build some more threads first.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8879 (and gnus-fetch-old-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8880 (eq gnus-headers-retrieved-by 'nov)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8881 (gnus-build-old-threads))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8882 ;; Check whether auto-expire is to be done in this group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8883 (setq gnus-newsgroup-auto-expire
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8884 (gnus-group-auto-expirable-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8885 ;; Set up the article buffer now, if necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8886 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8887 (gnus-article-setup-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8888 ;; First and last article in this newsgroup.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8889 (when gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8890 (setq gnus-newsgroup-begin
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8891 (mail-header-number (car gnus-newsgroup-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8892 gnus-newsgroup-end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8893 (mail-header-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8894 (gnus-last-element gnus-newsgroup-headers))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8895 (setq gnus-reffed-article-number -1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8896 ;; GROUP is successfully selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8897 (or gnus-newsgroup-headers t)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8898
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8899 (defun gnus-articles-to-read (group read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8900 ;; Find out what articles the user wants to read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8901 (let* ((articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8902 ;; Select all articles if `read-all' is non-nil, or if there
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8903 ;; are no unread articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8904 (if (or read-all
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8905 (and (zerop (length gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8906 (zerop (length gnus-newsgroup-unreads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8907 (gnus-uncompress-range (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8908 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8909 (copy-sequence gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8910 '<)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8911 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8912 (scored (length scored-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8913 (number (length articles))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8914 (marked (+ (length gnus-newsgroup-marked)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8915 (length gnus-newsgroup-dormant)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8916 (select
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8917 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8918 ((numberp read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8919 read-all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8920 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8921 (condition-case ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8922 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8923 ((and (or (<= scored marked) (= scored number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8924 (numberp gnus-large-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8925 (> number gnus-large-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8926 (let ((input
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8927 (read-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8928 (format
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8929 "How many articles from %s (default %d): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8930 gnus-newsgroup-name number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8931 (if (string-match "^[ \t]*$" input) number input)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8932 ((and (> scored marked) (< scored number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8933 (> (- scored number) 20))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8934 (let ((input
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8935 (read-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8936 (format "%s %s (%d scored, %d total): "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8937 "How many articles from"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8938 group scored number))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8939 (if (string-match "^[ \t]*$" input)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8940 number input)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8941 (t number))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8942 (quit nil))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8943 (setq select (if (stringp select) (string-to-number select) select))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8944 (if (or (null select) (zerop select))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8945 select
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8946 (if (and (not (zerop scored)) (<= (abs select) scored))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8947 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8948 (setq articles (sort scored-list '<))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8949 (setq number (length articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8950 (setq articles (copy-sequence articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8951
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8952 (if (< (abs select) number)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8953 (if (< select 0)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8954 ;; Select the N oldest articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8955 (setcdr (nthcdr (1- (abs select)) articles) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8956 ;; Select the N most recent articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8957 (setq articles (nthcdr (- number select) articles))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8958 (setq gnus-newsgroup-unselected
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8959 (gnus-sorted-intersection
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8960 gnus-newsgroup-unreads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8961 (gnus-sorted-complement gnus-newsgroup-unreads articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8962 articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8963
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8964 (defun gnus-killed-articles (killed articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8965 (let (out)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8966 (while articles
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8967 (if (inline (gnus-member-of-range (car articles) killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8968 (setq out (cons (car articles) out)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8969 (setq articles (cdr articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8970 out))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8971
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8972 (defun gnus-uncompress-marks (marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8973 "Uncompress the mark ranges in MARKS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8974 (let ((uncompressed '(score bookmark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8975 out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8976 (while marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8977 (if (memq (caar marks) uncompressed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8978 (push (car marks) out)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8979 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8980 (setq marks (cdr marks)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8981 out))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8982
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8983 (defun gnus-adjust-marked-articles (info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8984 "Set all article lists and remove all marks that are no longer legal."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8985 (let* ((marked-lists (gnus-info-marks info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8986 (active (gnus-active (gnus-info-group info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8987 (min (car active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8988 (max (cdr active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8989 (types gnus-article-mark-lists)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
8990 (uncompressed '(score bookmark killed))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8991 marks var articles article mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8992
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
8993 (while marked-lists
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8994 (setq marks (pop marked-lists))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8995 (set (setq var (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8996 (car (rassq (setq mark (car marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8997 types)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8998 (if (memq (car marks) uncompressed) (cdr marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
8999 (gnus-uncompress-range (cdr marks))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9000
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9001 (setq articles (symbol-value var))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9002
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9003 ;; All articles have to be subsets of the active articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9004 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9005 ;; Adjust "simple" lists.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
9006 ((memq mark '(tick dormant expirable reply save))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9007 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9008 (when (or (< (setq article (pop articles)) min) (> article max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9009 (set var (delq article (symbol-value var))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9010 ;; Adjust assocs.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
9011 ((memq mark uncompressed)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9012 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9013 (when (or (not (consp (setq article (pop articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9014 (< (car article) min)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9015 (> (car article) max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9016 (set var (delq article (symbol-value var))))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9017
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9018 (defun gnus-update-missing-marks (missing)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9019 "Go through the list of MISSING articles and remove them mark lists."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9020 (when missing
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9021 (let ((types gnus-article-mark-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9022 var m)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9023 ;; Go through all types.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9024 (while types
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9025 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9026 (when (symbol-value var)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9027 ;; This list has articles. So we delete all missing articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9028 ;; from it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9029 (setq m missing)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9030 (while m
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9031 (set var (delq (pop m) (symbol-value var)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9032
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9033 (defun gnus-update-marks ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9034 "Enter the various lists of marked articles into the newsgroup info list."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9035 (let ((types gnus-article-mark-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9036 (info (gnus-get-info gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9037 (uncompressed '(score bookmark killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9038 type list newmarked symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9039 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9040 ;; Add all marks lists that are non-nil to the list of marks lists.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9041 (while types
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9042 (setq type (pop types))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9043 (when (setq list (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9044 (setq symbol
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9045 (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9046 (car type))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9047 (push (cons (cdr type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9048 (if (memq (cdr type) uncompressed) list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9049 (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9050 (set symbol (sort list '<)) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9051 newmarked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9052
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9053 ;; Enter these new marks into the info of the group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9054 (if (nthcdr 3 info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9055 (setcar (nthcdr 3 info) newmarked)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9056 ;; Add the marks lists to the end of the info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9057 (when newmarked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9058 (setcdr (nthcdr 2 info) (list newmarked))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9059
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9060 ;; Cut off the end of the info if there's nothing else there.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9061 (let ((i 5))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9062 (while (and (> i 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9063 (not (nth i info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9064 (when (nthcdr (decf i) info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9065 (setcdr (nthcdr i info) nil)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9066
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9067 (defun gnus-add-marked-articles (group type articles &optional info force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9068 ;; Add ARTICLES of TYPE to the info of GROUP.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9069 ;; If INFO is non-nil, use that info. If FORCE is non-nil, don't
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9070 ;; add, but replace marked articles of TYPE with ARTICLES.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9071 (let ((info (or info (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9072 (uncompressed '(score bookmark killed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9073 marked m)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9074 (or (not info)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9075 (and (not (setq marked (nthcdr 3 info)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9076 (or (null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9077 (setcdr (nthcdr 2 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9078 (list (list (cons type (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9079 articles t)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9080 (and (not (setq m (assq type (car marked))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9081 (or (null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9082 (setcar marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9083 (cons (cons type (gnus-compress-sequence articles t) )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9084 (car marked)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9085 (if force
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9086 (if (null articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9087 (setcar (nthcdr 3 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9088 (delq (assq type (car marked)) (car marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9089 (setcdr m (gnus-compress-sequence articles t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9090 (setcdr m (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9091 (sort (nconc (gnus-uncompress-range (cdr m))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9092 (copy-sequence articles)) '<) t))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9093
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9094 (defun gnus-set-mode-line (where)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9095 "This function sets the mode line of the article or summary buffers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9096 If WHERE is `summary', the summary mode line format will be used."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9097 ;; Is this mode line one we keep updated?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9098 (when (memq where gnus-updated-mode-lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9099 (let (mode-string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9100 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9101 ;; We evaluate this in the summary buffer since these
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9102 ;; variables are buffer-local to that buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9103 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9104 ;; We bind all these variables that are used in the `eval' form
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9105 ;; below.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9106 (let* ((mformat (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9107 (intern
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9108 (format "gnus-%s-mode-line-format-spec" where))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9109 (gnus-tmp-group-name gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9110 (gnus-tmp-article-number (or gnus-current-article 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9111 (gnus-tmp-unread gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9112 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9113 (gnus-tmp-unselected (length gnus-newsgroup-unselected))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9114 (gnus-tmp-unread-and-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9115 (cond ((and (zerop gnus-tmp-unread-and-unticked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9116 (zerop gnus-tmp-unselected)) "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9117 ((zerop gnus-tmp-unselected)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9118 (format "{%d more}" gnus-tmp-unread-and-unticked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9119 (t (format "{%d(+%d) more}"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9120 gnus-tmp-unread-and-unticked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9121 gnus-tmp-unselected))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9122 (gnus-tmp-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9123 (if (and gnus-current-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9124 (vectorp gnus-current-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9125 (gnus-mode-string-quote
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9126 (mail-header-subject gnus-current-headers)) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9127 max-len
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9128 gnus-tmp-header);; passed as argument to any user-format-funcs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9129 (setq mode-string (eval mformat))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9130 (setq max-len (max 4 (if gnus-mode-non-string-length
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9131 (- (window-width)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9132 gnus-mode-non-string-length)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9133 (length mode-string))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9134 ;; We might have to chop a bit of the string off...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9135 (when (> (length mode-string) max-len)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9136 (setq mode-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9137 (concat (gnus-truncate-string mode-string (- max-len 3))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9138 "...")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9139 ;; Pad the mode string a bit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9140 (setq mode-string (format (format "%%-%ds" max-len) mode-string))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9141 ;; Update the mode line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9142 (setq mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9143 (gnus-mode-line-buffer-identification
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9144 (list mode-string)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9145 (set-buffer-modified-p t))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9146
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9147 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9148 "Go through the HEADERS list and add all Xrefs to a hash table.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9149 The resulting hash table is returned, or nil if no Xrefs were found."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9150 (let* ((virtual (gnus-virtual-group-p from-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9151 (prefix (if virtual "" (gnus-group-real-prefix from-newsgroup)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9152 (xref-hashtb (make-vector 63 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9153 start group entry number xrefs header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9154 (while headers
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9155 (setq header (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9156 (when (and (setq xrefs (mail-header-xref header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9157 (not (memq (setq number (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9158 unreads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9159 (setq start 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9160 (while (string-match "\\([^ ]+\\)[:/]\\([0-9]+\\)" xrefs start)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9161 (setq start (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9162 (setq group (if prefix
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9163 (concat prefix (substring xrefs (match-beginning 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9164 (match-end 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9165 (substring xrefs (match-beginning 1) (match-end 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9166 (setq number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9167 (string-to-int (substring xrefs (match-beginning 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9168 (match-end 2))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9169 (if (setq entry (gnus-gethash group xref-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9170 (setcdr entry (cons number (cdr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9171 (gnus-sethash group (cons number nil) xref-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9172 (and start xref-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9173
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9174 (defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9175 "Look through all the headers and mark the Xrefs as read."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9176 (let ((virtual (gnus-virtual-group-p from-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9177 name entry info xref-hashtb idlist method nth4)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9178 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9179 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9180 (when (setq xref-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9181 (gnus-create-xref-hashtb from-newsgroup headers unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9182 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9183 (lambda (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9184 (unless (string= from-newsgroup (setq name (symbol-name group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9185 (setq idlist (symbol-value group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9186 ;; Dead groups are not updated.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9187 (and (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9188 (setq entry (gnus-gethash name gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9189 info (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9190 (if (stringp (setq nth4 (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9191 (setq nth4 (gnus-server-to-method nth4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9192 ;; Only do the xrefs if the group has the same
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9193 ;; select method as the group we have just read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9194 (or (gnus-methods-equal-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9195 nth4 (gnus-find-method-for-group from-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9196 virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9197 (equal nth4 (setq method (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9198 from-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9199 (and (equal (car nth4) (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9200 (equal (nth 1 nth4) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9201 gnus-use-cross-reference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9202 (or (not (eq gnus-use-cross-reference t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9203 virtual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9204 ;; Only do cross-references on subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9205 ;; groups, if that is what is wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9206 (<= (gnus-info-level info) gnus-level-subscribed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9207 (gnus-group-make-articles-read name idlist))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9208 xref-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9209
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9210 (defun gnus-group-make-articles-read (group articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9211 (let* ((num 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9212 (entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9213 (info (nth 2 entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9214 (active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9215 range)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9216 ;; First peel off all illegal article numbers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9217 (if active
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9218 (let ((ids articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9219 id first)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9220 (while ids
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9221 (setq id (car ids))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9222 (if (and first (> id (cdr active)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9223 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9224 ;; We'll end up in this situation in one particular
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9225 ;; obscure situation. If you re-scan a group and get
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9226 ;; a new article that is cross-posted to a different
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9227 ;; group that has not been re-scanned, you might get
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9228 ;; crossposted article that has a higher number than
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9229 ;; Gnus believes possible. So we re-activate this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9230 ;; group as well. This might mean doing the
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
9231 ;; crossposting thingy will *increase* the number
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9232 ;; of articles in some groups. Tsk, tsk.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9233 (setq active (or (gnus-activate-group group) active))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9234 (if (or (> id (cdr active))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9235 (< id (car active)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9236 (setq articles (delq id articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9237 (setq ids (cdr ids)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9238 ;; If the read list is nil, we init it.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9239 (and active
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9240 (null (gnus-info-read info))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9241 (> (car active) 1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9242 (gnus-info-set-read info (cons 1 (1- (car active)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9243 ;; Then we add the read articles to the range.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9244 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9245 info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9246 (setq range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9247 (gnus-add-to-range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9248 (gnus-info-read info) (setq articles (sort articles '<)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9249 ;; Then we have to re-compute how many unread
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9250 ;; articles there are in this group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9251 (if active
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9252 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9253 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9254 ((not range)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9255 (setq num (- (1+ (cdr active)) (car active))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9256 ((not (listp (cdr range)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9257 (setq num (- (cdr active) (- (1+ (cdr range))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9258 (car range)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9259 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9260 (while range
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9261 (if (numberp (car range))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9262 (setq num (1+ num))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9263 (setq num (+ num (- (1+ (cdar range)) (caar range)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9264 (setq range (cdr range)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9265 (setq num (- (cdr active) num))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9266 ;; Update the number of unread articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9267 (setcar entry num)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9268 ;; Update the group buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9269 (gnus-group-update-group group t)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9270
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9271 (defun gnus-methods-equal-p (m1 m2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9272 (let ((m1 (or m1 gnus-select-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9273 (m2 (or m2 gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9274 (or (equal m1 m2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9275 (and (eq (car m1) (car m2))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9276 (or (not (memq 'address (assoc (symbol-name (car m1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9277 gnus-valid-select-methods)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9278 (equal (nth 1 m1) (nth 1 m2)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9279
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9280 (defsubst gnus-header-value ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9281 (buffer-substring (match-end 0) (gnus-point-at-eol)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9282
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9283 (defvar gnus-newsgroup-none-id 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9284
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9285 (defun gnus-get-newsgroup-headers (&optional dependencies force-new)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9286 (let ((cur nntp-server-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9287 (dependencies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9288 (or dependencies
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9289 (save-excursion (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9290 gnus-newsgroup-dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9291 headers id id-dep ref-dep end ref)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9292 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9293 (set-buffer nntp-server-buffer)
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
9294 (run-hooks 'gnus-parse-headers-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9295 (let ((case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9296 in-reply-to header p lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9297 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9298 ;; Search to the beginning of the next header. Error messages
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9299 ;; do not begin with 2 or 3.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9300 (while (re-search-forward "^[23][0-9]+ " nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9301 (setq id nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9302 ref nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9303 ;; This implementation of this function, with nine
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9304 ;; search-forwards instead of the one re-search-forward and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9305 ;; a case (which basically was the old function) is actually
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9306 ;; about twice as fast, even though it looks messier. You
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9307 ;; can't have everything, I guess. Speed and elegance
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9308 ;; doesn't always go hand in hand.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9309 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9310 header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9311 (vector
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9312 ;; Number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9313 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9314 (read cur)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9315 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9316 (setq p (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9317 (narrow-to-region (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9318 (or (and (search-forward "\n.\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9319 (- (point) 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9320 (point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9321 ;; Subject.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9322 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9323 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9324 (if (search-forward "\nsubject: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9325 (gnus-header-value) "(none)"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9326 ;; From.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9327 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9328 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9329 (if (search-forward "\nfrom: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9330 (gnus-header-value) "(nobody)"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9331 ;; Date.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9332 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9333 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9334 (if (search-forward "\ndate: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9335 (gnus-header-value) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9336 ;; Message-ID.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9337 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9338 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9339 (if (search-forward "\nmessage-id: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9340 (setq id (gnus-header-value))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9341 ;; If there was no message-id, we just fake one to make
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9342 ;; subsequent routines simpler.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9343 (setq id (concat "none+"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9344 (int-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9345 (setq gnus-newsgroup-none-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9346 (1+ gnus-newsgroup-none-id)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9347 ;; References.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9348 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9349 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9350 (if (search-forward "\nreferences: " nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9351 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9352 (setq end (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9353 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9354 (gnus-header-value)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9355 (setq ref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9356 (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9357 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9358 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9359 (search-backward ">" end t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9360 (1+ (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9361 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9362 (search-backward "<" end t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9363 (point))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9364 ;; Get the references from the in-reply-to header if there
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9365 ;; were no references and the in-reply-to header looks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9366 ;; promising.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9367 (if (and (search-forward "\nin-reply-to: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9368 (setq in-reply-to (gnus-header-value))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9369 (string-match "<[^>]+>" in-reply-to))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9370 (setq ref (substring in-reply-to (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9371 (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9372 (setq ref ""))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9373 ;; Chars.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9374 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9375 ;; Lines.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9376 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9377 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9378 (if (search-forward "\nlines: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9379 (if (numberp (setq lines (read cur)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9380 lines 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9381 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9382 ;; Xref.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9383 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9384 (goto-char p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9385 (and (search-forward "\nxref: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9386 (gnus-header-value)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9387 ;; We do the threading while we read the headers. The
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9388 ;; message-id and the last reference are both entered into
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9389 ;; the same hash table. Some tippy-toeing around has to be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9390 ;; done in case an article has arrived before the article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9391 ;; which it refers to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9392 (if (boundp (setq id-dep (intern id dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9393 (if (and (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9394 (not force-new))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9395 ;; An article with this Message-ID has already
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9396 ;; been seen, so we ignore this one, except we add
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9397 ;; any additional Xrefs (in case the two articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9398 ;; came from different servers).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9399 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9400 (mail-header-set-xref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9401 (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9402 (concat (or (mail-header-xref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9403 (car (symbol-value id-dep))) "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9404 (or (mail-header-xref header) "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9405 (setq header nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9406 (setcar (symbol-value id-dep) header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9407 (set id-dep (list header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9408 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9409 (if (boundp (setq ref-dep (intern ref dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9410 (setcdr (symbol-value ref-dep)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9411 (nconc (cdr (symbol-value ref-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9412 (list (symbol-value id-dep))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9413 (set ref-dep (list nil (symbol-value id-dep))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9414 (setq headers (cons header headers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9415 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9416 (widen))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9417 (nreverse headers)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9418
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9419 ;; The following macros and functions were written by Felix Lee
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9420 ;; <flee@cse.psu.edu>.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9421
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9422 (defmacro gnus-nov-read-integer ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9423 '(prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9424 (if (= (following-char) ?\t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9425 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9426 (let ((num (condition-case nil (read buffer) (error nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9427 (if (numberp num) num 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9428 (or (eobp) (forward-char 1))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9429
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9430 (defmacro gnus-nov-skip-field ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9431 '(search-forward "\t" eol 'move))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9432
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9433 (defmacro gnus-nov-field ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9434 '(buffer-substring (point) (if (gnus-nov-skip-field) (1- (point)) eol)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9435
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9436 ;; Goes through the xover lines and returns a list of vectors
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9437 (defun gnus-get-newsgroup-headers-xover (sequence &optional
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9438 force-new dependencies)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9439 "Parse the news overview data in the server buffer, and return a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9440 list of headers that match SEQUENCE (see `nntp-retrieve-headers')."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9441 ;; Get the Xref when the users reads the articles since most/some
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9442 ;; NNTP servers do not include Xrefs when using XOVER.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9443 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9444 (let ((cur nntp-server-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9445 (dependencies (or dependencies gnus-newsgroup-dependencies))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9446 number headers header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9447 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9448 (set-buffer nntp-server-buffer)
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
9449 ;; Allow the user to mangle the headers before parsing them.
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
9450 (run-hooks 'gnus-parse-headers-hook)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9451 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9452 (while (and sequence (not (eobp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9453 (setq number (read cur))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9454 (while (and sequence (< (car sequence) number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9455 (setq sequence (cdr sequence)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9456 (and sequence
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9457 (eq number (car sequence))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9458 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9459 (setq sequence (cdr sequence))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9460 (if (setq header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9461 (inline (gnus-nov-parse-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9462 number dependencies force-new)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9463 (setq headers (cons header headers)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9464 (forward-line 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9465 (setq headers (nreverse headers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9466 headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9467
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9468 ;; This function has to be called with point after the article number
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9469 ;; on the beginning of the line.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9470 (defun gnus-nov-parse-line (number dependencies &optional force-new)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9471 (let ((none 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9472 (eol (gnus-point-at-eol))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9473 (buffer (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9474 header ref id id-dep ref-dep)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9475
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9476 ;; overview: [num subject from date id refs chars lines misc]
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9477 (narrow-to-region (point) eol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9478 (or (eobp) (forward-char))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9479
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9480 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9481 (setq header
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9482 (vector
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9483 number ; number
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9484 (gnus-nov-field) ; subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9485 (gnus-nov-field) ; from
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9486 (gnus-nov-field) ; date
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9487 (setq id (or (gnus-nov-field)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9488 (concat "none+"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9489 (int-to-string
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9490 (setq none (1+ none)))))) ; id
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9491 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9492 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9493 (let ((beg (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9494 (search-forward "\t" eol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9495 (if (search-backward ">" beg t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9496 (setq ref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9497 (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9498 (1+ (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9499 (search-backward "<" beg t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9500 (setq ref nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9501 (gnus-nov-field)) ; refs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9502 (gnus-nov-read-integer) ; chars
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9503 (gnus-nov-read-integer) ; lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9504 (if (= (following-char) ?\n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9505 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9506 (gnus-nov-field)) ; misc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9507 ))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9508 (error (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9509 (gnus-error 4 "Strange nov line")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9510 (setq header nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9511 (goto-char eol))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9512
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9513 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9514
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9515 ;; We build the thread tree.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9516 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9517 (if (boundp (setq id-dep (intern id dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9518 (if (and (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9519 (not force-new))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9520 ;; An article with this Message-ID has already been seen,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9521 ;; so we ignore this one, except we add any additional
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9522 ;; Xrefs (in case the two articles came from different
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9523 ;; servers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9524 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9525 (mail-header-set-xref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9526 (car (symbol-value id-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9527 (concat (or (mail-header-xref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9528 (car (symbol-value id-dep))) "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9529 (or (mail-header-xref header) "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9530 (setq header nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9531 (setcar (symbol-value id-dep) header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9532 (set id-dep (list header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9533 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9534 (if (boundp (setq ref-dep (intern (or ref "none") dependencies)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9535 (setcdr (symbol-value ref-dep)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9536 (nconc (cdr (symbol-value ref-dep))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9537 (list (symbol-value id-dep))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9538 (set ref-dep (list nil (symbol-value id-dep)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9539 header))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9540
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9541 (defun gnus-article-get-xrefs ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9542 "Fill in the Xref value in `gnus-current-headers', if necessary.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9543 This is meant to be called in `gnus-article-internal-prepare-hook'."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9544 (let ((headers (save-excursion (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9545 gnus-current-headers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9546 (or (not gnus-use-cross-reference)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9547 (not headers)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9548 (and (mail-header-xref headers)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9549 (not (string= (mail-header-xref headers) "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9550 (let ((case-fold-search t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9551 xref)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9552 (save-restriction
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9553 (nnheader-narrow-to-headers)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9554 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9555 (if (or (and (eq (downcase (following-char)) ?x)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9556 (looking-at "Xref:"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9557 (search-forward "\nXref:" nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9558 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9559 (goto-char (1+ (match-end 0)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9560 (setq xref (buffer-substring (point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9561 (progn (end-of-line) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9562 (mail-header-set-xref headers xref))))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9563
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9564 (defun gnus-summary-insert-subject (id &optional old-header use-old-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9565 "Find article ID and insert the summary line for that article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9566 (let ((header (if (and old-header use-old-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9567 old-header (gnus-read-header id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9568 (number (and (numberp id) id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9569 pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9570 (when header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9571 ;; Rebuild the thread that this article is part of and go to the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9572 ;; article we have fetched.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9573 (when (and (not gnus-show-threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9574 old-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9575 (when (setq pos (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9576 (point-min) (point-max) 'gnus-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9577 (mail-header-number old-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9578 (goto-char pos)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9579 (gnus-delete-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9580 (gnus-data-remove (mail-header-number old-header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9581 (when old-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9582 (mail-header-set-number header (mail-header-number old-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9583 (setq gnus-newsgroup-sparse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9584 (delq (setq number (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9585 gnus-newsgroup-sparse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9586 (setq gnus-newsgroup-ancient (delq number gnus-newsgroup-ancient))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9587 (gnus-rebuild-thread (mail-header-id header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9588 (gnus-summary-goto-subject number nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9589 (when (and (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9590 (> number 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9591 ;; We have to update the boundaries even if we can't fetch the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9592 ;; article if ID is a number -- so that the next `P' or `N'
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9593 ;; command will fetch the previous (or next) article even
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9594 ;; if the one we tried to fetch this time has been canceled.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9595 (and (> number gnus-newsgroup-end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9596 (setq gnus-newsgroup-end number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9597 (and (< number gnus-newsgroup-begin)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9598 (setq gnus-newsgroup-begin number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9599 (setq gnus-newsgroup-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9600 (delq number gnus-newsgroup-unselected)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9601 ;; Report back a success?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9602 (and header (mail-header-number header))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9603
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9604 (defun gnus-summary-work-articles (n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9605 "Return a list of articles to be worked upon. The prefix argument,
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9606 the list of process marked articles, and the current article will be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9607 taken into consideration."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9608 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9609 (n
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9610 ;; A numerical prefix has been given.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9611 (let ((backward (< n 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9612 (n (abs (prefix-numeric-value n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9613 articles article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9614 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9615 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9616 (and (> n 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9617 (push (setq article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9618 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9619 (if backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9620 (gnus-summary-find-prev nil article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9621 (gnus-summary-find-next nil article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9622 (decf n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9623 (nreverse articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9624 ((and (boundp 'transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9625 transient-mark-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9626 mark-active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9627 ;; Work on the region between point and mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9628 (let ((max (max (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9629 articles article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9630 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9631 (goto-char (min (point) (mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9632 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9633 (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9634 (push (setq article (gnus-summary-article-number)) articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9635 (gnus-summary-find-next nil article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9636 (< (point) max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9637 (nreverse articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9638 (gnus-newsgroup-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9639 ;; There are process-marked articles present.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9640 (reverse gnus-newsgroup-processable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9641 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9642 ;; Just return the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9643 (list (gnus-summary-article-number)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9644
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9645 (defun gnus-summary-search-group (&optional backward use-level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9646 "Search for next unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9647 If optional argument BACKWARD is non-nil, search backward instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9648 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9649 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9650 (if (gnus-group-search-forward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9651 backward nil (if use-level (gnus-group-group-level) nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9652 (gnus-group-group-name))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9653
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9654 (defun gnus-summary-best-group (&optional exclude-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9655 "Find the name of the best unread group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9656 If EXCLUDE-GROUP, do not go to this group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9657 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9658 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9659 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9660 (gnus-group-best-unread-group exclude-group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9661
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9662 (defun gnus-summary-find-next (&optional unread article backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9663 (if backward (gnus-summary-find-prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9664 (let* ((dummy (gnus-summary-article-intangible-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9665 (article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9666 (arts (gnus-data-find-list article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9667 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9668 (when (and (not dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9669 (or (not gnus-summary-check-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9670 (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9671 (not (gnus-data-unread-p (car arts)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9672 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9673 (when (setq result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9674 (if unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9675 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9676 (while arts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9677 (when (gnus-data-unread-p (car arts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9678 (setq result (car arts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9679 arts nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9680 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9681 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9682 (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9683 (goto-char (gnus-data-pos result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9684 (gnus-data-number result)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9685
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9686 (defun gnus-summary-find-prev (&optional unread article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9687 (let* ((eobp (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9688 (article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9689 (arts (gnus-data-find-list article (gnus-data-list 'rev)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9690 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9691 (when (and (not eobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9692 (or (not gnus-summary-check-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9693 (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9694 (not (gnus-data-unread-p (car arts)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9695 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9696 (if (setq result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9697 (if unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9698 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9699 (while arts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9700 (and (gnus-data-unread-p (car arts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9701 (setq result (car arts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9702 arts nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9703 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9704 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9705 (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9706 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9707 (goto-char (gnus-data-pos result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9708 (gnus-data-number result)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9709
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9710 (defun gnus-summary-find-subject (subject &optional unread backward article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9711 (let* ((simp-subject (gnus-simplify-subject-fully subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9712 (article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9713 (articles (gnus-data-list backward))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9714 (arts (gnus-data-find-list article articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9715 result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9716 (when (or (not gnus-summary-check-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9717 (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9718 (not (gnus-data-unread-p (car arts))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9719 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9720 (while arts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9721 (and (or (not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9722 (gnus-data-unread-p (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9723 (vectorp (gnus-data-header (car arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9724 (gnus-subject-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9725 simp-subject (mail-header-subject (gnus-data-header (car arts))) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9726 (setq result (car arts)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9727 arts nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9728 (setq arts (cdr arts)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9729 (and result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9730 (goto-char (gnus-data-pos result))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9731 (gnus-data-number result))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9732
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9733 (defun gnus-summary-search-forward (&optional unread subject backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9734 "Search forward for an article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9735 If UNREAD, look for unread articles. If SUBJECT, look for
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9736 articles with that subject. If BACKWARD, search backward instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9737 (cond (subject (gnus-summary-find-subject subject unread backward))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9738 (backward (gnus-summary-find-prev unread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9739 (t (gnus-summary-find-next unread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9740
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9741 (defun gnus-recenter (&optional n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9742 "Center point in window and redisplay frame.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9743 Also do horizontal recentering."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9744 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9745 (when (and gnus-auto-center-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9746 (not (eq gnus-auto-center-summary 'vertical)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9747 (gnus-horizontal-recenter))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9748 (recenter n))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9749
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9750 (defun gnus-summary-recenter ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9751 "Center point in the summary window.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9752 If `gnus-auto-center-summary' is nil, or the article buffer isn't
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9753 displayed, no centering will be performed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9754 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9755 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9756 (let* ((top (cond ((< (window-height) 4) 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9757 ((< (window-height) 7) 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9758 (t 2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9759 (height (1- (window-height)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9760 (bottom (save-excursion (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9761 (forward-line (- height))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9762 (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9763 (window (get-buffer-window (current-buffer))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9764 ;; The user has to want it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9765 (when gnus-auto-center-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9766 (when (get-buffer-window gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9767 ;; Only do recentering when the article buffer is displayed,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9768 ;; Set the window start to either `bottom', which is the biggest
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9769 ;; possible valid number, or the second line from the top,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9770 ;; whichever is the least.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9771 (set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9772 window (min bottom (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9773 (forward-line (- top)) (point)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9774 ;; Do horizontal recentering while we're at it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9775 (when (and (get-buffer-window (current-buffer) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9776 (not (eq gnus-auto-center-summary 'vertical)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9777 (let ((selected (selected-window)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9778 (select-window (get-buffer-window (current-buffer) t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9779 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9780 (gnus-horizontal-recenter)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9781 (select-window selected))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9782
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9783 (defun gnus-horizontal-recenter ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9784 "Recenter the current buffer horizontally."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9785 (if (< (current-column) (/ (window-width) 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9786 (set-window-hscroll (get-buffer-window (current-buffer) t) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9787 (let* ((orig (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9788 (end (window-end (get-buffer-window (current-buffer) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9789 (max 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9790 ;; Find the longest line currently displayed in the window.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9791 (goto-char (window-start))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9792 (while (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9793 (< (point) end))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9794 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9795 (setq max (max max (current-column)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9796 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9797 (goto-char orig)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9798 ;; Scroll horizontally to center (sort of) the point.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9799 (if (> max (window-width))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9800 (set-window-hscroll
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9801 (get-buffer-window (current-buffer) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9802 (min (- (current-column) (/ (window-width) 3))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9803 (+ 2 (- max (window-width)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9804 (set-window-hscroll (get-buffer-window (current-buffer) t) 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9805 max)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9806
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9807 ;; Function written by Stainless Steel Rat <ratinox@ccs.neu.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9808 (defun gnus-short-group-name (group &optional levels)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9809 "Collapse GROUP name LEVELS."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9810 (let* ((name "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9811 (foreign "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9812 (depth 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9813 (skip 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9814 (levels (or levels
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9815 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9816 (while (string-match "\\." group skip)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9817 (setq skip (match-end 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9818 depth (+ depth 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9819 depth))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9820 (if (string-match ":" group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9821 (setq foreign (substring group 0 (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9822 group (substring group (match-end 0))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9823 (while group
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9824 (if (and (string-match "\\." group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9825 (> levels (- gnus-group-uncollapsed-levels 1)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9826 (setq name (concat name (substring group 0 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9827 group (substring group (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9828 levels (- levels 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9829 name (concat name "."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9830 (setq name (concat foreign name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9831 group nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9832 name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9833
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9834 (defun gnus-summary-jump-to-group (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9835 "Move point to NEWSGROUP in group mode buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9836 ;; Keep update point of group mode buffer if visible.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9837 (if (eq (current-buffer) (get-buffer gnus-group-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9838 (save-window-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9839 ;; Take care of tree window mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9840 (if (get-buffer-window gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9841 (pop-to-buffer gnus-group-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9842 (gnus-group-jump-to-group newsgroup))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9843 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9844 ;; Take care of tree window mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9845 (if (get-buffer-window gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9846 (pop-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9847 (set-buffer gnus-group-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9848 (gnus-group-jump-to-group newsgroup))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9849
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9850 ;; This function returns a list of article numbers based on the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9851 ;; difference between the ranges of read articles in this group and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9852 ;; the range of active articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9853 (defun gnus-list-of-unread-articles (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9854 (let* ((read (gnus-info-read (gnus-get-info group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9855 (active (gnus-active group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9856 (last (cdr active))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9857 first nlast unread)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9858 ;; If none are read, then all are unread.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9859 (if (not read)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9860 (setq first (car active))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9861 ;; If the range of read articles is a single range, then the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9862 ;; first unread article is the article after the last read
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9863 ;; article. Sounds logical, doesn't it?
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9864 (if (not (listp (cdr read)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9865 (setq first (1+ (cdr read)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9866 ;; `read' is a list of ranges.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9867 (if (/= (setq nlast (or (and (numberp (car read)) (car read))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9868 (caar read))) 1)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9869 (setq first 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9870 (while read
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9871 (if first
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9872 (while (< first nlast)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9873 (setq unread (cons first unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9874 (setq first (1+ first))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9875 (setq first (1+ (if (atom (car read)) (car read) (cdar read))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9876 (setq nlast (if (atom (cadr read)) (cadr read) (caadr read)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9877 (setq read (cdr read)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9878 ;; And add the last unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9879 (while (<= first last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9880 (setq unread (cons first unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9881 (setq first (1+ first)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9882 ;; Return the list of unread articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9883 (nreverse unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9884
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9885 (defun gnus-list-of-read-articles (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9886 "Return a list of unread, unticked and non-dormant articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9887 (let* ((info (gnus-get-info group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9888 (marked (gnus-info-marks info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9889 (active (gnus-active group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9890 (and info active
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9891 (gnus-set-difference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9892 (gnus-sorted-complement
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9893 (gnus-uncompress-range active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9894 (gnus-list-of-unread-articles group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9895 (append
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9896 (gnus-uncompress-range (cdr (assq 'dormant marked)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9897 (gnus-uncompress-range (cdr (assq 'tick marked))))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9898
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9899 ;; Various summary commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9900
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9901 (defun gnus-summary-universal-argument (arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9902 "Perform any operation on all articles that are process/prefixed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9903 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9904 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9905 (let ((articles (gnus-summary-work-articles arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9906 func article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9907 (if (eq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9908 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9909 func
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9910 (key-binding
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9911 (read-key-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9912 (substitute-command-keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9913 "\\<gnus-summary-mode-map>\\[gnus-summary-universal-argument]"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9914 ))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9915 'undefined)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9916 (gnus-error 1 "Undefined key")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9917 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9918 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9919 (gnus-summary-goto-subject (setq article (pop articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9920 (command-execute func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9921 (gnus-summary-remove-process-mark article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9922 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9923
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9924 (defun gnus-summary-toggle-truncation (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9925 "Toggle truncation of summary lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9926 With arg, turn line truncation on iff arg is positive."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9927 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9928 (setq truncate-lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9929 (if (null arg) (not truncate-lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9930 (> (prefix-numeric-value arg) 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9931 (redraw-display))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9932
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9933 (defun gnus-summary-reselect-current-group (&optional all rescan)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9934 "Exit and then reselect the current newsgroup.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9935 The prefix argument ALL means to select all articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9936 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9937 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9938 (when (gnus-ephemeral-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9939 (error "Ephemeral groups can't be reselected"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9940 (let ((current-subject (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9941 (group gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9942 (setq gnus-newsgroup-begin nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9943 (gnus-summary-exit)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9944 ;; We have to adjust the point of group mode buffer because the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9945 ;; current point was moved to the next unread newsgroup by
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9946 ;; exiting.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9947 (gnus-summary-jump-to-group group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9948 (when rescan
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9949 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9950 (gnus-group-get-new-news-this-group 1)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9951 (gnus-group-read-group all t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9952 (gnus-summary-goto-subject current-subject nil t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9953
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9954 (defun gnus-summary-rescan-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9955 "Exit the newsgroup, ask for new articles, and select the newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9956 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9957 (gnus-summary-reselect-current-group all t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9958
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9959 (defun gnus-summary-update-info ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9960 (let* ((group gnus-newsgroup-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9961 (when gnus-newsgroup-kill-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9962 (setq gnus-newsgroup-killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9963 (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9964 (nconc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9965 (gnus-set-sorted-intersection
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9966 (gnus-uncompress-range gnus-newsgroup-killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9967 (setq gnus-newsgroup-unselected
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9968 (sort gnus-newsgroup-unselected '<)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9969 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9970 (sort gnus-newsgroup-unreads '<))) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9971 (unless (listp (cdr gnus-newsgroup-killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9972 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9973 (let ((headers gnus-newsgroup-headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9974 (run-hooks 'gnus-exit-group-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9975 (unless gnus-save-score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9976 (setq gnus-newsgroup-scored nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9977 ;; Set the new ranges of read articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9978 (gnus-update-read-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9979 group (append gnus-newsgroup-unreads gnus-newsgroup-unselected))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9980 ;; Set the current article marks.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9981 (gnus-update-marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9982 ;; Do the cross-ref thing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9983 (when gnus-use-cross-reference
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9984 (gnus-mark-xrefs-as-read group headers gnus-newsgroup-unreads))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9985 ;; Do adaptive scoring, and possibly save score files.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9986 (when gnus-newsgroup-adaptive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9987 (gnus-score-adaptive))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9988 (when gnus-use-scoring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9989 (gnus-score-save))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9990 ;; Do not switch windows but change the buffer to work.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9991 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9992 (or (gnus-ephemeral-group-p gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9993 (gnus-group-update-group group)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
9994
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9995 (defun gnus-summary-exit (&optional temporary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9996 "Exit reading current newsgroup, and then return to group selection mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9997 gnus-exit-group-hook is called with no arguments if that value is non-nil."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9998 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
9999 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10000 (gnus-kill-save-kill-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10001 (let* ((group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10002 (quit-config (gnus-group-quit-config gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10003 (mode major-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10004 (buf (current-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10005 (run-hooks 'gnus-summary-prepare-exit-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10006 ;; If we have several article buffers, we kill them at exit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10007 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10008 (gnus-kill-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10009 (setq gnus-article-current nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10010 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10011 (gnus-cache-possibly-remove-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10012 (gnus-cache-save-buffers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10013 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10014 (gnus-tree-close group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10015 ;; Make all changes in this group permanent.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10016 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10017 (gnus-summary-update-info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10018 (gnus-close-group group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10019 ;; Make sure where I was, and go to next newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10020 (set-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10021 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10022 (gnus-group-jump-to-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10023 (run-hooks 'gnus-summary-exit-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10024 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10025 (gnus-group-next-unread-group 1))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10026 (if temporary
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10027 nil ;Nothing to do.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10028 ;; If we have several article buffers, we kill them at exit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10029 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10030 (gnus-kill-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10031 (gnus-kill-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10032 (setq gnus-article-current nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10033 (set-buffer buf)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10034 (if (not gnus-kill-summary-on-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10035 (gnus-deaden-summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10036 ;; We set all buffer-local variables to nil. It is unclear why
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10037 ;; this is needed, but if we don't, buffer-local variables are
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10038 ;; not garbage-collected, it seems. This would the lead to en
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10039 ;; ever-growing Emacs.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10040 (gnus-summary-clear-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10041 (when (get-buffer gnus-article-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10042 (bury-buffer gnus-article-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10043 ;; We clear the global counterparts of the buffer-local
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10044 ;; variables as well, just to be on the safe side.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10045 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10046 (gnus-summary-clear-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10047 ;; Return to group mode buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10048 (if (eq mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10049 (gnus-kill-buffer buf)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10050 (setq gnus-current-select-method gnus-select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10051 (pop-to-buffer gnus-group-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10052 ;; Clear the current group name.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10053 (if (not quit-config)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10054 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10055 (gnus-group-jump-to-group group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10056 (gnus-group-next-unread-group 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10057 (gnus-configure-windows 'group 'force))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10058 (if (not (buffer-name (car quit-config)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10059 (gnus-configure-windows 'group 'force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10060 (set-buffer (car quit-config))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10061 (and (eq major-mode 'gnus-summary-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10062 (gnus-set-global-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10063 (gnus-configure-windows (cdr quit-config))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10064 (unless quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10065 (setq gnus-newsgroup-name nil)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10066
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10067 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10068 (defun gnus-summary-exit-no-update (&optional no-questions)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10069 "Quit reading current newsgroup without updating read article info."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10070 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10071 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10072 (let* ((group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10073 (quit-config (gnus-group-quit-config group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10074 (when (or no-questions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10075 gnus-expert-user
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10076 (gnus-y-or-n-p "Do you really wanna quit reading this group? "))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10077 ;; If we have several article buffers, we kill them at exit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10078 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10079 (gnus-kill-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10080 (gnus-kill-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10081 (setq gnus-article-current nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10082 (if (not gnus-kill-summary-on-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10083 (gnus-deaden-summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10084 (gnus-close-group group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10085 (gnus-summary-clear-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10086 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10087 (gnus-summary-clear-local-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10088 (when (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10089 (kill-buffer gnus-summary-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10090 (unless gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10091 (setq gnus-article-current nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10092 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10093 (gnus-tree-close group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10094 (when (get-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10095 (bury-buffer gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10096 ;; Return to the group buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10097 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10098 ;; Clear the current group name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10099 (setq gnus-newsgroup-name nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10100 (when (equal (gnus-group-group-name) group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10101 (gnus-group-next-unread-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10102 (when quit-config
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10103 (if (not (buffer-name (car quit-config)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10104 (gnus-configure-windows 'group 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10105 (set-buffer (car quit-config))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10106 (when (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10107 (gnus-set-global-variables))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10108 (gnus-configure-windows (cdr quit-config)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10109
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10110 ;;; Dead summaries.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10111
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10112 (defvar gnus-dead-summary-mode-map nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10113
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10114 (if gnus-dead-summary-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10115 nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10116 (setq gnus-dead-summary-mode-map (make-keymap))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10117 (suppress-keymap gnus-dead-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10118 (substitute-key-definition
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10119 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10120 (let ((keys '("\C-d" "\r" "\177")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10121 (while keys
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10122 (define-key gnus-dead-summary-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10123 (pop keys) 'gnus-summary-wake-up-the-dead))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10124
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10125 (defvar gnus-dead-summary-mode nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10126 "Minor mode for Gnus summary buffers.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10127
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10128 (defun gnus-dead-summary-mode (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10129 "Minor mode for Gnus summary buffers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10130 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10131 (when (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10132 (make-local-variable 'gnus-dead-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10133 (setq gnus-dead-summary-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10134 (if (null arg) (not gnus-dead-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10135 (> (prefix-numeric-value arg) 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10136 (when gnus-dead-summary-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10137 (unless (assq 'gnus-dead-summary-mode minor-mode-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10138 (push '(gnus-dead-summary-mode " Dead") minor-mode-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10139 (unless (assq 'gnus-dead-summary-mode minor-mode-map-alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10140 (push (cons 'gnus-dead-summary-mode gnus-dead-summary-mode-map)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10141 minor-mode-map-alist)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10142
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10143 (defun gnus-deaden-summary ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10144 "Make the current summary buffer into a dead summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10145 ;; Kill any previous dead summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10146 (when (and gnus-dead-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10147 (buffer-name gnus-dead-summary))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10148 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10149 (set-buffer gnus-dead-summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10150 (when gnus-dead-summary-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10151 (kill-buffer (current-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10152 ;; Make this the current dead summary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10153 (setq gnus-dead-summary (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10154 (gnus-dead-summary-mode 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10155 (let ((name (buffer-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10156 (when (string-match "Summary" name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10157 (rename-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10158 (concat (substring name 0 (match-beginning 0)) "Dead "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10159 (substring name (match-beginning 0))) t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10160
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10161 (defun gnus-kill-or-deaden-summary (buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10162 "Kill or deaden the summary BUFFER."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10163 (when (and (buffer-name buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10164 (not gnus-single-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10165 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10166 (set-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10167 (gnus-kill-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10168 (gnus-kill-buffer gnus-original-article-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10169 (cond (gnus-kill-summary-on-exit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10170 (when (and gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10171 (and (get-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10172 (buffer-name (get-buffer buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10173 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10174 (set-buffer (get-buffer buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10175 (gnus-tree-close gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10176 (gnus-kill-buffer buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10177 ((and (get-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10178 (buffer-name (get-buffer buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10179 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10180 (set-buffer buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10181 (gnus-deaden-summary)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10182
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10183 (defun gnus-summary-wake-up-the-dead (&rest args)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10184 "Wake up the dead summary buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10185 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10186 (gnus-dead-summary-mode -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10187 (let ((name (buffer-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10188 (when (string-match "Dead " name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10189 (rename-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10190 (concat (substring name 0 (match-beginning 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10191 (substring name (match-end 0))) t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10192 (gnus-message 3 "This dead summary is now alive again"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10193
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10194 ;; Suggested by Andrew Eskilsson <pi92ae@pt.hk-r.se>.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10195 (defun gnus-summary-fetch-faq (&optional faq-dir)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10196 "Fetch the FAQ for the current group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10197 If FAQ-DIR (the prefix), prompt for a directory to search for the faq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10198 in."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10199 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10200 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10201 (if current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10202 (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10203 "Faq dir: " (and (listp gnus-group-faq-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10204 gnus-group-faq-directory)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10205 (let (gnus-faq-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10206 (and (setq gnus-faq-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10207 (gnus-group-fetch-faq gnus-newsgroup-name faq-dir))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10208 (gnus-configure-windows 'summary-faq))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10209
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10210 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10211 (defun gnus-summary-describe-group (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10212 "Describe the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10213 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10214 (gnus-group-describe-group force gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10215
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10216 (defun gnus-summary-describe-briefly ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10217 "Describe summary mode commands briefly."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10218 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10219 (gnus-message 6
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10220 (substitute-command-keys "\\<gnus-summary-mode-map>\\[gnus-summary-next-page]:Select \\[gnus-summary-next-unread-article]:Forward \\[gnus-summary-prev-unread-article]:Backward \\[gnus-summary-exit]:Exit \\[gnus-info-find-node]:Run Info \\[gnus-summary-describe-briefly]:This help")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10221
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10222 ;; Walking around group mode buffer from summary mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10223
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10224 (defun gnus-summary-next-group (&optional no-article target-group backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10225 "Exit current newsgroup and then select next unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10226 If prefix argument NO-ARTICLE is non-nil, no article is selected
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10227 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10228 previous group instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10229 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10230 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10231 (let ((current-group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10232 (current-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10233 entered)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10234 ;; First we semi-exit this group to update Xrefs and all variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10235 ;; We can't do a real exit, because the window conf must remain
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10236 ;; the same in case the user is prompted for info, and we don't
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10237 ;; want the window conf to change before that...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10238 (gnus-summary-exit t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10239 (while (not entered)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10240 ;; Then we find what group we are supposed to enter.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10241 (set-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10242 (gnus-group-jump-to-group current-group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10243 (setq target-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10244 (or target-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10245 (if (eq gnus-keep-same-level 'best)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10246 (gnus-summary-best-group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10247 (gnus-summary-search-group backward gnus-keep-same-level))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10248 (if (not target-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10249 ;; There are no further groups, so we return to the group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10250 ;; buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10251 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10252 (gnus-message 5 "Returning to the group buffer")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10253 (setq entered t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10254 (set-buffer current-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10255 (gnus-summary-exit))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10256 ;; We try to enter the target group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10257 (gnus-group-jump-to-group target-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10258 (let ((unreads (gnus-group-group-unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10259 (if (and (or (eq t unreads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10260 (and unreads (not (zerop unreads))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10261 (gnus-summary-read-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10262 target-group nil no-article current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10263 (setq entered t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10264 (setq current-group target-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10265 target-group nil)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10266
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10267 (defun gnus-summary-prev-group (&optional no-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10268 "Exit current newsgroup and then select previous unread newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10269 If prefix argument NO-ARTICLE is non-nil, no article is selected initially."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10270 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10271 (gnus-summary-next-group no-article nil t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10272
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10273 ;; Walking around summary lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10274
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10275 (defun gnus-summary-first-subject (&optional unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10276 "Go to the first unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10277 If UNREAD is non-nil, go to the first unread article.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10278 Returns the article selected or nil if there are no unread articles."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10279 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10280 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10281 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10282 ;; Empty summary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10283 ((null gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10284 (gnus-message 3 "No articles in the group")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10285 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10286 ;; Pick the first article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10287 ((not unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10288 (goto-char (gnus-data-pos (car gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10289 (gnus-data-number (car gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10290 ;; No unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10291 ((null gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10292 (gnus-message 3 "No more unread articles")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10293 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10294 ;; Find the first unread article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10295 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10296 (let ((data gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10297 (while (and data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10298 (not (gnus-data-unread-p (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10299 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10300 (if data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10301 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10302 (goto-char (gnus-data-pos (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10303 (gnus-data-number (car data)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10304 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10305
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10306 (defun gnus-summary-next-subject (n &optional unread dont-display)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10307 "Go to next N'th summary line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10308 If N is negative, go to the previous N'th subject line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10309 If UNREAD is non-nil, only unread articles are selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10310 The difference between N and the actual number of steps taken is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10311 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10312 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10313 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10314 (n (abs n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10315 (while (and (> n 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10316 (if backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10317 (gnus-summary-find-prev unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10318 (gnus-summary-find-next unread)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10319 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10320 (if (/= 0 n) (gnus-message 7 "No more%s articles"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10321 (if unread " unread" "")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10322 (unless dont-display
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10323 (gnus-summary-recenter)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10324 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10325 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10326
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10327 (defun gnus-summary-next-unread-subject (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10328 "Go to next N'th unread summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10329 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10330 (gnus-summary-next-subject n t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10331
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10332 (defun gnus-summary-prev-subject (n &optional unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10333 "Go to previous N'th summary line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10334 If optional argument UNREAD is non-nil, only unread article is selected."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10335 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10336 (gnus-summary-next-subject (- n) unread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10337
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10338 (defun gnus-summary-prev-unread-subject (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10339 "Go to previous N'th unread summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10340 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10341 (gnus-summary-next-subject (- n) t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10342
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10343 (defun gnus-summary-goto-subject (article &optional force silent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10344 "Go the subject line of ARTICLE.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10345 If FORCE, also allow jumping to articles not currently shown."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10346 (let ((b (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10347 (data (gnus-data-find article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10348 ;; We read in the article if we have to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10349 (and (not data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10350 force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10351 (gnus-summary-insert-subject article (and (vectorp force) force) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10352 (setq data (gnus-data-find article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10353 (goto-char b)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10354 (if (not data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10355 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10356 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10357 (gnus-message 3 "Can't find article %d" article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10358 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10359 (goto-char (gnus-data-pos data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10360 article)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10361
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10362 ;; Walking around summary lines with displaying articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10363
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10364 (defun gnus-summary-expand-window (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10365 "Make the summary buffer take up the entire Emacs frame.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10366 Given a prefix, will force an `article' buffer configuration."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10367 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10368 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10369 (if arg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10370 (gnus-configure-windows 'article 'force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10371 (gnus-configure-windows 'summary 'force)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10372
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10373 (defun gnus-summary-display-article (article &optional all-header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10374 "Display ARTICLE in article buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10375 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10376 (if (null article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10377 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10378 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10379 (if gnus-summary-display-article-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10380 (funcall gnus-summary-display-article-function article all-header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10381 (gnus-article-prepare article all-header))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10382 (run-hooks 'gnus-select-article-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10383 (unless (zerop gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10384 (gnus-summary-goto-subject gnus-current-article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10385 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10386 (when gnus-use-trees
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10387 (gnus-possibly-generate-tree article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10388 (gnus-highlight-selected-tree article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10389 ;; Successfully display article.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10390 (gnus-article-set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10391 (cdr (assq article gnus-newsgroup-bookmarks))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10392
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10393 (defun gnus-summary-select-article (&optional all-headers force pseudo article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10394 "Select the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10395 If ALL-HEADERS is non-nil, show all header fields. If FORCE is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10396 non-nil, the article will be re-fetched even if it already present in
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10397 the article buffer. If PSEUDO is non-nil, pseudo-articles will also
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10398 be displayed."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10399 ;; Make sure we are in the summary buffer to work around bbdb bug.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10400 (unless (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10401 (set-buffer gnus-summary-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10402 (let ((article (or article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10403 (all-headers (not (not all-headers))) ;Must be T or NIL.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10404 gnus-summary-display-article-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10405 did)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10406 (and (not pseudo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10407 (gnus-summary-article-pseudo-p article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10408 (error "This is a pseudo-article."))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10409 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10410 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10411 (set-buffer gnus-summary-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10412 (if (or (and gnus-single-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10413 (or (null gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10414 (null gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10415 (null (get-buffer gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10416 (not (eq article (cdr gnus-article-current)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10417 (not (equal (car gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10418 gnus-newsgroup-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10419 (and (not gnus-single-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10420 (or (null gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10421 (not (eq gnus-current-article article))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10422 force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10423 ;; The requested article is different from the current article.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10424 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10425 (gnus-summary-display-article article all-headers)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10426 (setq did article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10427 (if (or all-headers gnus-show-all-headers)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10428 (gnus-article-show-all-headers))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10429 'old))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10430 (if did
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10431 (gnus-article-set-window-start
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10432 (cdr (assq article gnus-newsgroup-bookmarks)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10433
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10434 (defun gnus-summary-set-current-mark (&optional current-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10435 "Obsolete function."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10436 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10437
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10438 (defun gnus-summary-next-article (&optional unread subject backward push)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10439 "Select the next article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10440 If UNREAD, only unread articles are selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10441 If SUBJECT, only articles with SUBJECT are selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10442 If BACKWARD, the previous article is selected instead of the next."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10443 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10444 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10445 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10446 ;; Is there such an article?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10447 ((and (gnus-summary-search-forward unread subject backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10448 (or (gnus-summary-display-article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10449 (eq (gnus-summary-article-mark) gnus-canceled-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10450 (gnus-summary-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10451 ;; If not, we try the first unread, if that is wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10452 ((and subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10453 gnus-auto-select-same
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
10454 (gnus-summary-first-unread-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10455 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10456 (gnus-message 6 "Wrapped"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10457 ;; Try to get next/previous article not displayed in this group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10458 ((and gnus-auto-extend-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10459 (not unread) (not subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10460 (gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10461 (if backward (1- gnus-newsgroup-begin) (1+ gnus-newsgroup-end))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10462 nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10463 ;; Go to next/previous group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10464 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10465 (or (gnus-ephemeral-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10466 (gnus-summary-jump-to-group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10467 (let ((cmd last-command-char)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10468 (group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10469 (if (eq gnus-keep-same-level 'best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10470 (gnus-summary-best-group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10471 (gnus-summary-search-group backward gnus-keep-same-level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10472 ;; For some reason, the group window gets selected. We change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10473 ;; it back.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10474 (select-window (get-buffer-window (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10475 ;; Select next unread newsgroup automagically.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10476 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10477 ((or (not gnus-auto-select-next)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10478 (not cmd))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10479 (gnus-message 7 "No more%s articles" (if unread " unread" "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10480 ((or (eq gnus-auto-select-next 'quietly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10481 (and (eq gnus-auto-select-next 'slightly-quietly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10482 push)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10483 (and (eq gnus-auto-select-next 'almost-quietly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10484 (gnus-summary-last-article-p)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10485 ;; Select quietly.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10486 (if (gnus-ephemeral-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10487 (gnus-summary-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10488 (gnus-message 7 "No more%s articles (%s)..."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10489 (if unread " unread" "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10490 (if group (concat "selecting " group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10491 "exiting"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10492 (gnus-summary-next-group nil group backward)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10493 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10494 (gnus-summary-walk-group-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10495 gnus-newsgroup-name cmd unread backward)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10496
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10497 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10498 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10499 (?\C-p (gnus-group-prev-unread-group 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10500 keve key group ended)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10501 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10502 (set-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10503 (gnus-summary-jump-to-group from-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10504 (setq group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10505 (if (eq gnus-keep-same-level 'best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10506 (gnus-summary-best-group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10507 (gnus-summary-search-group backward gnus-keep-same-level))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10508 (while (not ended)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10509 (gnus-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10510 5 "No more%s articles%s" (if unread " unread" "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10511 (if (and group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10512 (not (gnus-ephemeral-group-p gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10513 (format " (Type %s for %s [%s])"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10514 (single-key-description cmd) group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10515 (car (gnus-gethash group gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10516 (format " (Type %s to exit %s)"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10517 (single-key-description cmd)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10518 gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10519 ;; Confirm auto selection.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10520 (setq key (car (setq keve (gnus-read-event-char))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10521 (setq ended t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10522 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10523 ((assq key keystrokes)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10524 (let ((obuf (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10525 (switch-to-buffer gnus-group-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10526 (and group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10527 (gnus-group-jump-to-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10528 (eval (cadr (assq key keystrokes)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10529 (setq group (gnus-group-group-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10530 (switch-to-buffer obuf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10531 (setq ended nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10532 ((equal key cmd)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10533 (if (or (not group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10534 (gnus-ephemeral-group-p gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10535 (gnus-summary-exit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10536 (gnus-summary-next-group nil group backward)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10537 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10538 (push (cdr keve) unread-command-events))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10539
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10540 (defun gnus-read-event-char ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10541 "Get the next event."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10542 (let ((event (read-event)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10543 (cons (and (numberp event) event) event)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10544
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10545 (defun gnus-summary-next-unread-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10546 "Select unread article after current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10547 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10548 (gnus-summary-next-article t (and gnus-auto-select-same
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10549 (gnus-summary-article-subject))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10550
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10551 (defun gnus-summary-prev-article (&optional unread subject)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10552 "Select the article after the current one.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10553 If UNREAD is non-nil, only unread articles are selected."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10554 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10555 (gnus-summary-next-article unread subject t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10556
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10557 (defun gnus-summary-prev-unread-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10558 "Select unred article before current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10559 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10560 (gnus-summary-prev-article t (and gnus-auto-select-same
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10561 (gnus-summary-article-subject))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10562
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10563 (defun gnus-summary-next-page (&optional lines circular)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10564 "Show next page of the selected article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10565 If at the end of the current article, select the next article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10566 LINES says how many lines should be scrolled up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10567
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10568 If CIRCULAR is non-nil, go to the start of the article instead of
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10569 selecting the next article when reaching the end of the current
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10570 article."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10571 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10572 (setq gnus-summary-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10573 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10574 (let ((article (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10575 (endp nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10576 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10577 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10578 (if (and (eq gnus-summary-goto-unread 'never)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10579 (not (gnus-summary-last-article-p article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10580 (gnus-summary-next-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10581 (gnus-summary-next-unread-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10582 (if (or (null gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10583 (null gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10584 (/= article (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10585 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10586 ;; Selected subject is different from current article's.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10587 (gnus-summary-display-article article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10588 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10589 (setq endp (gnus-article-next-page lines)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10590 (if endp
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10591 (cond (circular
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10592 (gnus-summary-beginning-of-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10593 (lines
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10594 (gnus-message 3 "End of message"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10595 ((null lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10596 (if (and (eq gnus-summary-goto-unread 'never)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10597 (not (gnus-summary-last-article-p article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10598 (gnus-summary-next-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10599 (gnus-summary-next-unread-article)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10600 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10601 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10602
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10603 (defun gnus-summary-prev-page (&optional lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10604 "Show previous page of selected article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10605 Argument LINES specifies lines to be scrolled down."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10606 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10607 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10608 (let ((article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10609 (gnus-configure-windows 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10610 (if (or (null gnus-current-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10611 (null gnus-article-current)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10612 (/= article (cdr gnus-article-current))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10613 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10614 ;; Selected subject is different from current article's.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10615 (gnus-summary-display-article article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10616 (gnus-summary-recenter)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10617 (gnus-eval-in-buffer-window gnus-article-buffer
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10618 (gnus-article-prev-page lines))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10619 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10620
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10621 (defun gnus-summary-scroll-up (lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10622 "Scroll up (or down) one line current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10623 Argument LINES specifies lines to be scrolled up (or down if negative)."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10624 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10625 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10626 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10627 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10628 (when (eq (gnus-summary-select-article nil nil 'pseudo) 'old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10629 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10630 (cond ((> lines 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10631 (if (gnus-article-next-page lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10632 (gnus-message 3 "End of message")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10633 ((< lines 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10634 (gnus-article-prev-page (- lines))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10635 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10636 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10637
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10638 (defun gnus-summary-next-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10639 "Select next article which has the same subject as current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10640 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10641 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10642 (gnus-summary-next-article nil (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10643
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10644 (defun gnus-summary-prev-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10645 "Select previous article which has the same subject as current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10646 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10647 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10648 (gnus-summary-prev-article nil (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10649
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10650 (defun gnus-summary-next-unread-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10651 "Select next unread article which has the same subject as current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10652 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10653 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10654 (gnus-summary-next-article t (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10655
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10656 (defun gnus-summary-prev-unread-same-subject ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10657 "Select previous unread article which has the same subject as current one."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10658 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10659 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10660 (gnus-summary-prev-article t (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10661
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10662 (defun gnus-summary-first-unread-article ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10663 "Select the first unread article.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10664 Return nil if there are no unread articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10665 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10666 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10667 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10668 (if (gnus-summary-first-subject t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10669 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10670 (gnus-summary-show-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10671 (gnus-summary-first-subject t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10672 (gnus-summary-display-article (gnus-summary-article-number))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10673 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10674
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10675 (defun gnus-summary-best-unread-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10676 "Select the unread article with the highest score."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10677 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10678 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10679 (let ((best -1000000)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10680 (data gnus-newsgroup-data)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10681 article score)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10682 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10683 (and (gnus-data-unread-p (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10684 (> (setq score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10685 (gnus-summary-article-score (gnus-data-number (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10686 best)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10687 (setq best score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10688 article (gnus-data-number (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10689 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10690 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10691 (if article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10692 (gnus-summary-goto-article article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10693 (error "No unread articles"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10694 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10695
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10696 (defun gnus-summary-last-subject ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10697 "Go to the last displayed subject line in the group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10698 (let ((article (gnus-data-number (car (gnus-data-list t)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10699 (when article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10700 (gnus-summary-goto-subject article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10701
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10702 (defun gnus-summary-goto-article (article &optional all-headers force)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10703 "Fetch ARTICLE and display it if it exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10704 If ALL-HEADERS is non-nil, no header lines are hidden."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10705 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10706 (list
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10707 (string-to-int
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10708 (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10709 "Article number: "
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10710 (mapcar (lambda (number) (list (int-to-string number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10711 gnus-newsgroup-limit)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10712 current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10713 t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10714 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10715 (if (gnus-summary-goto-subject article force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10716 (gnus-summary-display-article article all-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10717 (gnus-message 4 "Couldn't go to article %s" article) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10718 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10719
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10720 (defun gnus-summary-goto-last-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10721 "Go to the previously read article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10722 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10723 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10724 (and gnus-last-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10725 (gnus-summary-goto-article gnus-last-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10726 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10727
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10728 (defun gnus-summary-pop-article (number)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10729 "Pop one article off the history and go to the previous.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10730 NUMBER articles will be popped off."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10731 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10732 (let (to)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10733 (setq gnus-newsgroup-history
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10734 (cdr (setq to (nthcdr number gnus-newsgroup-history))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10735 (if to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10736 (gnus-summary-goto-article (car to))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
10737 (error "Article history empty")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10738 (gnus-summary-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10739
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10740 ;; Summary commands and functions for limiting the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10741
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10742 (defun gnus-summary-limit-to-articles (n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10743 "Limit the summary buffer to the next N articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10744 If not given a prefix, use the process marked articles instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10745 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10746 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10747 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10748 (let ((articles (gnus-summary-work-articles n)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10749 (setq gnus-newsgroup-processable nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10750 (gnus-summary-limit articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10751 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10752
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10753 (defun gnus-summary-pop-limit (&optional total)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10754 "Restore the previous limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10755 If given a prefix, remove all limits."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10756 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10757 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10758 (when total
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10759 (setq gnus-newsgroup-limits
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10760 (list (mapcar (lambda (h) (mail-header-number h))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10761 gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10762 (unless gnus-newsgroup-limits
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10763 (error "No limit to pop"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10764 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10765 (gnus-summary-limit nil 'pop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10766 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10767
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10768 (defun gnus-summary-limit-to-subject (subject &optional header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10769 "Limit the summary buffer to articles that have subjects that match a regexp."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10770 (interactive "sRegexp: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10771 (unless header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10772 (setq header "subject"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10773 (when (not (equal "" subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10774 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10775 (let ((articles (gnus-summary-find-matching
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10776 (or header "subject") subject 'all)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10777 (or articles (error "Found no matches for \"%s\"" subject))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10778 (gnus-summary-limit articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10779 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10780
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10781 (defun gnus-summary-limit-to-author (from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10782 "Limit the summary buffer to articles that have authors that match a regexp."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10783 (interactive "sRegexp: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10784 (gnus-summary-limit-to-subject from "from"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10785
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10786 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10787 (make-obsolete
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10788 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10789
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10790 (defun gnus-summary-limit-to-unread (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10791 "Limit the summary buffer to articles that are not marked as read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10792 If ALL is non-nil, limit strictly to unread articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10793 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10794 (if all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10795 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10796 (gnus-summary-limit-to-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10797 ;; Concat all the marks that say that an article is read and have
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10798 ;; those removed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10799 (list gnus-del-mark gnus-read-mark gnus-ancient-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10800 gnus-killed-mark gnus-kill-file-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10801 gnus-low-score-mark gnus-expirable-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10802 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10803 'reverse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10804
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10805 (defalias 'gnus-summary-delete-marked-with 'gnus-summary-limit-to-marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10806 (make-obsolete 'gnus-summary-delete-marked-with 'gnus-summary-limit-to-marks)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10807
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10808 (defun gnus-summary-limit-to-marks (marks &optional reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10809 "Limit the summary buffer to articles that are marked with MARKS (e.g. \"DK\").
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10810 If REVERSE, limit the summary buffer to articles that are not marked
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10811 with MARKS. MARKS can either be a string of marks or a list of marks.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10812 Returns how many articles were removed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10813 (interactive "sMarks: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10814 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10815 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10816 (let ((data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10817 (marks (if (listp marks) marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10818 (append marks nil))) ; Transform to list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10819 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10820 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10821 (and (if reverse (not (memq (gnus-data-mark (car data)) marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10822 (memq (gnus-data-mark (car data)) marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10823 (setq articles (cons (gnus-data-number (car data)) articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10824 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10825 (gnus-summary-limit articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10826 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10827
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10828 (defun gnus-summary-limit-to-score (&optional score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10829 "Limit to articles with score at or above SCORE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10830 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10831 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10832 (setq score (if score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10833 (prefix-numeric-value score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10834 (or gnus-summary-default-score 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10835 (let ((data gnus-newsgroup-data)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10836 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10837 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10838 (when (>= (gnus-summary-article-score (gnus-data-number (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10839 score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10840 (push (gnus-data-number (car data)) articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10841 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10842 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10843 (gnus-summary-limit articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10844 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10845
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10846 (defun gnus-summary-limit-include-dormant ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10847 "Display all the hidden articles that are marked as dormant."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10848 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10849 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10850 (or gnus-newsgroup-dormant
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10851 (error "There are no dormant articles in this group"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10852 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10853 (gnus-summary-limit (append gnus-newsgroup-dormant gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10854 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10855
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10856 (defun gnus-summary-limit-exclude-dormant ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10857 "Hide all dormant articles."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10858 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10859 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10860 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10861 (gnus-summary-limit-to-marks (list gnus-dormant-mark) 'reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10862 (gnus-summary-position-point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10863
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10864 (defun gnus-summary-limit-exclude-childless-dormant ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10865 "Hide all dormant articles that have no children."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10866 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10867 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10868 (let ((data (gnus-data-list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10869 articles d children)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10870 ;; Find all articles that are either not dormant or have
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10871 ;; children.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10872 (while (setq d (pop data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10873 (when (or (not (= (gnus-data-mark d) gnus-dormant-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10874 (and (setq children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10875 (gnus-article-children (gnus-data-number d)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10876 (let (found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10877 (while children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10878 (when (memq (car children) articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10879 (setq children nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10880 found t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10881 (pop children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10882 found)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10883 (push (gnus-data-number d) articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10884 ;; Do the limiting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10885 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10886 (gnus-summary-limit articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10887 (gnus-summary-position-point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10888
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10889 (defun gnus-summary-limit-mark-excluded-as-read (&optional all)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10890 "Mark all unread excluded articles as read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10891 If ALL, mark even excluded ticked and dormants as read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10892 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10893 (let ((articles (gnus-sorted-complement
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10894 (sort
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10895 (mapcar (lambda (h) (mail-header-number h))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10896 gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10897 '<)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10898 (sort gnus-newsgroup-limit '<)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10899 article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10900 (setq gnus-newsgroup-unreads nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10901 (if all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10902 (setq gnus-newsgroup-dormant nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10903 gnus-newsgroup-marked nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10904 gnus-newsgroup-reads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10905 (nconc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10906 (mapcar (lambda (n) (cons n gnus-catchup-mark)) articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10907 gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10908 (while (setq article (pop articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10909 (unless (or (memq article gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10910 (memq article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10911 (push (cons article gnus-catchup-mark) gnus-newsgroup-reads))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10912
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10913 (defun gnus-summary-limit (articles &optional pop)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10914 (if pop
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10915 ;; We pop the previous limit off the stack and use that.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10916 (setq articles (car gnus-newsgroup-limits)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10917 gnus-newsgroup-limits (cdr gnus-newsgroup-limits))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10918 ;; We use the new limit, so we push the old limit on the stack.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10919 (setq gnus-newsgroup-limits
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10920 (cons gnus-newsgroup-limit gnus-newsgroup-limits)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10921 ;; Set the limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10922 (setq gnus-newsgroup-limit articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10923 (let ((total (length gnus-newsgroup-data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10924 (data (gnus-data-find-list (gnus-summary-article-number)))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
10925 (gnus-summary-mark-below nil) ; Inhibit this.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10926 found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10927 ;; This will do all the work of generating the new summary buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10928 ;; according to the new limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10929 (gnus-summary-prepare)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10930 ;; Hide any threads, possibly.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10931 (and gnus-show-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10932 gnus-thread-hide-subtree
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10933 (gnus-summary-hide-all-threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10934 ;; Try to return to the article you were at, or one in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10935 ;; neighborhood.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10936 (if data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10937 ;; We try to find some article after the current one.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10938 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10939 (and (gnus-summary-goto-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10940 (gnus-data-number (car data)) nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10941 (setq data nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10942 found t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10943 (setq data (cdr data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10944 (or found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10945 ;; If there is no data, that means that we were after the last
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10946 ;; article. The same goes when we can't find any articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10947 ;; after the current one.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10948 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10949 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10950 (gnus-summary-find-prev)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10951 ;; We return how many articles were removed from the summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10952 ;; buffer as a result of the new limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10953 (- total (length gnus-newsgroup-data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10954
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10955 (defsubst gnus-invisible-cut-children (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10956 (let ((num 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10957 (while threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10958 (when (memq (mail-header-number (caar threads)) gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10959 (incf num))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10960 (pop threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10961 (< num 2)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10962
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10963 (defsubst gnus-cut-thread (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10964 "Go forwards in the thread until we find an article that we want to display."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10965 (when (or (eq gnus-fetch-old-headers 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10966 (eq gnus-build-sparse-threads 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10967 (eq gnus-build-sparse-threads 'more))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10968 ;; Deal with old-fetched headers and sparse threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10969 (while (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10970 thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10971 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10972 (memq (mail-header-number (car thread)) gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10973 (memq (mail-header-number (car thread)) gnus-newsgroup-ancient))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10974 (or (<= (length (cdr thread)) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10975 (gnus-invisible-cut-children (cdr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10976 (setq thread (cadr thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10977 thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10978
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10979 (defun gnus-cut-threads (threads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10980 "Cut off all uninteresting articles from the beginning of threads."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10981 (when (or (eq gnus-fetch-old-headers 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10982 (eq gnus-build-sparse-threads 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10983 (eq gnus-build-sparse-threads 'more))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10984 (let ((th threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10985 (while th
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10986 (setcar th (gnus-cut-thread (car th)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10987 (setq th (cdr th)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10988 ;; Remove nixed out threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10989 (delq nil threads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10990
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10991 (defun gnus-summary-initial-limit (&optional show-if-empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10992 "Figure out what the initial limit is supposed to be on group entry.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10993 This entails weeding out unwanted dormants, low-scored articles,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10994 fetch-old-headers verbiage, and so on."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10995 ;; Most groups have nothing to remove.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10996 (if (or gnus-inhibit-limiting
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10997 (and (null gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10998 (not (eq gnus-fetch-old-headers 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
10999 (null gnus-summary-expunge-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11000 (not (eq gnus-build-sparse-threads 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11001 (not (eq gnus-build-sparse-threads 'more))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11002 (null gnus-thread-expunge-below)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11003 (not gnus-use-nocem)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11004 () ; Do nothing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11005 (push gnus-newsgroup-limit gnus-newsgroup-limits)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11006 (setq gnus-newsgroup-limit nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11007 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11008 (lambda (node)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11009 (unless (car (symbol-value node))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11010 ;; These threads have no parents -- they are roots.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11011 (let ((nodes (cdr (symbol-value node)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11012 thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11013 (while nodes
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11014 (if (and gnus-thread-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11015 (< (gnus-thread-total-score (car nodes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11016 gnus-thread-expunge-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11017 (gnus-expunge-thread (pop nodes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11018 (setq thread (pop nodes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11019 (gnus-summary-limit-children thread))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11020 gnus-newsgroup-dependencies)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11021 ;; If this limitation resulted in an empty group, we might
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11022 ;; pop the previous limit and use it instead.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11023 (when (and (not gnus-newsgroup-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11024 show-if-empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11025 (setq gnus-newsgroup-limit (pop gnus-newsgroup-limits)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11026 gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11027
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11028 (defun gnus-summary-limit-children (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11029 "Return 1 if this subthread is visible and 0 if it is not."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11030 ;; First we get the number of visible children to this thread. This
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11031 ;; is done by recursing down the thread using this function, so this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11032 ;; will really go down to a leaf article first, before slowly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11033 ;; working its way up towards the root.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11034 (when thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11035 (let ((children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11036 (if (cdr thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11037 (apply '+ (mapcar 'gnus-summary-limit-children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11038 (cdr thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11039 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11040 (number (mail-header-number (car thread)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11041 score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11042 (if (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11043 ;; If this article is dormant and has absolutely no visible
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11044 ;; children, then this article isn't visible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11045 (and (memq number gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11046 (= children 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11047 ;; If this is "fetch-old-headered" and there is only one
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11048 ;; visible child (or less), then we don't want this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11049 (and (eq gnus-fetch-old-headers 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11050 (memq number gnus-newsgroup-ancient)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11051 (zerop children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11052 ;; If this is a sparsely inserted article with no children,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11053 ;; we don't want it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11054 (and (eq gnus-build-sparse-threads 'some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11055 (memq number gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11056 (zerop children))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11057 ;; If we use expunging, and this article is really
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11058 ;; low-scored, then we don't want this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11059 (when (and gnus-summary-expunge-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11060 (< (setq score
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11061 (or (cdr (assq number gnus-newsgroup-scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11062 gnus-summary-default-score))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11063 gnus-summary-expunge-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11064 ;; We increase the expunge-tally here, but that has
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11065 ;; nothing to do with the limits, really.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11066 (incf gnus-newsgroup-expunged-tally)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11067 ;; We also mark as read here, if that's wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11068 (when (and gnus-summary-mark-below
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11069 (< score gnus-summary-mark-below))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11070 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11071 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11072 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11073 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11074 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11075 gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11076 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11077 (and gnus-use-nocem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11078 (gnus-nocem-unwanted-article-p (mail-header-id (car thread)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11079 ;; Nope, invisible article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11080 0
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11081 ;; Ok, this article is to be visible, so we add it to the limit
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11082 ;; and return 1.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11083 (setq gnus-newsgroup-limit (cons number gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11084 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11085
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11086 (defun gnus-expunge-thread (thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11087 "Mark all articles in THREAD as read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11088 (let* ((number (mail-header-number (car thread))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11089 (incf gnus-newsgroup-expunged-tally)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11090 ;; We also mark as read here, if that's wanted.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11091 (setq gnus-newsgroup-unreads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11092 (delq number gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11093 (if gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11094 (push number gnus-newsgroup-expirable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11095 (push (cons number gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11096 gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11097 ;; Go recursively through all subthreads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11098 (mapcar 'gnus-expunge-thread (cdr thread)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11099
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11100 ;; Summary article oriented commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11101
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11102 (defun gnus-summary-refer-parent-article (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11103 "Refer parent article N times.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11104 The difference between N and the number of articles fetched is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11105 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11106 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11107 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11108 (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11109 (> n 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11110 (let* ((header (gnus-summary-article-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11111 (ref
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11112 ;; If we try to find the parent of the currently
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11113 ;; displayed article, then we take a look at the actual
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11114 ;; References header, since this is slightly more
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11115 ;; reliable than the References field we got from the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11116 ;; server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11117 (if (and (eq (mail-header-number header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11118 (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11119 (equal gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11120 (car gnus-article-current)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11121 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11122 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11123 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11124 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11125 (message-fetch-field "references")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11126 (widen)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11127 ;; It's not the current article, so we take a bet on
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11128 ;; the value we got from the server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11129 (mail-header-references header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11130 (if (setq ref (or ref (mail-header-references header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11131 (or (gnus-summary-refer-article (gnus-parent-id ref))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11132 (gnus-message 1 "Couldn't find parent"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11133 (gnus-message 1 "No references in article %d"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11134 (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11135 nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11136 (setq n (1- n)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11137 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11138 n)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11139
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11140 (defun gnus-summary-refer-references ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11141 "Fetch all articles mentioned in the References header.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11142 Return how many articles were fetched."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11143 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11144 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11145 (let ((ref (mail-header-references (gnus-summary-article-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11146 (current (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11147 (n 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11148 ;; For each Message-ID in the References header...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11149 (while (string-match "<[^>]*>" ref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11150 (incf n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11151 ;; ... fetch that article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11152 (gnus-summary-refer-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11153 (prog1 (match-string 0 ref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11154 (setq ref (substring ref (match-end 0))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11155 (gnus-summary-goto-subject current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11156 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11157 n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11158
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11159 (defun gnus-summary-refer-article (message-id)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11160 "Fetch an article specified by MESSAGE-ID."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11161 (interactive "sMessage-ID: ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11162 (when (and (stringp message-id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11163 (not (zerop (length message-id))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11164 ;; Construct the correct Message-ID if necessary.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11165 ;; Suggested by tale@pawl.rpi.edu.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11166 (unless (string-match "^<" message-id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11167 (setq message-id (concat "<" message-id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11168 (unless (string-match ">$" message-id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11169 (setq message-id (concat message-id ">")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11170 (let* ((header (gnus-id-to-header message-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11171 (sparse (and header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11172 (memq (mail-header-number header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11173 gnus-newsgroup-sparse))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11174 (if header
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11175 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11176 ;; The article is present in the buffer, to we just go to it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11177 (gnus-summary-goto-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11178 (mail-header-number header) nil header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11179 (when sparse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11180 (gnus-summary-update-article (mail-header-number header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11181 ;; We fetch the article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11182 (let ((gnus-override-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11183 (and (gnus-news-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11184 gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11185 number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11186 ;; Start the special refer-article method, if necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11187 (when (and gnus-refer-article-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11188 (gnus-news-group-p gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11189 (gnus-check-server gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11190 ;; Fetch the header, and display the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11191 (if (setq number (gnus-summary-insert-subject message-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11192 (gnus-summary-select-article nil nil nil number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11193 (gnus-message 3 "Couldn't fetch article %s" message-id)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11194
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11195 (defun gnus-summary-enter-digest-group (&optional force)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11196 "Enter a digest group based on the current article."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11197 (interactive "P")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11198 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11199 (gnus-summary-select-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11200 (let ((name (format "%s-%d"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11201 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11202 gnus-newsgroup-name (list 'nndoc ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11203 gnus-current-article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11204 (ogroup gnus-newsgroup-name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11205 (case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11206 (buf (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11207 dig)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11208 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11209 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11210 (insert-buffer-substring gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11211 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11212 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11213 (or (search-forward "\n\n" nil t) (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11214 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11215 (delete-matching-lines "^\\(Path\\):\\|^From ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11216 (widen))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11217 (unwind-protect
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11218 (if (gnus-group-read-ephemeral-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11219 name `(nndoc ,name (nndoc-address
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11220 ,(get-buffer dig))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11221 (nndoc-article-type ,(if force 'digest 'guess))) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11222 ;; Make all postings to this group go to the parent group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11223 (nconc (gnus-info-params (gnus-get-info name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11224 (list (cons 'to-group ogroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11225 ;; Couldn't select this doc group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11226 (switch-to-buffer buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11227 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11228 (gnus-configure-windows 'summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11229 (gnus-message 3 "Article couldn't be entered?"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11230 (kill-buffer dig))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11231
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11232 (defun gnus-summary-isearch-article (&optional regexp-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11233 "Do incremental search forward on the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11234 If REGEXP-P (the prefix) is non-nil, do regexp isearch."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11235 (interactive "P")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11236 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11237 (gnus-summary-select-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11238 (gnus-configure-windows 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11239 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11240 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11241 (isearch-forward regexp-p)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11242
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11243 (defun gnus-summary-search-article-forward (regexp &optional backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11244 "Search for an article containing REGEXP forward.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11245 If BACKWARD, search backward instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11246 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11247 (list (read-string
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11248 (format "Search article %s (regexp%s): "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11249 (if current-prefix-arg "backward" "forward")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11250 (if gnus-last-search-regexp
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11251 (concat ", default " gnus-last-search-regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11252 "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11253 current-prefix-arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11254 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11255 (if (string-equal regexp "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11256 (setq regexp (or gnus-last-search-regexp ""))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11257 (setq gnus-last-search-regexp regexp))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11258 (unless (gnus-summary-search-article regexp backward)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11259 (error "Search failed: \"%s\"" regexp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11260
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11261 (defun gnus-summary-search-article-backward (regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11262 "Search for an article containing REGEXP backward."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11263 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11264 (list (read-string
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11265 (format "Search article backward (regexp%s): "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11266 (if gnus-last-search-regexp
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11267 (concat ", default " gnus-last-search-regexp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11268 "")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11269 (gnus-summary-search-article-forward regexp 'backward))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11270
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11271 (defun gnus-summary-search-article (regexp &optional backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11272 "Search for an article containing REGEXP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11273 Optional argument BACKWARD means do search for backward.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11274 `gnus-select-article-hook' is not called during the search."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11275 (let ((gnus-select-article-hook nil) ;Disable hook.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11276 (gnus-article-display-hook nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11277 (gnus-mark-article-hook nil) ;Inhibit marking as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11278 (re-search
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11279 (if backward
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11280 're-search-backward 're-search-forward))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11281 (sum (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11282 (found nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11283 (gnus-save-hidden-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11284 (gnus-summary-select-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11285 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11286 (when backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11287 (forward-line -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11288 (while (not found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11289 (gnus-message 7 "Searching article: %d..." (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11290 (if (if backward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11291 (re-search-backward regexp nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11292 (re-search-forward regexp nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11293 ;; We found the regexp.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11294 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11295 (setq found 'found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11296 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11297 (set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11298 (get-buffer-window (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11299 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11300 (forward-line 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11301 (set-buffer sum))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11302 ;; We didn't find it, so we go to the next article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11303 (set-buffer sum)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11304 (if (not (if backward (gnus-summary-find-prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11305 (gnus-summary-find-next)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11306 ;; No more articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11307 (setq found t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11308 ;; Select the next article and adjust point.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11309 (gnus-summary-select-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11310 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11311 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11312 (goto-char (if backward (point-max) (point-min))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11313 (gnus-message 7 ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11314 ;; Return whether we found the regexp.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11315 (when (eq found 'found)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11316 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11317 (gnus-summary-goto-subject gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11318 (gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11319 t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11320
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11321 (defun gnus-summary-find-matching (header regexp &optional backward unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11322 not-case-fold)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11323 "Return a list of all articles that match REGEXP on HEADER.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11324 The search stars on the current article and goes forwards unless
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11325 BACKWARD is non-nil. If BACKWARD is `all', do all articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11326 If UNREAD is non-nil, only unread articles will
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11327 be taken into consideration. If NOT-CASE-FOLD, case won't be folded
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11328 in the comparisons."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11329 (let ((data (if (eq backward 'all) gnus-newsgroup-data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11330 (gnus-data-find-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11331 (gnus-summary-article-number) (gnus-data-list backward))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11332 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11333 (case-fold-search (not not-case-fold))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11334 articles d)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11335 (or (fboundp (intern (concat "mail-header-" header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11336 (error "%s is not a valid header" header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11337 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11338 (setq d (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11339 (and (or (not unread) ; We want all articles...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11340 (gnus-data-unread-p d)) ; Or just unreads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11341 (vectorp (gnus-data-header d)) ; It's not a pseudo.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11342 (string-match regexp (funcall func (gnus-data-header d))) ; Match.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11343 (setq articles (cons (gnus-data-number d) articles))) ; Success!
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11344 (setq data (cdr data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11345 (nreverse articles)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11346
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11347 (defun gnus-summary-execute-command (header regexp command &optional backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11348 "Search forward for an article whose HEADER matches REGEXP and execute COMMAND.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11349 If HEADER is an empty string (or nil), the match is done on the entire
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11350 article. If BACKWARD (the prefix) is non-nil, search backward instead."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11351 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11352 (list (let ((completion-ignore-case t))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11353 (completing-read
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11354 "Header name: "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11355 (mapcar (lambda (string) (list string))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11356 '("Number" "Subject" "From" "Lines" "Date"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11357 "Message-ID" "Xref" "References" "Body"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11358 nil 'require-match))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11359 (read-string "Regexp: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11360 (read-key-sequence "Command: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11361 current-prefix-arg))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11362 (when (equal header "Body")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11363 (setq header ""))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11364 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11365 ;; Hidden thread subtrees must be searched as well.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11366 (gnus-summary-show-all-threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11367 ;; We don't want to change current point nor window configuration.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11368 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11369 (save-window-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11370 (gnus-message 6 "Executing %s..." (key-description command))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11371 ;; We'd like to execute COMMAND interactively so as to give arguments.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11372 (gnus-execute header regexp
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11373 `(lambda () (call-interactively ',(key-binding command)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11374 backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11375 (gnus-message 6 "Executing %s...done" (key-description command)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11376
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11377 (defun gnus-summary-beginning-of-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11378 "Scroll the article back to the beginning."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11379 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11380 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11381 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11382 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11383 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11384 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11385 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11386 (and gnus-break-pages (gnus-narrow-to-page))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11387
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11388 (defun gnus-summary-end-of-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11389 "Scroll to the end of the article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11390 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11391 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11392 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11393 (gnus-configure-windows 'article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11394 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11395 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11396 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11397 (recenter -3)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11398 (and gnus-break-pages (gnus-narrow-to-page))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11399
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11400 (defun gnus-summary-show-article (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11401 "Force re-fetching of the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11402 If ARG (the prefix) is non-nil, show the raw article without any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11403 article massaging functions being run."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11404 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11405 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11406 (if (not arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11407 ;; Select the article the normal way.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11408 (gnus-summary-select-article nil 'force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11409 ;; Bind the article treatment functions to nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11410 (let ((gnus-have-all-headers t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11411 gnus-article-display-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11412 gnus-article-prepare-hook
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11413 gnus-break-pages
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11414 gnus-visual)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11415 (gnus-summary-select-article nil 'force)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11416 (gnus-summary-goto-subject gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11417 ; (gnus-configure-windows 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11418 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11419
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11420 (defun gnus-summary-verbose-headers (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11421 "Toggle permanent full header display.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11422 If ARG is a positive number, turn header display on.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11423 If ARG is a negative number, turn header display off."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11424 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11425 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11426 (gnus-summary-toggle-header arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11427 (setq gnus-show-all-headers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11428 (cond ((or (not (numberp arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11429 (zerop arg))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11430 (not gnus-show-all-headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11431 ((natnump arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11432 t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11433
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11434 (defun gnus-summary-toggle-header (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11435 "Show the headers if they are hidden, or hide them if they are shown.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11436 If ARG is a positive number, show the entire header.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11437 If ARG is a negative number, hide the unwanted header lines."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11438 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11439 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11440 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11441 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11442 (let* ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11443 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11444 (hidden (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11445 (goto-char (point-min)) (search-forward "\n\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11446 'invisible t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11447 e)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11448 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11449 (when (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11450 (delete-region (point-min) (1- (point))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11451 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11452 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11453 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11454 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11455 (setq e (1- (or (search-forward "\n\n" nil t) (point-max)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11456 (insert-buffer-substring gnus-original-article-buffer 1 e)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11457 (let ((gnus-inhibit-hiding t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11458 (run-hooks 'gnus-article-display-hook))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11459 (if (or (not hidden) (and (numberp arg) (< arg 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11460 (gnus-article-hide-headers)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11461
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11462 (defun gnus-summary-show-all-headers ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11463 "Make all header lines visible."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11464 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11465 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11466 (gnus-article-show-all-headers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11467
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11468 (defun gnus-summary-toggle-mime (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11469 "Toggle MIME processing.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11470 If ARG is a positive number, turn MIME processing on."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11471 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11472 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11473 (setq gnus-show-mime
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11474 (if (null arg) (not gnus-show-mime)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11475 (> (prefix-numeric-value arg) 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11476 (gnus-summary-select-article t 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11477
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11478 (defun gnus-summary-caesar-message (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11479 "Caesar rotate the current article by 13.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11480 The numerical prefix specifies how manu places to rotate each letter
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11481 forward."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11482 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11483 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11484 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11485 (let ((mail-header-separator ""))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11486 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11487 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11488 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11489 (let ((start (window-start))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11490 buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11491 (message-caesar-buffer-body arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11492 (set-window-start (get-buffer-window (current-buffer)) start))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11493
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11494 (defun gnus-summary-stop-page-breaking ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11495 "Stop page breaking in the current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11496 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11497 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11498 (gnus-summary-select-article)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11499 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11500 (widen)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11501
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11502 (defun gnus-summary-move-article (&optional n to-newsgroup select-method action)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11503 "Move the current article to a different newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11504 If N is a positive number, move the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11505 If N is a negative number, move the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11506 If N is nil and any articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11507 move those articles instead.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11508 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11509 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11510 re-spool using this method.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11511
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11512 For this function to work, both the current newsgroup and the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11513 newsgroup that you want to move to have to support the `request-move'
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11514 and `request-accept' functions."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11515 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11516 (unless action (setq action 'move))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11517 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11518 ;; Check whether the source group supports the required functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11519 (cond ((and (eq action 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11520 (not (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11521 'request-move-article gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11522 (error "The current group does not support article moving"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11523 ((and (eq action 'crosspost)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11524 (not (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11525 'request-replace-article gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11526 (error "The current group does not support article editing")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11527 (let ((articles (gnus-summary-work-articles n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11528 (prefix (gnus-group-real-prefix gnus-newsgroup-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11529 (names '((move "Move" "Moving")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11530 (copy "Copy" "Copying")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11531 (crosspost "Crosspost" "Crossposting")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11532 (copy-buf (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11533 (nnheader-set-temp-buffer " *copy article*")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11534 art-group to-method new-xref article to-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11535 (unless (assq action names)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11536 (error "Unknown action %s" action))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11537 ;; Read the newsgroup name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11538 (when (and (not to-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11539 (not select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11540 (setq to-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11541 (gnus-read-move-group-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11542 (cadr (assq action names))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11543 (symbol-value (intern (format "gnus-current-%s-group" action)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11544 articles prefix))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11545 (set (intern (format "gnus-current-%s-group" action)) to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11546 (setq to-method (or select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11547 (gnus-group-name-to-method to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11548 ;; Check the method we are to move this article to...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11549 (or (gnus-check-backend-function 'request-accept-article (car to-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11550 (error "%s does not support article copying" (car to-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11551 (or (gnus-check-server to-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11552 (error "Can't open server %s" (car to-method)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11553 (gnus-message 6 "%s to %s: %s..."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11554 (caddr (assq action names))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11555 (or (car select-method) to-newsgroup) articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11556 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11557 (setq article (pop articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11558 (setq
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11559 art-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11560 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11561 ;; Move the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11562 ((eq action 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11563 (gnus-request-move-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11564 article ; Article to move
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11565 gnus-newsgroup-name ; From newsgrouo
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11566 (nth 1 (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11567 gnus-newsgroup-name)) ; Server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11568 (list 'gnus-request-accept-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11569 to-newsgroup (list 'quote select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11570 (not articles)) ; Accept form
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11571 (not articles))) ; Only save nov last time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11572 ;; Copy the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11573 ((eq action 'copy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11574 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11575 (set-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11576 (gnus-request-article-this-buffer article gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11577 (gnus-request-accept-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11578 to-newsgroup select-method (not articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11579 ;; Crosspost the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11580 ((eq action 'crosspost)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11581 (let ((xref (mail-header-xref (gnus-summary-article-header article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11582 (setq new-xref (concat gnus-newsgroup-name ":" article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11583 (if (and xref (not (string= xref "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11584 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11585 (when (string-match "^Xref: " xref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11586 (setq xref (substring xref (match-end 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11587 (setq new-xref (concat xref " " new-xref)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11588 (setq new-xref (concat (system-name) " " new-xref)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11589 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11590 (set-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11591 (gnus-request-article-this-buffer article gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11592 (nnheader-replace-header "xref" new-xref)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11593 (gnus-request-accept-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11594 to-newsgroup select-method (not articles)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11595 (if (not art-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11596 (gnus-message 1 "Couldn't %s article %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11597 (cadr (assq action names)) article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11598 (let* ((entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11599 (or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11600 (gnus-gethash (car art-group) gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11601 (gnus-gethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11602 (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11603 (car art-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11604 (or select-method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11605 (gnus-find-method-for-group to-newsgroup)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11606 gnus-newsrc-hashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11607 (info (nth 2 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11608 (to-group (gnus-info-group info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11609 ;; Update the group that has been moved to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11610 (when (and info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11611 (memq action '(move copy)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11612 (unless (member to-group to-groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11613 (push to-group to-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11614
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11615 (unless (memq article gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11616 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11617 info (gnus-add-to-range (gnus-info-read info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11618 (list (cdr art-group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11619
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11620 ;; Copy any marks over to the new group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11621 (let ((marks gnus-article-mark-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11622 (to-article (cdr art-group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11623
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11624 ;; See whether the article is to be put in the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11625 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11626 (gnus-cache-possibly-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11627 to-group to-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11628 (let ((header (copy-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11629 (gnus-summary-article-header article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11630 (mail-header-set-number header to-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11631 header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11632 (memq article gnus-newsgroup-marked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11633 (memq article gnus-newsgroup-dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11634 (memq article gnus-newsgroup-unreads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11635
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11636 (while marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11637 (when (memq article (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11638 (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11639 (caar marks)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11640 ;; If the other group is the same as this group,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11641 ;; then we have to add the mark to the list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11642 (when (equal to-group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11643 (set (intern (format "gnus-newsgroup-%s" (caar marks)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11644 (cons to-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11645 (symbol-value
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11646 (intern (format "gnus-newsgroup-%s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11647 (caar marks)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11648 ;; Copy mark to other group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11649 (gnus-add-marked-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11650 to-group (cdar marks) (list to-article) info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11651 (setq marks (cdr marks)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11652
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11653 ;; Update the Xref header in this article to point to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11654 ;; the new crossposted article we have just created.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11655 (when (eq action 'crosspost)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11656 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11657 (set-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11658 (gnus-request-article-this-buffer article gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11659 (nnheader-replace-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11660 "xref" (concat new-xref " " (gnus-group-prefixed-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11661 (car art-group) to-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11662 ":" (cdr art-group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11663 (gnus-request-replace-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11664 article gnus-newsgroup-name (current-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11665
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11666 (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11667 (when (eq action 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11668 (gnus-summary-mark-article article gnus-canceled-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11669 (gnus-summary-remove-process-mark article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11670 ;; Re-activate all groups that have been moved to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11671 (while to-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11672 (gnus-activate-group (pop to-groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11673
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11674 (gnus-kill-buffer copy-buf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11675 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11676 (gnus-set-mode-line 'summary)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11677
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11678 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11679 "Move the current article to a different newsgroup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11680 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11681 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11682 re-spool using this method."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11683 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11684 (gnus-summary-move-article n nil select-method 'copy))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11685
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11686 (defun gnus-summary-crosspost-article (&optional n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11687 "Crosspost the current article to some other group."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11688 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11689 (gnus-summary-move-article n nil nil 'crosspost))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11690
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11691 (defvar gnus-summary-respool-default-method nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11692 "Default method for respooling an article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11693 If nil, use to the current newsgroup method.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11694
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11695 (defun gnus-summary-respool-article (&optional n method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11696 "Respool the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11697 The article will be squeezed through the mail spooling process again,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11698 which means that it will be put in some mail newsgroup or other
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11699 depending on `nnmail-split-methods'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11700 If N is a positive number, respool the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11701 If N is a negative number, respool the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11702 If N is nil and any articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11703 respool those articles instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11704
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11705 Respooling can be done both from mail groups and \"real\" newsgroups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11706 In the former case, the articles in question will be moved from the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11707 current group into whatever groups they are destined to. In the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11708 latter case, they will be copied into the relevant groups."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11709 (interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11710 (list current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11711 (let* ((methods (gnus-methods-using 'respool))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11712 (methname
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11713 (symbol-name (or gnus-summary-respool-default-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11714 (car (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11715 gnus-newsgroup-name)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11716 (method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11717 (gnus-completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11718 methname "What backend do you want to use when respooling?"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11719 methods nil t nil 'gnus-method-history))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11720 ms)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11721 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11722 ((zerop (length (setq ms (gnus-servers-using-backend method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11723 (list (intern method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11724 ((= 1 (length ms))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11725 (car ms))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11726 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11727 (cdr (completing-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11728 "Server name: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11729 (mapcar (lambda (m) (cons (cadr m) m)) ms) nil t)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11730 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11731 (unless method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11732 (error "No method given for respooling"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11733 (if (assoc (symbol-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11734 (car (gnus-find-method-for-group gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11735 (gnus-methods-using 'respool))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11736 (gnus-summary-move-article n nil method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11737 (gnus-summary-copy-article n nil method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11738
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11739 (defun gnus-summary-import-article (file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11740 "Import a random file into a mail newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11741 (interactive "fImport file: ")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11742 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11743 (let ((group gnus-newsgroup-name)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11744 (now (current-time))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11745 atts lines)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11746 (or (gnus-check-backend-function 'request-accept-article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11747 (error "%s does not support article importing" group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11748 (or (file-readable-p file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11749 (not (file-regular-p file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11750 (error "Can't read %s" file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11751 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11752 (set-buffer (get-buffer-create " *import file*"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11753 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11754 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11755 (insert-file-contents file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11756 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11757 (unless (nnheader-article-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11758 ;; This doesn't look like an article, so we fudge some headers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11759 (setq atts (file-attributes file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11760 lines (count-lines (point-min) (point-max)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11761 (insert "From: " (read-string "From: ") "\n"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11762 "Subject: " (read-string "Subject: ") "\n"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11763 "Date: " (timezone-make-date-arpa-standard
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11764 (current-time-string (nth 5 atts))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11765 (current-time-zone now)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11766 (current-time-zone now)) "\n"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11767 "Message-ID: " (message-make-message-id) "\n"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11768 "Lines: " (int-to-string lines) "\n"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11769 "Chars: " (int-to-string (nth 7 atts)) "\n\n"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11770 (gnus-request-accept-article group nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11771 (kill-buffer (current-buffer)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11772
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11773 (defun gnus-summary-expire-articles (&optional now)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11774 "Expire all articles that are marked as expirable in the current group."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11775 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11776 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11777 (when (gnus-check-backend-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11778 'request-expire-articles gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11779 ;; This backend supports expiry.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11780 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11781 (expirable (if total
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11782 (gnus-list-of-read-articles gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11783 (setq gnus-newsgroup-expirable
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11784 (sort gnus-newsgroup-expirable '<))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11785 (expiry-wait (if now 'immediate
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11786 (gnus-group-get-parameter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11787 gnus-newsgroup-name 'expiry-wait)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11788 es)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11789 (when expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11790 ;; There are expirable articles in this group, so we run them
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11791 ;; through the expiry process.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11792 (gnus-message 6 "Expiring articles...")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11793 ;; The list of articles that weren't expired is returned.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11794 (if expiry-wait
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11795 (let ((nnmail-expiry-wait-function nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11796 (nnmail-expiry-wait expiry-wait))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11797 (setq es (gnus-request-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11798 expirable gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11799 (setq es (gnus-request-expire-articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11800 expirable gnus-newsgroup-name)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11801 (or total (setq gnus-newsgroup-expirable es))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11802 ;; We go through the old list of expirable, and mark all
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
11803 ;; really expired articles as nonexistent.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11804 (unless (eq es expirable) ;If nothing was expired, we don't mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11805 (let ((gnus-use-cache nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11806 (while expirable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11807 (unless (memq (car expirable) es)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11808 (when (gnus-data-find (car expirable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11809 (gnus-summary-mark-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11810 (car expirable) gnus-canceled-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11811 (setq expirable (cdr expirable)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11812 (gnus-message 6 "Expiring articles...done")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11813
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11814 (defun gnus-summary-expire-articles-now ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11815 "Expunge all expirable articles in the current group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11816 This means that *all* articles that are marked as expirable will be
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11817 deleted forever, right now."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11818 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11819 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11820 (or gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11821 (gnus-y-or-n-p
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11822 "Are you really, really, really sure you want to delete all these messages? ")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11823 (error "Phew!"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11824 (gnus-summary-expire-articles t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11825
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11826 ;; Suggested by Jack Vinson <vinson@unagi.cis.upenn.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11827 (defun gnus-summary-delete-article (&optional n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11828 "Delete the N next (mail) articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11829 This command actually deletes articles. This is not a marking
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11830 command. The article will disappear forever from your life, never to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11831 return.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11832 If N is negative, delete backwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11833 If N is nil and articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11834 delete these instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11835 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11836 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11837 (or (gnus-check-backend-function 'request-expire-articles
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11838 gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11839 (error "The current newsgroup does not support article deletion."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11840 ;; Compute the list of articles to delete.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11841 (let ((articles (gnus-summary-work-articles n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11842 not-deleted)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11843 (if (and gnus-novice-user
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11844 (not (gnus-y-or-n-p
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11845 (format "Do you really want to delete %s forever? "
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11846 (if (> (length articles) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11847 (format "these %s articles" (length articles))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11848 "this article")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11849 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11850 ;; Delete the articles.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11851 (setq not-deleted (gnus-request-expire-articles
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11852 articles gnus-newsgroup-name 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11853 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11854 (gnus-summary-remove-process-mark (car articles))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11855 ;; The backend might not have been able to delete the article
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11856 ;; after all.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11857 (or (memq (car articles) not-deleted)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11858 (gnus-summary-mark-article (car articles) gnus-canceled-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11859 (setq articles (cdr articles))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11860 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11861 (gnus-set-mode-line 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11862 not-deleted))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11863
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11864 (defun gnus-summary-edit-article (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11865 "Enter into a buffer and edit the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11866 This will have permanent effect only in mail groups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11867 If FORCE is non-nil, allow editing of articles even in read-only
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11868 groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11869 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11870 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11871 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11872 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11873 (when (and (not force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11874 (gnus-group-read-only-p))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11875 (error "The current newsgroup does not support article editing."))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11876 (gnus-summary-select-article t nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11877 (gnus-configure-windows 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11878 (select-window (get-buffer-window gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11879 (gnus-message 6 "C-c C-c to end edits")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11880 (setq buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11881 (text-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11882 (use-local-map (copy-keymap (current-local-map)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11883 (local-set-key "\C-c\C-c" 'gnus-summary-edit-article-done)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11884 (buffer-enable-undo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11885 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11886 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11887 (search-forward "\n\n" nil t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11888
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11889 (defun gnus-summary-edit-article-done ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11890 "Make edits to the current article permanent."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11891 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11892 (if (gnus-group-read-only-p)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11893 (progn
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11894 (let ((beep (not (eq major-mode 'text-mode))))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11895 (gnus-summary-edit-article-postpone)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11896 (when beep
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11897 (gnus-error
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
11898 3 "The current newsgroup does not support article editing."))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11899 (let ((buf (format "%s" (buffer-string))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11900 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11901 (insert buf)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11902 (if (not (gnus-request-replace-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11903 (cdr gnus-article-current) (car gnus-article-current)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11904 (current-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11905 (error "Couldn't replace article.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11906 (gnus-article-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11907 (use-local-map gnus-article-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11908 (setq buffer-read-only t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11909 (buffer-disable-undo (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11910 (gnus-configure-windows 'summary)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11911 (gnus-summary-update-article (cdr gnus-article-current))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11912 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11913 (gnus-cache-update-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11914 (car gnus-article-current) (cdr gnus-article-current)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11915 (when gnus-keep-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11916 (gnus-backlog-remove-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11917 (car gnus-article-current) (cdr gnus-article-current))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11918 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11919 (when (get-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11920 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11921 (setq gnus-original-article nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11922 (setq gnus-article-current nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11923 gnus-current-article nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11924 (run-hooks 'gnus-article-display-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11925 (and (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11926 (run-hooks 'gnus-visual-mark-article-hook)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11927
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11928 (defun gnus-summary-edit-article-postpone ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11929 "Postpone changes to the current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11930 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11931 (gnus-article-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11932 (use-local-map gnus-article-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11933 (setq buffer-read-only t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11934 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11935 (gnus-configure-windows 'summary)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11936 (and (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11937 (run-hooks 'gnus-visual-mark-article-hook)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11938
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11939 (defun gnus-summary-respool-query ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11940 "Query where the respool algorithm would put this article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11941 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11942 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11943 (gnus-summary-select-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11944 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11945 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11946 (save-restriction
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11947 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11948 (search-forward "\n\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11949 (narrow-to-region (point-min) (point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11950 (pp-eval-expression
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11951 (list 'quote (mapcar 'car (nnmail-article-group 'identity)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11952
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11953 ;; Summary marking commands.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11954
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11955 (defun gnus-summary-kill-same-subject-and-select (&optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11956 "Mark articles which has the same subject as read, and then select the next.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11957 If UNMARK is positive, remove any kind of mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11958 If UNMARK is negative, tick articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11959 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11960 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11961 (if unmark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11962 (setq unmark (prefix-numeric-value unmark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11963 (let ((count
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11964 (gnus-summary-mark-same-subject
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11965 (gnus-summary-article-subject) unmark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11966 ;; Select next unread article. If auto-select-same mode, should
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11967 ;; select the first unread article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11968 (gnus-summary-next-article t (and gnus-auto-select-same
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11969 (gnus-summary-article-subject)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11970 (gnus-message 7 "%d article%s marked as %s"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11971 count (if (= count 1) " is" "s are")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11972 (if unmark "unread" "read"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11973
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11974 (defun gnus-summary-kill-same-subject (&optional unmark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11975 "Mark articles which has the same subject as read.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11976 If UNMARK is positive, remove any kind of mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11977 If UNMARK is negative, tick articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11978 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11979 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11980 (if unmark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11981 (setq unmark (prefix-numeric-value unmark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11982 (let ((count
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11983 (gnus-summary-mark-same-subject
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11984 (gnus-summary-article-subject) unmark)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11985 ;; If marked as read, go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11986 (if (null unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11987 ;; Go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11988 (gnus-summary-next-subject 1 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11989 (gnus-message 7 "%d articles are marked as %s"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11990 count (if unmark "unread" "read"))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11991
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11992 (defun gnus-summary-mark-same-subject (subject &optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11993 "Mark articles with same SUBJECT as read, and return marked number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11994 If optional argument UNMARK is positive, remove any kinds of marks.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11995 If optional argument UNMARK is negative, mark articles as unread instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11996 (let ((count 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11997 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
11998 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
11999 ((null unmark) ; Mark as read.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12000 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12001 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12002 (gnus-summary-mark-article-as-read gnus-killed-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12003 (gnus-summary-show-thread) t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12004 (gnus-summary-find-subject subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12005 (setq count (1+ count))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12006 ((> unmark 0) ; Tick.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12007 (while (and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12008 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12009 (gnus-summary-mark-article-as-unread gnus-ticked-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12010 (gnus-summary-show-thread) t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12011 (gnus-summary-find-subject subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12012 (setq count (1+ count))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12013 (t ; Mark as unread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12014 (while (and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12015 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12016 (gnus-summary-mark-article-as-unread gnus-unread-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12017 (gnus-summary-show-thread) t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12018 (gnus-summary-find-subject subject))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12019 (setq count (1+ count)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12020 (gnus-set-mode-line 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12021 ;; Return the number of marked articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12022 count)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12023
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12024 (defun gnus-summary-mark-as-processable (n &optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12025 "Set the process mark on the next N articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12026 If N is negative, mark backward instead. If UNMARK is non-nil, remove
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12027 the process mark instead. The difference between N and the actual
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12028 number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12029 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12030 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12031 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12032 (n (abs n)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12033 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12034 (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12035 (if unmark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12036 (gnus-summary-remove-process-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12037 (gnus-summary-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12038 (gnus-summary-set-process-mark (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12039 (zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12040 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12041 (if (/= 0 n) (gnus-message 7 "No more articles"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12042 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12043 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12044 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12045
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12046 (defun gnus-summary-unmark-as-processable (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12047 "Remove the process mark from the next N articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12048 If N is negative, mark backward instead. The difference between N and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12049 the actual number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12050 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12051 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12052 (gnus-summary-mark-as-processable n t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12053
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12054 (defun gnus-summary-unmark-all-processable ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12055 "Remove the process mark from all articles."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12056 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12057 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12058 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12059 (while gnus-newsgroup-processable
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12060 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12061 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12062
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12063 (defun gnus-summary-mark-as-expirable (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12064 "Mark N articles forward as expirable.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12065 If N is negative, mark backward instead. The difference between N and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12066 the actual number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12067 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12068 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12069 (gnus-summary-mark-forward n gnus-expirable-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12070
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12071 (defun gnus-summary-mark-article-as-replied (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12072 "Mark ARTICLE replied and update the summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12073 (setq gnus-newsgroup-replied (cons article gnus-newsgroup-replied))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12074 (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12075 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12076 (gnus-summary-update-secondary-mark article))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12077
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12078 (defun gnus-summary-set-bookmark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12079 "Set a bookmark in current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12080 (interactive (list (gnus-summary-article-number)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12081 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12082 (if (or (not (get-buffer gnus-article-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12083 (not gnus-current-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12084 (not gnus-article-current)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12085 (not (equal gnus-newsgroup-name (car gnus-article-current))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12086 (error "No current article selected"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12087 ;; Remove old bookmark, if one exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12088 (let ((old (assq article gnus-newsgroup-bookmarks)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12089 (if old (setq gnus-newsgroup-bookmarks
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12090 (delq old gnus-newsgroup-bookmarks))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12091 ;; Set the new bookmark, which is on the form
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12092 ;; (article-number . line-number-in-body).
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12093 (setq gnus-newsgroup-bookmarks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12094 (cons
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12095 (cons article
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12096 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12097 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12098 (count-lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12099 (min (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12100 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12101 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12102 (search-forward "\n\n" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12103 (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12104 (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12105 gnus-newsgroup-bookmarks))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12106 (gnus-message 6 "A bookmark has been added to the current article."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12107
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12108 (defun gnus-summary-remove-bookmark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12109 "Remove the bookmark from the current article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12110 (interactive (list (gnus-summary-article-number)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12111 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12112 ;; Remove old bookmark, if one exists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12113 (let ((old (assq article gnus-newsgroup-bookmarks)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12114 (if old
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12115 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12116 (setq gnus-newsgroup-bookmarks
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12117 (delq old gnus-newsgroup-bookmarks))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12118 (gnus-message 6 "Removed bookmark."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12119 (gnus-message 6 "No bookmark in current article."))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12120
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12121 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12122 (defun gnus-summary-mark-as-dormant (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12123 "Mark N articles forward as dormant.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12124 If N is negative, mark backward instead. The difference between N and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12125 the actual number of articles marked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12126 (interactive "p")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12127 (gnus-set-global-variables)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12128 (gnus-summary-mark-forward n gnus-dormant-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12129
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12130 (defun gnus-summary-set-process-mark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12131 "Set the process mark on ARTICLE and update the summary line."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12132 (setq gnus-newsgroup-processable
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12133 (cons article
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
12134 (delq article gnus-newsgroup-processable)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12135 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12136 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12137 (gnus-summary-update-secondary-mark article)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12138
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12139 (defun gnus-summary-remove-process-mark (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12140 "Remove the process mark from ARTICLE and update the summary line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12141 (setq gnus-newsgroup-processable (delq article gnus-newsgroup-processable))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12142 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12143 (gnus-summary-show-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12144 (gnus-summary-update-secondary-mark article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12145
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12146 (defun gnus-summary-set-saved-mark (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12147 "Set the process mark on ARTICLE and update the summary line."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12148 (push article gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12149 (when (gnus-summary-goto-subject article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12150 (gnus-summary-update-secondary-mark article)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12151
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12152 (defun gnus-summary-mark-forward (n &optional mark no-expire)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12153 "Mark N articles as read forwards.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12154 If N is negative, mark backwards instead. Mark with MARK, ?r by default.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12155 The difference between N and the actual number of articles marked is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12156 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12157 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12158 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12159 (let ((backward (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12160 (gnus-summary-goto-unread
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12161 (and gnus-summary-goto-unread
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12162 (not (eq gnus-summary-goto-unread 'never))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12163 (not (memq mark (list gnus-unread-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12164 gnus-ticked-mark gnus-dormant-mark)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12165 (n (abs n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12166 (mark (or mark gnus-del-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12167 (while (and (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12168 (gnus-summary-mark-article nil mark no-expire)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12169 (zerop (gnus-summary-next-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12170 (if backward -1 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12171 (and gnus-summary-goto-unread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12172 (not (eq gnus-summary-goto-unread 'never)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12173 t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12174 (setq n (1- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12175 (if (/= 0 n) (gnus-message 7 "No more %sarticles" (if mark "" "unread ")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12176 (gnus-summary-recenter)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12177 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12178 (gnus-set-mode-line 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12179 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12180
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12181 (defun gnus-summary-mark-article-as-read (mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12182 "Mark the current article quickly as read with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12183 (let ((article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12184 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12185 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12186 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12187 (setq gnus-newsgroup-reads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12188 (cons (cons article mark) gnus-newsgroup-reads))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12189 ;; Possibly remove from cache, if that is used.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12190 (and gnus-use-cache (gnus-cache-enter-remove-article article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12191 ;; Allow the backend to change the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12192 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12193 ;; Check for auto-expiry.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12194 (when (and gnus-newsgroup-auto-expire
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12195 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12196 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12197 (= mark gnus-ancient-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12198 (= mark gnus-read-mark) (= mark gnus-souped-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12199 (setq mark gnus-expirable-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12200 (push article gnus-newsgroup-expirable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12201 ;; Set the mark in the buffer.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12202 (gnus-summary-update-mark mark 'unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12203 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12204
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12205 (defun gnus-summary-mark-article-as-unread (mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12206 "Mark the current article quickly as unread with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12207 (let ((article (gnus-summary-article-number)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12208 (if (< article 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12209 (gnus-error 1 "Unmarkable article")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12210 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12211 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12212 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12213 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12214 (cond ((= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12215 (push article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12216 ((= mark gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12217 (push article gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12218 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12219 (push article gnus-newsgroup-unreads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12220 (setq gnus-newsgroup-reads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12221 (delq (assq article gnus-newsgroup-reads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12222 gnus-newsgroup-reads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12223
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12224 ;; See whether the article is to be put in the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12225 (and gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12226 (vectorp (gnus-summary-article-header article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12227 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12228 (gnus-cache-possibly-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12229 gnus-newsgroup-name article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12230 (gnus-summary-article-header article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12231 (= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12232 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12233
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12234 ;; Fix the mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12235 (gnus-summary-update-mark mark 'unread))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12236 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12237
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12238 (defun gnus-summary-mark-article (&optional article mark no-expire)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12239 "Mark ARTICLE with MARK. MARK can be any character.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12240 Four MARK strings are reserved: `? ' (unread), `?!' (ticked),
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12241 `??' (dormant) and `?E' (expirable).
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12242 If MARK is nil, then the default character `?D' is used.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12243 If ARTICLE is nil, then the article on the current line will be
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12244 marked."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12245 ;; The mark might be a string.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12246 (and (stringp mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12247 (setq mark (aref mark 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12248 ;; If no mark is given, then we check auto-expiring.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12249 (and (not no-expire)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12250 gnus-newsgroup-auto-expire
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12251 (or (not mark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12252 (and (numberp mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12253 (or (= mark gnus-killed-mark) (= mark gnus-del-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12254 (= mark gnus-catchup-mark) (= mark gnus-low-score-mark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12255 (= mark gnus-read-mark) (= mark gnus-souped-mark))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12256 (setq mark gnus-expirable-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12257 (let* ((mark (or mark gnus-del-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12258 (article (or article (gnus-summary-article-number))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12259 (or article (error "No article on current line"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12260 (if (or (= mark gnus-unread-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12261 (= mark gnus-ticked-mark)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12262 (= mark gnus-dormant-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12263 (gnus-mark-article-as-unread article mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12264 (gnus-mark-article-as-read article mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12265
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12266 ;; See whether the article is to be put in the cache.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12267 (and gnus-use-cache
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12268 (not (= mark gnus-canceled-mark))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12269 (vectorp (gnus-summary-article-header article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12270 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12271 (gnus-cache-possibly-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12272 gnus-newsgroup-name article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12273 (gnus-summary-article-header article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12274 (= mark gnus-ticked-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12275 (= mark gnus-dormant-mark) (= mark gnus-unread-mark))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12276
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12277 (if (gnus-summary-goto-subject article nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12278 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12279 (gnus-summary-show-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12280 ;; Fix the mark.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12281 (gnus-summary-update-mark mark 'unread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12282 t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12283
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12284 (defun gnus-summary-update-secondary-mark (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12285 "Update the secondary (read, process, cache) mark."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12286 (gnus-summary-update-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12287 (cond ((memq article gnus-newsgroup-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12288 gnus-process-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12289 ((memq article gnus-newsgroup-cached)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12290 gnus-cached-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12291 ((memq article gnus-newsgroup-replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12292 gnus-replied-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12293 ((memq article gnus-newsgroup-saved)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12294 gnus-saved-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12295 (t gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12296 'replied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12297 (when (gnus-visual-p 'summary-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12298 (run-hooks 'gnus-summary-update-hook))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12299 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12300
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12301 (defun gnus-summary-update-mark (mark type)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12302 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12303 (let ((forward (cdr (assq type gnus-summary-mark-positions)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12304 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12305 (when (and forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12306 (<= (+ forward (point)) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12307 ;; Go to the right position on the line.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12308 (goto-char (+ forward (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12309 ;; Replace the old mark with the new mark.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12310 (subst-char-in-region (point) (1+ (point)) (following-char) mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12311 ;; Optionally update the marks by some user rule.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12312 (when (eq type 'unread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12313 (gnus-data-set-mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12314 (gnus-data-find (gnus-summary-article-number)) mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12315 (gnus-summary-update-line (eq mark gnus-unread-mark))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12316
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12317 (defun gnus-mark-article-as-read (article &optional mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12318 "Enter ARTICLE in the pertinent lists and remove it from others."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12319 ;; Make the article expirable.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12320 (let ((mark (or mark gnus-del-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12321 (if (= mark gnus-expirable-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12322 (setq gnus-newsgroup-expirable (cons article gnus-newsgroup-expirable))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12323 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12324 ;; Remove from unread and marked lists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12325 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12326 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12327 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12328 (push (cons article mark) gnus-newsgroup-reads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12329 ;; Possibly remove from cache, if that is used.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12330 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12331 (gnus-cache-enter-remove-article article))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12332
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12333 (defun gnus-mark-article-as-unread (article &optional mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12334 "Enter ARTICLE in the pertinent lists and remove it from others."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12335 (let ((mark (or mark gnus-ticked-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12336 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12337 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12338 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12339 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12340 (cond ((= mark gnus-ticked-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12341 (push article gnus-newsgroup-marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12342 ((= mark gnus-dormant-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12343 (push article gnus-newsgroup-dormant))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12344 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12345 (push article gnus-newsgroup-unreads)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12346 (setq gnus-newsgroup-reads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12347 (delq (assq article gnus-newsgroup-reads)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12348 gnus-newsgroup-reads))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12349
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12350 (defalias 'gnus-summary-mark-as-unread-forward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12351 'gnus-summary-tick-article-forward)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12352 (make-obsolete 'gnus-summary-mark-as-unread-forward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12353 'gnus-summary-tick-article-forward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12354 (defun gnus-summary-tick-article-forward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12355 "Tick N articles forwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12356 If N is negative, tick backwards instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12357 The difference between N and the number of articles ticked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12358 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12359 (gnus-summary-mark-forward n gnus-ticked-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12360
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12361 (defalias 'gnus-summary-mark-as-unread-backward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12362 'gnus-summary-tick-article-backward)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12363 (make-obsolete 'gnus-summary-mark-as-unread-backward
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12364 'gnus-summary-tick-article-backward)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12365 (defun gnus-summary-tick-article-backward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12366 "Tick N articles backwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12367 The difference between N and the number of articles ticked is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12368 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12369 (gnus-summary-mark-forward (- n) gnus-ticked-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12370
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12371 (defalias 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12372 (make-obsolete 'gnus-summary-mark-as-unread 'gnus-summary-tick-article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12373 (defun gnus-summary-tick-article (&optional article clear-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12374 "Mark current article as unread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12375 Optional 1st argument ARTICLE specifies article number to be marked as unread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12376 Optional 2nd argument CLEAR-MARK remove any kinds of mark."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12377 (interactive)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12378 (gnus-summary-mark-article article (if clear-mark gnus-unread-mark
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12379 gnus-ticked-mark)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12380
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12381 (defun gnus-summary-mark-as-read-forward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12382 "Mark N articles as read forwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12383 If N is negative, mark backwards instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12384 The difference between N and the actual number of articles marked is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12385 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12386 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12387 (gnus-summary-mark-forward n gnus-del-mark t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12388
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12389 (defun gnus-summary-mark-as-read-backward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12390 "Mark the N articles as read backwards.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12391 The difference between N and the actual number of articles marked is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12392 returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12393 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12394 (gnus-summary-mark-forward (- n) gnus-del-mark t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12395
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12396 (defun gnus-summary-mark-as-read (&optional article mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12397 "Mark current article as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12398 ARTICLE specifies the article to be marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12399 MARK specifies a string to be inserted at the beginning of the line."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12400 (gnus-summary-mark-article article mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12402 (defun gnus-summary-clear-mark-forward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12403 "Clear marks from N articles forward.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12404 If N is negative, clear backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12405 The difference between N and the number of marks cleared is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12406 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12407 (gnus-summary-mark-forward n gnus-unread-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12408
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12409 (defun gnus-summary-clear-mark-backward (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12410 "Clear marks from N articles backward.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12411 The difference between N and the number of marks cleared is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12412 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12413 (gnus-summary-mark-forward (- n) gnus-unread-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12414
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12415 (defun gnus-summary-mark-unread-as-read ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12416 "Intended to be used by `gnus-summary-mark-article-hook'."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12417 (when (memq gnus-current-article gnus-newsgroup-unreads)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12418 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12419
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12420 (defun gnus-summary-mark-read-and-unread-as-read ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12421 "Intended to be used by `gnus-summary-mark-article-hook'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12422 (let ((mark (gnus-summary-article-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12423 (when (or (gnus-unread-mark-p mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12424 (gnus-read-mark-p mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12425 (gnus-summary-mark-article gnus-current-article gnus-read-mark))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12426
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12427 (defun gnus-summary-mark-region-as-read (point mark all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12428 "Mark all unread articles between point and mark as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12429 If given a prefix, mark all articles between point and mark as read,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12430 even ticked and dormant ones."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12431 (interactive "r\nP")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12432 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12433 (let (article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12434 (goto-char point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12435 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12436 (while (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12437 (< (point) mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12438 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12439 (when (or all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12440 (memq (setq article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12441 gnus-newsgroup-unreads))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12442 (gnus-summary-mark-article article gnus-del-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12443 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12444 (gnus-summary-find-next))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12445
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12446 (defun gnus-summary-mark-below (score mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12447 "Mark articles with score less than SCORE with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12448 (interactive "P\ncMark: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12449 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12450 (setq score (if score
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12451 (prefix-numeric-value score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12452 (or gnus-summary-default-score 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12453 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12454 (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12455 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12456 (while
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12457 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12458 (and (< (gnus-summary-article-score) score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12459 (gnus-summary-mark-article nil mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12460 (gnus-summary-find-next)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12461
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12462 (defun gnus-summary-kill-below (&optional score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12463 "Mark articles with score below SCORE as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12464 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12465 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12466 (gnus-summary-mark-below score gnus-killed-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12467
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12468 (defun gnus-summary-clear-above (&optional score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12469 "Clear all marks from articles with score above SCORE."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12470 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12471 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12472 (gnus-summary-mark-above score gnus-unread-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12473
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12474 (defun gnus-summary-tick-above (&optional score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12475 "Tick all articles with score above SCORE."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12476 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12477 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12478 (gnus-summary-mark-above score gnus-ticked-mark))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12479
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12480 (defun gnus-summary-mark-above (score mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12481 "Mark articles with score over SCORE with MARK."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12482 (interactive "P\ncMark: ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12483 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12484 (setq score (if score
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12485 (prefix-numeric-value score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12486 (or gnus-summary-default-score 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12487 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12488 (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12489 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12490 (while (and (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12491 (if (> (gnus-summary-article-score) score)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12492 (gnus-summary-mark-article nil mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12493 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12494 (gnus-summary-find-next)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12495
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12496 ;; Suggested by Daniel Quinlan <quinlan@best.com>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12497 (defalias 'gnus-summary-show-all-expunged 'gnus-summary-limit-include-expunged)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12498 (defun gnus-summary-limit-include-expunged ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12499 "Display all the hidden articles that were expunged for low scores."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12500 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12501 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12502 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12503 (let ((scored gnus-newsgroup-scored)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12504 headers h)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12505 (while scored
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12506 (or (gnus-summary-goto-subject (caar scored))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12507 (and (setq h (gnus-summary-article-header (caar scored)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12508 (< (cdar scored) gnus-summary-expunge-below)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12509 (setq headers (cons h headers))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12510 (setq scored (cdr scored)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12511 (or headers (error "No expunged articles hidden."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12512 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12513 (gnus-summary-prepare-unthreaded (nreverse headers)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12514 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12515 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12516
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12517 (defun gnus-summary-catchup (&optional all quietly to-here not-mark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12518 "Mark all articles not marked as unread in this newsgroup as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12519 If prefix argument ALL is non-nil, all articles are marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12520 If QUIETLY is non-nil, no questions will be asked.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12521 If TO-HERE is non-nil, it should be a point in the buffer. All
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12522 articles before this point will be marked as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12523 The number of articles marked as read is returned."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12524 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12525 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12526 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12527 (if (or quietly
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12528 (not gnus-interactive-catchup) ;Without confirmation?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12529 gnus-expert-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12530 (gnus-y-or-n-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12531 (if all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12532 "Mark absolutely all articles as read? "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12533 "Mark all unread articles as read? ")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12534 (if (and not-mark
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12535 (not gnus-newsgroup-adaptive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12536 (not gnus-newsgroup-auto-expire))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12537 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12538 (when all
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12539 (setq gnus-newsgroup-marked nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12540 gnus-newsgroup-dormant nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12541 (setq gnus-newsgroup-unreads nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12542 ;; We actually mark all articles as canceled, which we
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12543 ;; have to do when using auto-expiry or adaptive scoring.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12544 (gnus-summary-show-all-threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12545 (if (gnus-summary-first-subject (not all))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12546 (while (and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12547 (if to-here (< (point) to-here) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12548 (gnus-summary-mark-article-as-read gnus-catchup-mark)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12549 (gnus-summary-find-next (not all)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12550 (unless to-here
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12551 (setq gnus-newsgroup-unreads nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12552 (gnus-set-mode-line 'summary)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12553 (let ((method (gnus-find-method-for-group gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12554 (if (and (not to-here) (eq 'nnvirtual (car method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12555 (nnvirtual-catchup-group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12556 (gnus-group-real-name gnus-newsgroup-name) (nth 1 method) all)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12557 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12558
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12559 (defun gnus-summary-catchup-to-here (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12560 "Mark all unticked articles before the current one as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12561 If ALL is non-nil, also mark ticked and dormant articles as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12562 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12563 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12564 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12565 (gnus-save-hidden-threads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12566 (let ((beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12567 ;; We check that there are unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12568 (when (or all (gnus-summary-find-prev))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12569 (gnus-summary-catchup all t beg)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12570 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12571
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12572 (defun gnus-summary-catchup-all (&optional quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12573 "Mark all articles in this newsgroup as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12574 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12575 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12576 (gnus-summary-catchup t quietly))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12577
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12578 (defun gnus-summary-catchup-and-exit (&optional all quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12579 "Mark all articles not marked as unread in this newsgroup as read, then exit.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12580 If prefix argument ALL is non-nil, all articles are marked as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12581 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12582 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12583 (gnus-summary-catchup all quietly nil 'fast)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12584 ;; Select next newsgroup or exit.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12585 (if (eq gnus-auto-select-next 'quietly)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12586 (gnus-summary-next-group nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12587 (gnus-summary-exit)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12588
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12589 (defun gnus-summary-catchup-all-and-exit (&optional quietly)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12590 "Mark all articles in this newsgroup as read, and then exit."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12591 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12592 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12593 (gnus-summary-catchup-and-exit t quietly))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12594
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12595 ;; Suggested by "Arne Eofsson" <arne@hodgkin.mbi.ucla.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12596 (defun gnus-summary-catchup-and-goto-next-group (&optional all)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12597 "Mark all articles in this group as read and select the next group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12598 If given a prefix, mark all articles, unread as well as ticked, as
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12599 read."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12600 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12601 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12602 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12603 (gnus-summary-catchup all))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12604 (gnus-summary-next-article t nil nil t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12605
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12606 ;; Thread-based commands.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12607
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12608 (defun gnus-summary-articles-in-thread (&optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12609 "Return a list of all articles in the current thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12610 If ARTICLE is non-nil, return all articles in the thread that starts
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12611 with that article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12612 (let* ((article (or article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12613 (data (gnus-data-find-list article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12614 (top-level (gnus-data-level (car data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12615 (top-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12616 (cond ((null gnus-thread-operation-ignore-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12617 (gnus-simplify-subject-re
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12618 (mail-header-subject (gnus-data-header (car data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12619 ((eq gnus-thread-operation-ignore-subject 'fuzzy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12620 (gnus-simplify-subject-fuzzy
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12621 (mail-header-subject (gnus-data-header (car data)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12622 (t nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12623 (end-point (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12624 (if (gnus-summary-go-to-next-thread)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12625 (point) (point-max))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12626 articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12627 (while (and data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12628 (< (gnus-data-pos (car data)) end-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12629 (when (or (not top-subject)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12630 (string= top-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12631 (if (eq gnus-thread-operation-ignore-subject 'fuzzy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12632 (gnus-simplify-subject-fuzzy
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12633 (mail-header-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12634 (gnus-data-header (car data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12635 (gnus-simplify-subject-re
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12636 (mail-header-subject
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12637 (gnus-data-header (car data)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12638 (push (gnus-data-number (car data)) articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12639 (unless (and (setq data (cdr data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12640 (> (gnus-data-level (car data)) top-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12641 (setq data nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12642 ;; Return the list of articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12643 (nreverse articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12644
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12645 (defun gnus-summary-rethread-current ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12646 "Rethread the thread the current article is part of."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12647 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12648 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12649 (let* ((gnus-show-threads t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12650 (article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12651 (id (mail-header-id (gnus-summary-article-header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12652 (gnus-newsgroup-threads (list (gnus-id-to-thread (gnus-root-id id)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12653 (unless id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12654 (error "No article on the current line"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12655 (gnus-rebuild-thread id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12656 (gnus-summary-goto-subject article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12657
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12658 (defun gnus-summary-reparent-thread ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12659 "Make current article child of the marked (or previous) article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12660
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12661 Note that the re-threading will only work if `gnus-thread-ignore-subject'
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12662 is non-nil or the Subject: of both articles are the same."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12663 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12664 (or (not (gnus-group-read-only-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12665 (error "The current newsgroup does not support article editing."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12666 (or (<= (length gnus-newsgroup-processable) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12667 (error "No more than one article may be marked."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12668 (save-window-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12669 (let ((gnus-article-buffer " *reparent*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12670 (current-article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12671 ; first grab the marked article, otherwise one line up.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12672 (parent-article (if (not (null gnus-newsgroup-processable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12673 (car gnus-newsgroup-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12674 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12675 (if (eq (forward-line -1) 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12676 (gnus-summary-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12677 (error "Beginning of summary buffer."))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12678 (or (not (eq current-article parent-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12679 (error "An article may not be self-referential."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12680 (let ((message-id (mail-header-id
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12681 (gnus-summary-article-header parent-article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12682 (or (and message-id (not (equal message-id "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12683 (error "No message-id in desired parent."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12684 (gnus-summary-select-article t t nil current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12685 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12686 (setq buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12687 (let ((buf (format "%s" (buffer-string))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12688 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12689 (insert buf))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12690 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12691 (if (search-forward-regexp "^References: " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12692 (insert message-id " " )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12693 (insert "References: " message-id "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12694 (or (gnus-request-replace-article current-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12695 (car gnus-article-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12696 gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12697 (error "Couldn't replace article."))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12698 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12699 (gnus-summary-unmark-all-processable)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12700 (gnus-summary-rethread-current)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12701 (gnus-message 3 "Article %d is now the child of article %d."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12702 current-article parent-article)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12703
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12704 (defun gnus-summary-toggle-threads (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12705 "Toggle showing conversation threads.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12706 If ARG is positive number, turn showing conversation threads on."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12707 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12708 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12709 (let ((current (or (gnus-summary-article-number) gnus-newsgroup-end)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12710 (setq gnus-show-threads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12711 (if (null arg) (not gnus-show-threads)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12712 (> (prefix-numeric-value arg) 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12713 (gnus-summary-prepare)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12714 (gnus-summary-goto-subject current)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12715 (gnus-summary-position-point)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12716
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12717 (defun gnus-summary-show-all-threads ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12718 "Show all threads."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12719 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12720 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12721 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12722 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12723 (subst-char-in-region (point-min) (point-max) ?\^M ?\n t)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12724 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12725
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12726 (defun gnus-summary-show-thread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12727 "Show thread subtrees.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12728 Returns nil if no thread was there to be shown."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12729 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12730 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12731 (let ((buffer-read-only nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12732 (orig (point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12733 ;; first goto end then to beg, to have point at beg after let
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12734 (end (progn (end-of-line) (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12735 (beg (progn (beginning-of-line) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12736 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12737 ;; Any hidden lines here?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12738 (search-forward "\r" end t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12739 (subst-char-in-region beg end ?\^M ?\n t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12740 (goto-char orig)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12741 (gnus-summary-position-point))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12742
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12743 (defun gnus-summary-hide-all-threads ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12744 "Hide all thread subtrees."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12745 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12746 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12747 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12748 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12749 (gnus-summary-hide-thread)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12750 (while (zerop (gnus-summary-next-thread 1 t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12751 (gnus-summary-hide-thread)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12752 (gnus-summary-position-point))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12753
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12754 (defun gnus-summary-hide-thread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12755 "Hide thread subtrees.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12756 Returns nil if no threads were there to be hidden."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12757 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12758 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12759 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12760 (start (point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12761 (article (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12762 (goto-char start)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12763 ;; Go forward until either the buffer ends or the subthread
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12764 ;; ends.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12765 (when (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12766 (or (zerop (gnus-summary-next-thread 1 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12767 (goto-char (point-max))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12768 (prog1
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12769 (if (and (> (point) start)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12770 (search-backward "\n" start t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12771 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12772 (subst-char-in-region start (point) ?\n ?\^M)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12773 (gnus-summary-goto-subject article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12774 (goto-char start)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12775 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12776 ;;(gnus-summary-position-point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12777 ))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12778
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12779 (defun gnus-summary-go-to-next-thread (&optional previous)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12780 "Go to the same level (or less) next thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12781 If PREVIOUS is non-nil, go to previous thread instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12782 Return the article number moved to, or nil if moving was impossible."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12783 (let ((level (gnus-summary-thread-level))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12784 (way (if previous -1 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12785 (beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12786 (forward-line way)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12787 (while (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12788 (< level (gnus-summary-thread-level)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12789 (forward-line way))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12790 (if (eobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12791 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12792 (goto-char beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12793 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12794 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12795 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12796 (gnus-summary-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12797 (goto-char beg)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12798
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12799 (defun gnus-summary-go-to-next-thread-old (&optional previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12800 "Go to the same level (or less) next thread.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12801 If PREVIOUS is non-nil, go to previous thread instead.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12802 Return the article number moved to, or nil if moving was impossible."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12803 (if (and (eq gnus-summary-make-false-root 'dummy)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12804 (gnus-summary-article-intangible-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12805 (let ((beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12806 (while (and (zerop (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12807 (not (gnus-summary-article-intangible-p))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12808 (not (zerop (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12809 (gnus-summary-thread-level))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12810 (if (eobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12811 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12812 (goto-char beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12813 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12814 (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12815 (let* ((level (gnus-summary-thread-level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12816 (article (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12817 (data (cdr (gnus-data-find-list article (gnus-data-list previous))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12818 oart)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12819 (while data
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12820 (if (<= (gnus-data-level (car data)) level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12821 (setq oart (gnus-data-number (car data))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12822 data nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12823 (setq data (cdr data))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12824 (and oart
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12825 (gnus-summary-goto-subject oart)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12826
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12827 (defun gnus-summary-next-thread (n &optional silent)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12828 "Go to the same level next N'th thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12829 If N is negative, search backward instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12830 Returns the difference between N and the number of skips actually
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12831 done.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12832
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12833 If SILENT, don't output messages."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12834 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12835 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12836 (let ((backward (< n 0))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12837 (n (abs n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12838 old dum int)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12839 (while (and (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12840 (gnus-summary-go-to-next-thread backward))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12841 (decf n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12842 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12843 (gnus-summary-position-point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12844 (when (and (not silent) (/= 0 n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12845 (gnus-message 7 "No more threads"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12846 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12847
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12848 (defun gnus-summary-prev-thread (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12849 "Go to the same level previous N'th thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12850 Returns the difference between N and the number of skips actually
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12851 done."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12852 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12853 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12854 (gnus-summary-next-thread (- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12855
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12856 (defun gnus-summary-go-down-thread ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12857 "Go down one level in the current thread."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12858 (let ((children (gnus-summary-article-children)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12859 (and children
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12860 (gnus-summary-goto-subject (car children)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12861
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12862 (defun gnus-summary-go-up-thread ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12863 "Go up one level in the current thread."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12864 (let ((parent (gnus-summary-article-parent)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12865 (and parent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12866 (gnus-summary-goto-subject parent))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12867
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12868 (defun gnus-summary-down-thread (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12869 "Go down thread N steps.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12870 If N is negative, go up instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12871 Returns the difference between N and how many steps down that were
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12872 taken."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12873 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12874 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12875 (let ((up (< n 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12876 (n (abs n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12877 (while (and (> n 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12878 (if up (gnus-summary-go-up-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12879 (gnus-summary-go-down-thread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12880 (setq n (1- n)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12881 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12882 (if (/= 0 n) (gnus-message 7 "Can't go further"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12883 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12884
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12885 (defun gnus-summary-up-thread (n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12886 "Go up thread N steps.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12887 If N is negative, go up instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12888 Returns the difference between N and how many steps down that were
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12889 taken."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12890 (interactive "p")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12891 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12892 (gnus-summary-down-thread (- n)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12893
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12894 (defun gnus-summary-top-thread ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12895 "Go to the top of the thread."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12896 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12897 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12898 (while (gnus-summary-go-up-thread))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12899 (gnus-summary-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12900
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12901 (defun gnus-summary-kill-thread (&optional unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12902 "Mark articles under current thread as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12903 If the prefix argument is positive, remove any kinds of marks.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12904 If the prefix argument is negative, tick articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12905 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12906 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12907 (when unmark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12908 (setq unmark (prefix-numeric-value unmark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12909 (let ((articles (gnus-summary-articles-in-thread)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12910 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12911 ;; Expand the thread.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12912 (gnus-summary-show-thread)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12913 ;; Mark all the articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12914 (while articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12915 (gnus-summary-goto-subject (car articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12916 (cond ((null unmark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12917 (gnus-summary-mark-article-as-read gnus-killed-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12918 ((> unmark 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12919 (gnus-summary-mark-article-as-unread gnus-unread-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12920 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12921 (gnus-summary-mark-article-as-unread gnus-ticked-mark)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12922 (setq articles (cdr articles))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12923 ;; Hide killed subtrees.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12924 (and (null unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12925 gnus-thread-hide-killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12926 (gnus-summary-hide-thread))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12927 ;; If marked as read, go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12928 (if (null unmark)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12929 ;; Go to next unread subject.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12930 (gnus-summary-next-subject 1 t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12931 (gnus-set-mode-line 'summary))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12932
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12933 ;; Summary sorting commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12934
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12935 (defun gnus-summary-sort-by-number (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12936 "Sort summary buffer by article number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12937 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12938 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12939 (gnus-summary-sort 'number reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12940
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12941 (defun gnus-summary-sort-by-author (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12942 "Sort summary buffer by author name alphabetically.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12943 If case-fold-search is non-nil, case of letters is ignored.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12944 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12945 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12946 (gnus-summary-sort 'author reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12947
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12948 (defun gnus-summary-sort-by-subject (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12949 "Sort summary buffer by subject alphabetically. `Re:'s are ignored.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12950 If case-fold-search is non-nil, case of letters is ignored.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12951 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12952 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12953 (gnus-summary-sort 'subject reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12954
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12955 (defun gnus-summary-sort-by-date (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12956 "Sort summary buffer by date.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12957 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12958 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12959 (gnus-summary-sort 'date reverse))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12960
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12961 (defun gnus-summary-sort-by-score (&optional reverse)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12962 "Sort summary buffer by score.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12963 Argument REVERSE means reverse order."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12964 (interactive "P")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12965 (gnus-summary-sort 'score reverse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12966
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12967 (defun gnus-summary-sort (predicate reverse)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12968 "Sort summary buffer by PREDICATE. REVERSE means reverse order."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12969 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12970 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12971 (article (intern (format "gnus-article-sort-by-%s" predicate)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12972 (gnus-thread-sort-functions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12973 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12974 (if (not reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12975 thread
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12976 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12977 (,thread t2 t1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12978 (gnus-article-sort-functions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12979 (list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12980 (if (not reverse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12981 article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12982 `(lambda (t1 t2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12983 (,article t2 t1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12984 (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12985 (gnus-summary-prepare-hook nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12986 ;; We do the sorting by regenerating the threads.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12987 (gnus-summary-prepare)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12988 ;; Hide subthreads if needed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12989 (when (and gnus-show-threads gnus-thread-hide-subtree)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12990 (gnus-summary-hide-all-threads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12991 ;; If in async mode, we send some info to the backend.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12992 (when gnus-newsgroup-async
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12993 (gnus-request-asynchronous
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12994 gnus-newsgroup-name gnus-newsgroup-data)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12995
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12996 (defun gnus-sortable-date (date)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12997 "Make sortable string by string-lessp from DATE.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
12998 Timezone package is used."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
12999 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13000 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13001 (setq date (inline (timezone-fix-time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13002 date nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13003 (aref (inline (timezone-parse-date date)) 4))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13004 (inline
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13005 (timezone-make-sortable-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13006 (aref date 0) (aref date 1) (aref date 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13007 (inline
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13008 (timezone-make-time-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13009 (aref date 3) (aref date 4) (aref date 5))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13010 (error "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13011
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13012 ;; Summary saving commands.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13013
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13014 (defun gnus-summary-save-article (&optional n not-saved)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13015 "Save the current article using the default saver function.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13016 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13017 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13018 If N is nil and any articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13019 save those articles instead.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13020 The variable `gnus-default-article-saver' specifies the saver function."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13021 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13022 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13023 (let ((articles (gnus-summary-work-articles n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13024 (save-buffer (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13025 (nnheader-set-temp-buffer " *Gnus Save*")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13026 file header article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13027 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13028 (setq header (gnus-summary-article-header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13029 (setq article (pop articles))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13030 (if (not (vectorp header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13031 ;; This is a pseudo-article.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13032 (if (assq 'name header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13033 (gnus-copy-file (cdr (assq 'name header)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13034 (gnus-message 1 "Article %d is unsaveable" article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13035 ;; This is a real article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13036 (save-window-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13037 (gnus-summary-select-article t nil nil article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13038 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13039 (set-buffer save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13040 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13041 (insert-buffer-substring gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13042 (unless gnus-save-all-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13043 ;; Remove headers accoring to `gnus-saved-headers'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13044 (let ((gnus-visible-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13045 (or gnus-saved-headers gnus-visible-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13046 (gnus-article-buffer save-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13047 (gnus-article-hide-headers 1 t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13048 (save-window-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13049 (if (not gnus-default-article-saver)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13050 (error "No default saver is defined.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13051 ;; !!! Magic! The saving functions all save
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13052 ;; `gnus-original-article-buffer' (or so they think),
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13053 ;; but we bind that variable to our save-buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13054 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13055 (let ((gnus-original-article-buffer save-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13056 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13057 (setq file (funcall
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13058 gnus-default-article-saver
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13059 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13060 ((not gnus-prompt-before-saving)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13061 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13062 ((eq gnus-prompt-before-saving 'always)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13063 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13064 (t file)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13065 (gnus-summary-remove-process-mark article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13066 (unless not-saved
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13067 (gnus-summary-set-saved-mark article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13068 (gnus-kill-buffer save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13069 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13070 n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13071
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13072 (defun gnus-summary-pipe-output (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13073 "Pipe the current article to a subprocess.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13074 If N is a positive number, pipe the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13075 If N is a negative number, pipe the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13076 If N is nil and any articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13077 pipe those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13078 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13079 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13080 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13081 (gnus-summary-save-article arg t))
15047
4dfe98bde444 * gnus.el (gnus-summary-pipe-output, gnus-buffer-configuration,
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 14932
diff changeset
13082 (gnus-configure-windows 'pipe))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13083
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13084 (defun gnus-summary-save-article-mail (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13085 "Append the current article to an mail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13086 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13087 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13088 If N is nil and any articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13089 save those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13090 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13091 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13092 (let ((gnus-default-article-saver 'gnus-summary-save-in-mail))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13093 (gnus-summary-save-article arg)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13094
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13095 (defun gnus-summary-save-article-rmail (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13096 "Append the current article to an rmail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13097 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13098 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13099 If N is nil and any articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13100 save those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13101 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13102 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13103 (let ((gnus-default-article-saver 'gnus-summary-save-in-rmail))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13104 (gnus-summary-save-article arg)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13105
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13106 (defun gnus-summary-save-article-file (&optional arg)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13107 "Append the current article to a file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13108 If N is a positive number, save the N next articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13109 If N is a negative number, save the N previous articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13110 If N is nil and any articles have been marked with the process mark,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13111 save those articles instead."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13112 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13113 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13114 (let ((gnus-default-article-saver 'gnus-summary-save-in-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13115 (gnus-summary-save-article arg)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13116
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13117 (defun gnus-summary-save-article-body-file (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13118 "Append the current article body to a file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13119 If N is a positive number, save the N next articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13120 If N is a negative number, save the N previous articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13121 If N is nil and any articles have been marked with the process mark,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13122 save those articles instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13123 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13124 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13125 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13126 (gnus-summary-save-article arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13127
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13128 (defun gnus-get-split-value (methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13129 "Return a value based on the split METHODS."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13130 (let (split-name method result match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13131 (when methods
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13132 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13133 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13134 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13135 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13136 (while methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13137 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13138 (setq method (pop methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13139 (setq match (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13140 (when (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13141 ((stringp match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13142 ;; Regular expression.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13143 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13144 (re-search-forward match nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13145 (error nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13146 ((gnus-functionp match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13147 ;; Function.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13148 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13149 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13150 (setq result (funcall match gnus-newsgroup-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13151 ((consp match)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13152 ;; Form.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13153 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13154 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13155 (setq result (eval match)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13156 (setq split-name (append (cdr method) split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13157 (cond ((stringp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13158 (push result split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13159 ((consp result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13160 (setq split-name (append result split-name)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13161 split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13162
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13163 (defun gnus-read-move-group-name (prompt default articles prefix)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13164 "Read a group name."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13165 (let* ((split-name (gnus-get-split-value gnus-move-split-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13166 (minibuffer-confirm-incomplete nil) ; XEmacs
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13167 group-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13168 (dum (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13169 (lambda (g)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13170 (and (boundp g)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13171 (symbol-name g)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13172 (memq 'respool
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13173 (assoc (symbol-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13174 (car (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13175 (symbol-name g))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13176 gnus-valid-select-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13177 (push (list (symbol-name g)) group-map)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13178 gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13179 (prom
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13180 (format "%s %s to:"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13181 prompt
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13182 (if (> (length articles) 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13183 (format "these %d articles" (length articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13184 "this article")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13185 (to-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13186 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13187 ((null split-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13188 (gnus-completing-read default prom
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13189 group-map nil nil prefix
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13190 'gnus-group-history))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13191 ((= 1 (length split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13192 (gnus-completing-read (car split-name) prom group-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13193 nil nil nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13194 'gnus-group-history))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13195 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13196 (gnus-completing-read nil prom
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13197 (mapcar (lambda (el) (list el))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13198 (nreverse split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13199 nil nil nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13200 'gnus-group-history)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13201 (when to-newsgroup
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13202 (if (or (string= to-newsgroup "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13203 (string= to-newsgroup prefix))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13204 (setq to-newsgroup (or default "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13205 (or (gnus-active to-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13206 (gnus-activate-group to-newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13207 (if (gnus-y-or-n-p (format "No such group: %s. Create it? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13208 to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13209 (or (and (gnus-request-create-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13210 to-newsgroup (gnus-group-name-to-method to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13211 (gnus-activate-group to-newsgroup nil nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13212 (gnus-group-name-to-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13213 to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13214 (error "Couldn't create group %s" to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13215 (error "No such group: %s" to-newsgroup)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13216 to-newsgroup))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13217
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13218 (defun gnus-read-save-file-name (prompt default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13219 (let* ((split-name (gnus-get-split-value gnus-split-methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13220 (file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13221 ;; Let the split methods have their say.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13222 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13223 ;; No split name was found.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13224 ((null split-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13225 (read-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13226 (concat prompt " (default "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13227 (file-name-nondirectory default-name) ") ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13228 (file-name-directory default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13229 default-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13230 ;; A single split name was found
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13231 ((= 1 (length split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13232 (let* ((name (car split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13233 (dir (cond ((file-directory-p name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13234 (file-name-as-directory name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13235 ((file-exists-p name) name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13236 (t gnus-article-save-directory))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13237 (read-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13238 (concat prompt " (default " name ") ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13239 dir name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13240 ;; A list of splits was found.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13241 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13242 (setq split-name (nreverse split-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13243 (let (result)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13244 (let ((file-name-history (nconc split-name file-name-history)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13245 (setq result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13246 (read-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13247 (concat prompt " (`M-p' for defaults) ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13248 gnus-article-save-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13249 (car split-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13250 (car (push result file-name-history)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13251 ;; If we have read a directory, we append the default file name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13252 (when (file-directory-p file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13253 (setq file (concat (file-name-as-directory file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13254 (file-name-nondirectory default-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13255 ;; Possibly translate some charaters.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13256 (nnheader-translate-file-chars file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13257
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13258 (defun gnus-article-archive-name (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13259 "Return the first instance of an \"Archive-name\" in the current buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13260 (let ((case-fold-search t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13261 (when (re-search-forward "archive-name: *\\([^ \n\t]+\\)[ \t]*$" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13262 (match-string 1))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13263
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13264 (defun gnus-summary-save-in-rmail (&optional filename)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13265 "Append this article to Rmail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13266 Optional argument FILENAME specifies file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13267 Directory to save to is default to `gnus-article-save-directory'."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13268 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13269 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13270 (let ((default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13271 (funcall gnus-rmail-save-name gnus-newsgroup-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13272 gnus-current-headers gnus-newsgroup-last-rmail)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13273 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13274 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13275 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13276 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13277 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13278 "Save in rmail file:" default-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13279 (gnus-make-directory (file-name-directory filename))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13280 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13281 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13282 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13283 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13284 (gnus-output-to-rmail filename))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13285 ;; Remember the directory name to save articles
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13286 (setq gnus-newsgroup-last-rmail filename)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13287
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13288 (defun gnus-summary-save-in-mail (&optional filename)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13289 "Append this article to Unix mail file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13290 Optional argument FILENAME specifies file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13291 Directory to save to is default to `gnus-article-save-directory'."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13292 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13293 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13294 (let ((default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13295 (funcall gnus-mail-save-name gnus-newsgroup-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13296 gnus-current-headers gnus-newsgroup-last-mail)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13297 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13298 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13299 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13300 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13301 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13302 "Save in Unix mail file:" default-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13303 (setq filename
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13304 (expand-file-name filename
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13305 (and default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13306 (file-name-directory default-name))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13307 (gnus-make-directory (file-name-directory filename))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13308 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13309 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13310 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13311 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13312 (if (and (file-readable-p filename) (mail-file-babyl-p filename))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13313 (gnus-output-to-rmail filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13314 (let ((mail-use-rfc822 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13315 (rmail-output filename 1 t t))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13316 ;; Remember the directory name to save articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13317 (setq gnus-newsgroup-last-mail filename)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13318
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13319 (defun gnus-summary-save-in-file (&optional filename)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13320 "Append this article to file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13321 Optional argument FILENAME specifies file name.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13322 Directory to save to is default to `gnus-article-save-directory'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13323 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13324 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13325 (let ((default-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13326 (funcall gnus-file-save-name gnus-newsgroup-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13327 gnus-current-headers gnus-newsgroup-last-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13328 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13329 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13330 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13331 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13332 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13333 "Save in file:" default-name))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13334 (gnus-make-directory (file-name-directory filename))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13335 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13336 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13337 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13338 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13339 (gnus-output-to-file filename))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13340 ;; Remember the directory name to save articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13341 (setq gnus-newsgroup-last-file filename)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13342
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13343 (defun gnus-summary-save-body-in-file (&optional filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13344 "Append this article body to a file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13345 Optional argument FILENAME specifies file name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13346 The directory to save in defaults to `gnus-article-save-directory'."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13347 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13348 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13349 (let ((default-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13350 (funcall gnus-file-save-name gnus-newsgroup-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13351 gnus-current-headers gnus-newsgroup-last-file)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13352 (setq filename
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13353 (cond ((eq filename 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13354 default-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13355 (filename filename)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13356 (t (gnus-read-save-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13357 "Save body in file:" default-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13358 (gnus-make-directory (file-name-directory filename))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13359 (gnus-eval-in-buffer-window gnus-original-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13360 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13361 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13362 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13363 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13364 (and (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13365 (narrow-to-region (point) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13366 (gnus-output-to-file filename))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13367 ;; Remember the directory name to save articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13368 (setq gnus-newsgroup-last-file filename)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13369
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13370 (defun gnus-summary-save-in-pipe (&optional command)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13371 "Pipe this article to subprocess."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13372 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13373 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13374 (setq command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13375 (cond ((eq command 'default)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13376 gnus-last-shell-command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13377 (command command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13378 (t (read-string "Shell command on article: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13379 gnus-last-shell-command))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13380 (if (string-equal command "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13381 (setq command gnus-last-shell-command))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13382 (gnus-eval-in-buffer-window gnus-article-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13383 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13384 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13385 (shell-command-on-region (point-min) (point-max) command nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13386 (setq gnus-last-shell-command command))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13387
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13388 ;; Summary extract commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13389
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13390 (defun gnus-summary-insert-pseudos (pslist &optional not-view)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13391 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13392 (article (gnus-summary-article-number))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13393 after-article b e)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13394 (or (gnus-summary-goto-subject article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13395 (error (format "No such article: %d" article)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13396 (gnus-summary-position-point)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13397 ;; If all commands are to be bunched up on one line, we collect
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13398 ;; them here.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13399 (if gnus-view-pseudos-separately
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13400 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13401 (let ((ps (setq pslist (sort pslist 'gnus-pseudos<)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13402 files action)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13403 (while ps
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13404 (setq action (cdr (assq 'action (car ps))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13405 (setq files (list (cdr (assq 'name (car ps)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13406 (while (and ps (cdr ps)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13407 (string= (or action "1")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13408 (or (cdr (assq 'action (cadr ps))) "2")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13409 (setq files (cons (cdr (assq 'name (cadr ps))) files))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13410 (setcdr ps (cddr ps)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13411 (if (not files)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13412 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13413 (if (not (string-match "%s" action))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13414 (setq files (cons " " files)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13415 (setq files (cons " " files))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13416 (and (assq 'execute (car ps))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13417 (setcdr (assq 'execute (car ps))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13418 (funcall (if (string-match "%s" action)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13419 'format 'concat)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13420 action
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13421 (mapconcat (lambda (f) f) files " ")))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13422 (setq ps (cdr ps)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13423 (if (and gnus-view-pseudos (not not-view))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13424 (while pslist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13425 (and (assq 'execute (car pslist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13426 (gnus-execute-command (cdr (assq 'execute (car pslist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13427 (eq gnus-view-pseudos 'not-confirm)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13428 (setq pslist (cdr pslist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13429 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13430 (while pslist
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13431 (setq after-article (or (cdr (assq 'article (car pslist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13432 (gnus-summary-article-number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13433 (gnus-summary-goto-subject after-article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13434 (forward-line 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13435 (setq b (point))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13436 (insert " " (file-name-nondirectory
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13437 (cdr (assq 'name (car pslist))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13438 ": " (or (cdr (assq 'execute (car pslist))) "") "\n")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13439 (setq e (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13440 (forward-line -1) ; back to `b'
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13441 (gnus-add-text-properties
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13442 b (1- e) (list 'gnus-number gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13443 gnus-mouse-face-prop gnus-mouse-face))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13444 (gnus-data-enter
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13445 after-article gnus-reffed-article-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13446 gnus-unread-mark b (car pslist) 0 (- e b))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13447 (push gnus-reffed-article-number gnus-newsgroup-unreads)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13448 (setq gnus-reffed-article-number (1- gnus-reffed-article-number))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13449 (setq pslist (cdr pslist)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13450
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13451 (defun gnus-pseudos< (p1 p2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13452 (let ((c1 (cdr (assq 'action p1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13453 (c2 (cdr (assq 'action p2))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13454 (and c1 c2 (string< c1 c2))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13455
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13456 (defun gnus-request-pseudo-article (props)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13457 (cond ((assq 'execute props)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13458 (gnus-execute-command (cdr (assq 'execute props)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13459 (let ((gnus-current-article (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13460 (run-hooks 'gnus-mark-article-hook)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13461
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13462 (defun gnus-execute-command (command &optional automatic)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13463 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13464 (gnus-article-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13465 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13466 (setq buffer-read-only nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13467 (let ((command (if automatic command (read-string "Command: " command)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13468 ;; Just binding this here doesn't help, because there might
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13469 ;; be output from the process after exiting the scope of
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13470 ;; this `let'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13471 ;; (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13472 )
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13473 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13474 (insert "$ " command "\n\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13475 (if gnus-view-pseudo-asynchronously
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13476 (start-process "gnus-execute" nil shell-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13477 shell-command-switch command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13478 (call-process shell-file-name nil t nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13479 shell-command-switch command)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13480
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13481 (defun gnus-copy-file (file &optional to)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13482 "Copy FILE to TO."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13483 (interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13484 (list (read-file-name "Copy file: " default-directory)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13485 (read-file-name "Copy file to: " default-directory)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13486 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13487 (or to (setq to (read-file-name "Copy file to: " default-directory)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13488 (and (file-directory-p to)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13489 (setq to (concat (file-name-as-directory to)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13490 (file-name-nondirectory file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13491 (copy-file file to))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13492
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13493 ;; Summary kill commands.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13494
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13495 (defun gnus-summary-edit-global-kill (article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13496 "Edit the \"global\" kill file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13497 (interactive (list (gnus-summary-article-number)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13498 (gnus-set-global-variables)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13499 (gnus-group-edit-global-kill article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13500
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13501 (defun gnus-summary-edit-local-kill ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13502 "Edit a local kill file applied to the current newsgroup."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13503 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13504 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13505 (setq gnus-current-headers (gnus-summary-article-header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13506 (gnus-set-global-variables)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13507 (gnus-group-edit-local-kill
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13508 (gnus-summary-article-number) gnus-newsgroup-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13509
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13510
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13511 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13512 ;;; Gnus article mode
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13513 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13514
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13515 (put 'gnus-article-mode 'mode-class 'special)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13516
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13517 (if gnus-article-mode-map
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13518 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13519 (setq gnus-article-mode-map (make-keymap))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13520 (suppress-keymap gnus-article-mode-map)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13521
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13522 (gnus-define-keys gnus-article-mode-map
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13523 " " gnus-article-goto-next-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13524 "\177" gnus-article-goto-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13525 [delete] gnus-article-goto-prev-page
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13526 "\C-c^" gnus-article-refer-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13527 "h" gnus-article-show-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13528 "s" gnus-article-show-summary
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13529 "\C-c\C-m" gnus-article-mail
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13530 "?" gnus-article-describe-briefly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13531 gnus-mouse-2 gnus-article-push-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13532 "\r" gnus-article-press-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13533 "\t" gnus-article-next-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13534 "\M-\t" gnus-article-prev-button
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13535 "<" beginning-of-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13536 ">" end-of-buffer
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
13537 "\C-c\C-i" gnus-info-find-node
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13538 "\C-c\C-b" gnus-bug)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13539
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13540 (substitute-key-definition
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13541 'undefined 'gnus-article-read-summary-keys gnus-article-mode-map))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13542
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13543 (defun gnus-article-mode ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13544 "Major mode for displaying an article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13545
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13546 All normal editing commands are switched off.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13547
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13548 The following commands are available:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13549
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13550 \\<gnus-article-mode-map>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13551 \\[gnus-article-next-page]\t Scroll the article one page forwards
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13552 \\[gnus-article-prev-page]\t Scroll the article one page backwards
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13553 \\[gnus-article-refer-article]\t Go to the article referred to by an article id near point
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13554 \\[gnus-article-show-summary]\t Display the summary buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13555 \\[gnus-article-mail]\t Send a reply to the address near point
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13556 \\[gnus-article-describe-briefly]\t Describe the current mode briefly
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13557 \\[gnus-info-find-node]\t Go to the Gnus info node"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13558 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13559 (when (and menu-bar-mode
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13560 (gnus-visual-p 'article-menu 'menu))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13561 (gnus-article-make-menu-bar))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13562 (kill-all-local-variables)
13700
7cbb1453aefd (gnus-simplify-mode-line): New function to simplify the
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13699
diff changeset
13563 (gnus-simplify-mode-line)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13564 (setq mode-name "Article")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13565 (setq major-mode 'gnus-article-mode)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13566 (make-local-variable 'minor-mode-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13567 (or (assq 'gnus-show-mime minor-mode-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13568 (setq minor-mode-alist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13569 (cons (list 'gnus-show-mime " MIME") minor-mode-alist)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13570 (use-local-map gnus-article-mode-map)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13571 (make-local-variable 'page-delimiter)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13572 (setq page-delimiter gnus-page-delimiter)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13573 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13574 (setq buffer-read-only t) ;Disable modification
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13575 (run-hooks 'gnus-article-mode-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13576
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13577 (defun gnus-article-setup-buffer ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13578 "Initialize the article buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13579 (let* ((name (if gnus-single-article-buffer "*Article*"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13580 (concat "*Article " gnus-newsgroup-name "*")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13581 (original
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13582 (progn (string-match "\\*Article" name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13583 (concat " *Original Article"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13584 (substring name (match-end 0))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13585 (setq gnus-article-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13586 (setq gnus-original-article-buffer original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13587 ;; This might be a variable local to the summary buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13588 (unless gnus-single-article-buffer
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13589 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13590 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13591 (setq gnus-article-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13592 (setq gnus-original-article-buffer original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13593 (gnus-set-global-variables))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13594 (make-local-variable 'gnus-summary-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13595 ;; Init original article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13596 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13597 (set-buffer (get-buffer-create gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13598 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13599 (setq major-mode 'gnus-original-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13600 (make-local-variable 'gnus-original-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13601 (if (get-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13602 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13603 (set-buffer name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13604 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13605 (setq buffer-read-only t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13606 (gnus-add-current-to-buffer-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13607 (or (eq major-mode 'gnus-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13608 (gnus-article-mode))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13609 (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13610 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13611 (set-buffer (get-buffer-create name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13612 (gnus-add-current-to-buffer-list)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13613 (gnus-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13614 (current-buffer)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13615
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13616 ;; Set article window start at LINE, where LINE is the number of lines
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13617 ;; from the head of the article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13618 (defun gnus-article-set-window-start (&optional line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13619 (set-window-start
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13620 (get-buffer-window gnus-article-buffer t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13621 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13622 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13623 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13624 (if (not line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13625 (point-min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13626 (gnus-message 6 "Moved to bookmark")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13627 (search-forward "\n\n" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13628 (forward-line line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13629 (point)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13630
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13631 (defun gnus-kill-all-overlays ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13632 "Delete all overlays in the current buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13633 (when (fboundp 'overlay-lists)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13634 (let* ((overlayss (overlay-lists))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13635 (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13636 (overlays (nconc (car overlayss) (cdr overlayss))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13637 (while overlays
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13638 (delete-overlay (pop overlays))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13639
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13640 (defun gnus-request-article-this-buffer (article group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13641 "Get an article and insert it into this buffer."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13642 (let (do-update-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13643 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13644 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13645 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13646 (gnus-kill-all-overlays)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13647 (setq group (or group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13648
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13649 ;; Open server if it has closed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13650 (gnus-check-server (gnus-find-method-for-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13651
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13652 ;; Using `gnus-request-article' directly will insert the article into
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13653 ;; `nntp-server-buffer' - so we'll save some time by not having to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13654 ;; copy it from the server buffer into the article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13655
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13656 ;; We only request an article by message-id when we do not have the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13657 ;; headers for it, so we'll have to get those.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13658 (when (stringp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13659 (let ((gnus-override-method gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13660 (gnus-read-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13661
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13662 ;; If the article number is negative, that means that this article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13663 ;; doesn't belong in this newsgroup (possibly), so we find its
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13664 ;; message-id and request it by id instead of number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13665 (when (and (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13666 gnus-summary-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13667 (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13668 (buffer-name (get-buffer gnus-summary-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13669 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13670 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13671 (let ((header (gnus-summary-article-header article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13672 (if (< article 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13673 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13674 ((memq article gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13675 ;; This is a sparse gap article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13676 (setq do-update-line article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13677 (setq article (mail-header-id header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13678 (let ((gnus-override-method gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13679 (gnus-read-header article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13680 (setq gnus-newsgroup-sparse
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13681 (delq article gnus-newsgroup-sparse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13682 ((vectorp header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13683 ;; It's a real article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13684 (setq article (mail-header-id header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13685 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13686 ;; It is an extracted pseudo-article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13687 (setq article 'pseudo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13688 (gnus-request-pseudo-article header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13689
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13690 (let ((method (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13691 gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13692 (if (not (eq (car method) 'nneething))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13693 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13694 (let ((dir (concat (file-name-as-directory (nth 1 method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13695 (mail-header-subject header))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13696 (if (file-directory-p dir)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13697 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13698 (setq article 'nneething)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13699 (gnus-group-enter-directory dir)))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13700
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13701 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13702 ;; Refuse to select canceled articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13703 ((and (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13704 gnus-summary-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13705 (get-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13706 (buffer-name (get-buffer gnus-summary-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13707 (eq (cdr (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13708 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13709 (assq article gnus-newsgroup-reads)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13710 gnus-canceled-mark))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13711 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13712 ;; We first check `gnus-original-article-buffer'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13713 ((and (get-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13714 (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13715 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13716 (set-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13717 (and (equal (car gnus-original-article) group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13718 (eq (cdr gnus-original-article) article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13719 (insert-buffer-substring gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13720 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13721 ;; Check the backlog.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13722 ((and gnus-keep-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13723 (gnus-backlog-request-article group article (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13724 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13725 ;; Check the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13726 ((and gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13727 (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13728 (gnus-cache-request-article article group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13729 'article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13730 ;; Get the article and put into the article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13731 ((or (stringp article) (numberp article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13732 (let ((gnus-override-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13733 (and (stringp article) gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13734 (buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13735 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13736 (gnus-kill-all-overlays)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13737 (if (gnus-request-article article group (current-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13738 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13739 (and gnus-keep-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13740 (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13741 (gnus-backlog-enter-article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13742 group article (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13743 'article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13744 ;; It was a pseudo.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13745 (t article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13746
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13747 ;; Take the article from the original article buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13748 ;; and place it in the buffer it's supposed to be in.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13749 (when (and (get-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13750 ;;(numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13751 (equal (buffer-name (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13752 (buffer-name (get-buffer gnus-article-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13753 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13754 (if (get-buffer gnus-original-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13755 (set-buffer (get-buffer gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13756 (set-buffer (get-buffer-create gnus-original-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13757 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13758 (setq major-mode 'gnus-original-article-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13759 (setq buffer-read-only t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13760 (gnus-add-current-to-buffer-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13761 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13762 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13763 (insert-buffer-substring gnus-article-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13764 (setq gnus-original-article (cons group article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13765
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13766 ;; Update sparse articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13767 (when (and do-update-line
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13768 (or (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13769 (stringp article)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13770 (let ((buf (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13771 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13772 (gnus-summary-update-article do-update-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13773 (gnus-summary-goto-subject do-update-line nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13774 (set-window-point (get-buffer-window (current-buffer) t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13775 (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13776 (set-buffer buf))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13777
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13778 (defun gnus-read-header (id &optional header)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13779 "Read the headers of article ID and enter them into the Gnus system."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13780 (let ((group gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13781 (gnus-override-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13782 (and (gnus-news-group-p gnus-newsgroup-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13783 gnus-refer-article-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13784 where)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13785 ;; First we check to see whether the header in question is already
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13786 ;; fetched.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13787 (if (stringp id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13788 ;; This is a Message-ID.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13789 (setq header (or header (gnus-id-to-header id)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13790 ;; This is an article number.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13791 (setq header (or header (gnus-summary-article-header id))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13792 (if (and header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13793 (not (memq (mail-header-number header) gnus-newsgroup-sparse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13794 ;; We have found the header.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13795 header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13796 ;; We have to really fetch the header to this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13797 (when (setq where (gnus-request-head id group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13798 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13799 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13800 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13801 (insert ".\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13802 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13803 (insert "211 ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13804 (princ (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13805 ((numberp id) id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13806 ((cdr where) (cdr where))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13807 (header (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13808 (t gnus-reffed-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13809 (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13810 (insert " Article retrieved.\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13811 ;(when (and header
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13812 ; (memq (mail-header-number header) gnus-newsgroup-sparse))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13813 ; (setcar (gnus-id-to-thread id) nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13814 (if (not (setq header (car (gnus-get-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13815 () ; Malformed head.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13816 (unless (memq (mail-header-number header) gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13817 (if (and (stringp id)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13818 (not (string= (gnus-group-real-name group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13819 (car where))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13820 ;; If we fetched by Message-ID and the article came
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13821 ;; from a different group, we fudge some bogus article
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13822 ;; numbers for this article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13823 (mail-header-set-number header gnus-reffed-article-number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13824 (decf gnus-reffed-article-number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13825 (gnus-remove-header (mail-header-number header))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13826 (push header gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13827 (setq gnus-current-headers header)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13828 (push (mail-header-number header) gnus-newsgroup-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13829 header)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13830
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13831 (defun gnus-remove-header (number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13832 "Remove header NUMBER from `gnus-newsgroup-headers'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13833 (if (and gnus-newsgroup-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13834 (= number (mail-header-number (car gnus-newsgroup-headers))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13835 (pop gnus-newsgroup-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13836 (let ((headers gnus-newsgroup-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13837 (while (and (cdr headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13838 (not (= number (mail-header-number (cadr headers)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13839 (pop headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13840 (when (cdr headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13841 (setcdr headers (cddr headers))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13842
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13843 (defun gnus-article-prepare (article &optional all-headers header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13844 "Prepare ARTICLE in article mode buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13845 ARTICLE should either be an article number or a Message-ID.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13846 If ARTICLE is an id, HEADER should be the article headers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13847 If ALL-HEADERS is non-nil, no headers are hidden."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13848 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13849 ;; Make sure we start in a summary buffer.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13850 (unless (eq major-mode 'gnus-summary-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13851 (set-buffer gnus-summary-buffer))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13852 (setq gnus-summary-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13853 ;; Make sure the connection to the server is alive.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13854 (unless (gnus-server-opened
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13855 (gnus-find-method-for-group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13856 (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13857 (gnus-request-group gnus-newsgroup-name t))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13858 (let* ((article (if header (mail-header-number header) article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13859 (summary-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13860 (internal-hook gnus-article-internal-prepare-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13861 (group gnus-newsgroup-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13862 result)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13863 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13864 (gnus-article-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13865 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13866 ;; Deactivate active regions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13867 (when (and (boundp 'transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13868 transient-mark-mode)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13869 (setq mark-active nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13870 (if (not (setq result (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13871 (gnus-request-article-this-buffer
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13872 article group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13873 ;; There is no such article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13874 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13875 (when (and (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13876 (not (memq article gnus-newsgroup-sparse)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13877 (setq gnus-article-current
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13878 (cons gnus-newsgroup-name article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13879 (set-buffer gnus-summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13880 (setq gnus-current-article article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13881 (gnus-summary-mark-article article gnus-canceled-mark))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13882 (unless (memq article gnus-newsgroup-sparse)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13883 (gnus-error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13884 1 "No such article (may have expired or been canceled)")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13885 (if (or (eq result 'pseudo) (eq result 'nneething))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13886 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13887 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13888 (set-buffer summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13889 (setq gnus-last-article gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13890 gnus-newsgroup-history (cons gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13891 gnus-newsgroup-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13892 gnus-current-article 0
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13893 gnus-current-headers nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13894 gnus-article-current nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13895 (if (eq result 'nneething)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13896 (gnus-configure-windows 'summary)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13897 (gnus-configure-windows 'article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13898 (gnus-set-global-variables))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13899 (gnus-set-mode-line 'article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13900 ;; The result from the `request' was an actual article -
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13901 ;; or at least some text that is now displayed in the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13902 ;; article buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13903 (if (and (numberp article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13904 (not (eq article gnus-current-article)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13905 ;; Seems like a new article has been selected.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13906 ;; `gnus-current-article' must be an article number.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13907 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13908 (set-buffer summary-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13909 (setq gnus-last-article gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13910 gnus-newsgroup-history (cons gnus-current-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13911 gnus-newsgroup-history)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13912 gnus-current-article article
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13913 gnus-current-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13914 (gnus-summary-article-header gnus-current-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13915 gnus-article-current
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13916 (cons gnus-newsgroup-name gnus-current-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13917 (unless (vectorp gnus-current-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13918 (setq gnus-current-headers nil))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13919 (gnus-summary-show-thread)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13920 (run-hooks 'gnus-mark-article-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13921 (gnus-set-mode-line 'summary)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13922 (and (gnus-visual-p 'article-highlight 'highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13923 (run-hooks 'gnus-visual-mark-article-hook))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13924 ;; Set the global newsgroup variables here.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13925 ;; Suggested by Jim Sisolak
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13926 ;; <sisolak@trans4.neep.wisc.edu>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13927 (gnus-set-global-variables)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13928 (setq gnus-have-all-headers
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13929 (or all-headers gnus-show-all-headers))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13930 (and gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13931 (vectorp (gnus-summary-article-header article))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13932 (gnus-cache-possibly-enter-article
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13933 group article
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13934 (gnus-summary-article-header article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13935 (memq article gnus-newsgroup-marked)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13936 (memq article gnus-newsgroup-dormant)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13937 (memq article gnus-newsgroup-unreads)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13938 (when (or (numberp article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13939 (stringp article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13940 ;; Hooks for getting information from the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13941 ;; This hook must be called before being narrowed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13942 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13943 (run-hooks 'internal-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13944 (run-hooks 'gnus-article-prepare-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13945 ;; Decode MIME message.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13946 (if gnus-show-mime
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13947 (if (or (not gnus-strict-mime)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13948 (gnus-fetch-field "Mime-Version"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13949 (funcall gnus-show-mime-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13950 (funcall gnus-decode-encoded-word-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13951 ;; Perform the article display hooks.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13952 (run-hooks 'gnus-article-display-hook))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13953 ;; Do page break.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13954 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13955 (and gnus-break-pages (gnus-narrow-to-page)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13956 (gnus-set-mode-line 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13957 (gnus-configure-windows 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13958 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13959 t))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13960
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13961 (defun gnus-article-show-all-headers ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13962 "Show all article headers in article mode buffer."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13963 (save-excursion
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13964 (gnus-article-setup-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13965 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13966 (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13967 (gnus-unhide-text (point-min) (point-max)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13968
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13969 (defun gnus-article-hide-headers-if-wanted ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13970 "Hide unwanted headers if `gnus-have-all-headers' is nil.
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
13971 Provided for backwards compatibility."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13972 (or (save-excursion (set-buffer gnus-summary-buffer) gnus-have-all-headers)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13973 gnus-inhibit-hiding
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13974 (gnus-article-hide-headers)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
13975
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13976 (defsubst gnus-article-header-rank ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13977 "Give the rank of the string HEADER as given by `gnus-sorted-header-list'."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13978 (let ((list gnus-sorted-header-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13979 (i 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13980 (while list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13981 (when (looking-at (car list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13982 (setq list nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13983 (setq list (cdr list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13984 (incf i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13985 i))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13986
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13987 (defun gnus-article-hide-headers (&optional arg delete)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13988 "Toggle whether to hide unwanted headers and possibly sort them as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13989 If given a negative prefix, always show; if given a positive prefix,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13990 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13991 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13992 (if (gnus-article-check-hidden-text 'headers arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13993 ;; Show boring headers as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13994 (gnus-article-show-hidden-text 'boring-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13995 ;; This function might be inhibited.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13996 (unless gnus-inhibit-hiding
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13997 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13998 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
13999 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14000 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14001 (props (nconc (list 'gnus-type 'headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14002 gnus-hidden-properties))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14003 (max (1+ (length gnus-sorted-header-list)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14004 (ignored (when (not (stringp gnus-visible-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14005 (cond ((stringp gnus-ignored-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14006 gnus-ignored-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14007 ((listp gnus-ignored-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14008 (mapconcat 'identity gnus-ignored-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14009 "\\|")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14010 (visible
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14011 (cond ((stringp gnus-visible-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14012 gnus-visible-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14013 ((and gnus-visible-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14014 (listp gnus-visible-headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14015 (mapconcat 'identity gnus-visible-headers "\\|"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14016 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14017 want-list beg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14018 ;; First we narrow to just the headers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14019 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14020 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14021 ;; Hide any "From " lines at the beginning of (mail) articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14022 (while (looking-at "From ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14023 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14024 (unless (bobp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14025 (if delete
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14026 (delete-region (point-min) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14027 (gnus-hide-text (point-min) (point) props)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14028 ;; Then treat the rest of the header lines.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14029 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14030 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14031 (progn (search-forward "\n\n" nil t) (forward-line -1) (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14032 ;; Then we use the two regular expressions
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14033 ;; `gnus-ignored-headers' and `gnus-visible-headers' to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14034 ;; select which header lines is to remain visible in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14035 ;; article buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14036 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14037 (while (re-search-forward "^[^ \t]*:" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14038 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14039 ;; We add the headers we want to keep to a list and delete
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14040 ;; them from the buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14041 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14042 (point) (1+ (point)) 'message-rank
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14043 (if (or (and visible (looking-at visible))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14044 (and ignored
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14045 (not (looking-at ignored))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14046 (gnus-article-header-rank)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14047 (+ 2 max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14048 (forward-line 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14049 (message-sort-headers-1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14050 (when (setq beg (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14051 (point-min) (point-max) 'message-rank (+ 2 max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14052 ;; We make the unwanted headers invisible.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14053 (if delete
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14054 (delete-region beg (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14055 ;; Suggested by Sudish Joseph <joseph@cis.ohio-state.edu>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14056 (gnus-hide-text-type beg (point-max) 'headers))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14057 ;; Work around XEmacs lossage.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14058 (gnus-put-text-property (point-min) beg 'invisible nil))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14059
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14060 (defun gnus-article-hide-boring-headers (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14061 "Toggle hiding of headers that aren't very interesting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14062 If given a negative prefix, always show; if given a positive prefix,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14063 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14064 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14065 (unless (gnus-article-check-hidden-text 'boring-headers arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14066 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14067 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14068 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14069 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14070 (list gnus-boring-article-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14071 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14072 elem)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14073 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14074 (while list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14075 (setq elem (pop list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14076 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14077 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14078 ;; Hide empty headers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14079 ((eq elem 'empty)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14080 (while (re-search-forward "^[^:]+:[ \t]\n[^ \t]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14081 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14082 (gnus-hide-text-type
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14083 (progn (beginning-of-line) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14084 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14085 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14086 (if (re-search-forward "^[^ \t]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14087 (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14088 (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14089 'boring-headers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14090 ;; Hide boring Newsgroups header.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14091 ((eq elem 'newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14092 (when (equal (message-fetch-field "newsgroups")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14093 (gnus-group-real-name gnus-newsgroup-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14094 (gnus-article-hide-header "newsgroups")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14095 ((eq elem 'followup-to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14096 (when (equal (message-fetch-field "followup-to")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14097 (message-fetch-field "newsgroups"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14098 (gnus-article-hide-header "followup-to")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14099 ((eq elem 'reply-to)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14100 (let ((from (message-fetch-field "from"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14101 (reply-to (message-fetch-field "reply-to")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14102 (when (and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14103 from reply-to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14104 (equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14105 (nth 1 (funcall gnus-extract-address-components from))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14106 (nth 1 (funcall gnus-extract-address-components
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14107 reply-to))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14108 (gnus-article-hide-header "reply-to"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14109 ((eq elem 'date)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14110 (let ((date (message-fetch-field "date")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14111 (when (and date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14112 (< (gnus-days-between date (current-time-string))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14113 4))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14114 (gnus-article-hide-header "date")))))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14115
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14116 (defun gnus-article-hide-header (header)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14117 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14118 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14119 (when (re-search-forward (concat "^" header ":") nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14120 (gnus-hide-text-type
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14121 (progn (beginning-of-line) (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14122 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14123 (end-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14124 (if (re-search-forward "^[^ \t]" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14125 (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14126 (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14127 'boring-headers))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14128
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14129 ;; Written by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14130 (defun gnus-article-treat-overstrike ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14131 "Translate overstrikes into bold text."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14132 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14133 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14134 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14135 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14136 (while (search-forward "\b" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14137 (let ((next (following-char))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14138 (previous (char-after (- (point) 2))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14139 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14140 ((eq next previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14141 (gnus-put-text-property (- (point) 2) (point) 'invisible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14142 (gnus-put-text-property (point) (1+ (point)) 'face 'bold))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14143 ((eq next ?_)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14144 (gnus-put-text-property (1- (point)) (1+ (point)) 'invisible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14145 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14146 (- (point) 2) (1- (point)) 'face 'underline))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14147 ((eq previous ?_)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14148 (gnus-put-text-property (- (point) 2) (point) 'invisible t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14149 (gnus-put-text-property
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14150 (point) (1+ (point)) 'face 'underline))))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14151
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14152 (defun gnus-article-word-wrap ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14153 "Format too long lines."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14154 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14155 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14156 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14157 (let ((buffer-read-only nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14158 (widen)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14159 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14160 (search-forward "\n\n" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14161 (end-of-line 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14162 (let ((paragraph-start "^[>|#:<;* ]*[ \t]*$")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14163 (adaptive-fill-regexp "[ \t]*\\([|#:<;>*]+ *\\)?")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14164 (adaptive-fill-mode t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14165 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14166 (and (>= (current-column) (min fill-column (window-width)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14167 (/= (preceding-char) ?:)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14168 (fill-paragraph nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14169 (end-of-line 2))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14170
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14171 (defun gnus-article-remove-cr ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14172 "Remove carriage returns from an article."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14173 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14174 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14175 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14176 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14177 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14178 (while (search-forward "\r" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14179 (replace-match "" t t)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14180
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14181 (defun gnus-article-remove-trailing-blank-lines ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14182 "Remove all trailing blank lines from the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14183 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14184 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14185 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14186 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14187 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14188 (delete-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14189 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14190 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14191 (while (looking-at "^[ \t]*$")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14192 (forward-line -1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14193 (forward-line 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14194 (point))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14195
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14196 (defun gnus-article-display-x-face (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14197 "Look for an X-Face header and display it if present."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14198 (interactive (list 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14199 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14200 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14201 ;; Delete the old process, if any.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14202 (when (process-status "gnus-x-face")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14203 (delete-process "gnus-x-face"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14204 (let ((inhibit-point-motion-hooks t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14205 (case-fold-search nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14206 from)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14207 (save-restriction
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14208 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14209 (setq from (message-fetch-field "from"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14210 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14211 (when (and gnus-article-x-face-command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14212 (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14213 ;; Check whether this face is censored.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14214 (not gnus-article-x-face-too-ugly)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14215 (and gnus-article-x-face-too-ugly from
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14216 (not (string-match gnus-article-x-face-too-ugly
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14217 from))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14218 ;; Has to be present.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14219 (re-search-forward "^X-Face: " nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14220 ;; We now have the area of the buffer where the X-Face is stored.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14221 (let ((beg (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14222 (end (1- (re-search-forward "^\\($\\|[^ \t]\\)" nil t))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14223 ;; We display the face.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14224 (if (symbolp gnus-article-x-face-command)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14225 ;; The command is a lisp function, so we call it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14226 (if (gnus-functionp gnus-article-x-face-command)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14227 (funcall gnus-article-x-face-command beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14228 (error "%s is not a function" gnus-article-x-face-command))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14229 ;; The command is a string, so we interpret the command
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14230 ;; as a, well, command, and fork it off.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14231 (let ((process-connection-type nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14232 (process-kill-without-query
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14233 (start-process
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14234 "gnus-x-face" nil shell-file-name shell-command-switch
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14235 gnus-article-x-face-command))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14236 (process-send-region "gnus-x-face" beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14237 (process-send-eof "gnus-x-face")))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14238
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14239 (defalias 'gnus-headers-decode-quoted-printable 'gnus-decode-rfc1522)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14240 (defun gnus-decode-rfc1522 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14241 "Hack to remove QP encoding from headers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14242 (let ((case-fold-search t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14243 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14244 (buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14245 string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14246 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14247 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14248 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14249 (or (search-forward "\n\n" nil t) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14250
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14251 (while (re-search-forward
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14252 "=\\?iso-8859-1\\?q\\?\\([^?\t\n]*\\)\\?=" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14253 (setq string (match-string 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14254 (narrow-to-region (match-beginning 0) (match-end 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14255 (delete-region (point-min) (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14256 (insert string)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14257 (gnus-mime-decode-quoted-printable (goto-char (point-min)) (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14258 (subst-char-in-region (point-min) (point-max) ?_ ? )
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14259 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14260 (goto-char (point-min))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14261
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14262 (defun gnus-article-de-quoted-unreadable (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14263 "Do a naive translation of a quoted-printable-encoded article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14264 This is in no way, shape or form meant as a replacement for real MIME
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14265 processing, but is simply a stop-gap measure until MIME support is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14266 written.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14267 If FORCE, decode the article whether it is marked as quoted-printable
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14268 or not."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14269 (interactive (list 'force))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14270 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14271 (set-buffer gnus-article-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14272 (let ((case-fold-search t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14273 (buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14274 (type (gnus-fetch-field "content-transfer-encoding")))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14275 (gnus-decode-rfc1522)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14276 (when (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14277 (and type (string-match "quoted-printable" (downcase type))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14278 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14279 (search-forward "\n\n" nil 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14280 (gnus-mime-decode-quoted-printable (point) (point-max))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14281
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14282 (defun gnus-mime-decode-quoted-printable (from to)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14283 "Decode Quoted-Printable in the region between FROM and TO."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14284 (interactive "r")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14285 (goto-char from)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14286 (while (search-forward "=" to t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14287 (cond ((eq (following-char) ?\n)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14288 (delete-char -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14289 (delete-char 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14290 ((looking-at "[0-9A-F][0-9A-F]")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14291 (subst-char-in-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14292 (1- (point)) (point) ?=
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14293 (hexl-hex-string-to-integer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14294 (buffer-substring (point) (+ 2 (point)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14295 (delete-char 2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14296 ((looking-at "=")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14297 (delete-char 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14298 ((gnus-message 3 "Malformed MIME quoted-printable message")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14299
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14300 (defun gnus-article-hide-pgp (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14301 "Toggle hiding of any PGP headers and signatures in the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14302 If given a negative prefix, always show; if given a positive prefix,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14303 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14304 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14305 (unless (gnus-article-check-hidden-text 'pgp arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14306 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14307 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14308 (let ((props (nconc (list 'gnus-type 'pgp) gnus-hidden-properties))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14309 buffer-read-only beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14310 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14311 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14312 ;; Hide the "header".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14313 (and (search-forward "\n-----BEGIN PGP SIGNED MESSAGE-----\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14314 (gnus-hide-text (match-beginning 0) (match-end 0) props))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14315 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14316 ;; Hide the actual signature.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14317 (and (search-forward "\n-----BEGIN PGP SIGNATURE-----\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14318 (setq end (1+ (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14319 (gnus-hide-text
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14320 end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14321 (if (search-forward "\n-----END PGP SIGNATURE-----\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14322 (match-end 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14323 ;; Perhaps we shouldn't hide to the end of the buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14324 ;; if there is no end to the signature?
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14325 (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14326 props))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14327 ;; Hide "- " PGP quotation markers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14328 (when (and beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14329 (narrow-to-region beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14330 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14331 (while (re-search-forward "^- " nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14332 (gnus-hide-text (match-beginning 0) (match-end 0) props))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14333 (widen))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14334
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14335 (defun gnus-article-hide-signature (&optional arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14336 "Hide the signature in the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14337 If given a negative prefix, always show; if given a positive prefix,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14338 always hide."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14339 (interactive (gnus-hidden-arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14340 (unless (gnus-article-check-hidden-text 'signature arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14341 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14342 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14343 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14344 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14345 (when (gnus-narrow-to-signature)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14346 (gnus-hide-text-type (point-min) (point-max) 'signature)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14347
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14348 (defun gnus-article-strip-leading-blank-lines ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14349 "Remove all blank lines from the beginning of the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14350 (interactive)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14351 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14352 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14353 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14354 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14355 (when (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14356 (while (looking-at "[ \t]$")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14357 (gnus-delete-line))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14358
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14359 (defvar mime::preview/content-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14360 (defvar mime::preview-content-info/point-min)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14361 (defun gnus-narrow-to-signature ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14362 "Narrow to the signature."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14363 (widen)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14364 (if (and (boundp 'mime::preview/content-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14365 mime::preview/content-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14366 (let ((pcinfo (car (last mime::preview/content-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14367 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14368 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14369 (funcall (intern "mime::preview-content-info/point-min") pcinfo)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14370 (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14371 (error nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14372 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14373 (when (re-search-backward gnus-signature-separator nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14374 (forward-line 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14375 (when (or (null gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14376 (and (numberp gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14377 (< (- (point-max) (point)) gnus-signature-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14378 (and (gnus-functionp gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14379 (funcall gnus-signature-limit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14380 (and (stringp gnus-signature-limit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14381 (not (re-search-forward gnus-signature-limit nil t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14382 (narrow-to-region (point) (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14383 t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14384
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14385 (defun gnus-hidden-arg ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14386 "Return the current prefix arg as a number, or 0 if no prefix."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14387 (list (if current-prefix-arg
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14388 (prefix-numeric-value current-prefix-arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14389 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14390
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14391 (defun gnus-article-check-hidden-text (type arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14392 "Return nil if hiding is necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14393 Arg can be nil or a number. Nil and positive means hide, negative
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14394 means show, 0 means toggle."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14395 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14396 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14397 (let ((hide (gnus-article-hidden-text-p type)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14398 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14399 ((or (null arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14400 (> arg 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14401 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14402 ((< arg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14403 (gnus-article-show-hidden-text type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14404 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14405 (if (eq hide 'hidden)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14406 (gnus-article-show-hidden-text type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14407 nil))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14408
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14409 (defun gnus-article-hidden-text-p (type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14410 "Say whether the current buffer contains hidden text of type TYPE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14411 (let ((pos (text-property-any (point-min) (point-max) 'gnus-type type)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14412 (when pos
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14413 (if (get-text-property pos 'invisible)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14414 'hidden
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14415 'shown))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14416
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14417 (defun gnus-article-hide (&optional arg force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14418 "Hide all the gruft in the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14419 This means that PGP stuff, signatures, cited text and (some)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14420 headers will be hidden.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14421 If given a prefix, show the hidden text instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14422 (interactive (list current-prefix-arg 'force))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14423 (gnus-article-hide-headers arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14424 (gnus-article-hide-pgp arg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14425 (gnus-article-hide-citation-maybe arg force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14426 (gnus-article-hide-signature arg))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14427
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14428 (defun gnus-article-show-hidden-text (type &optional hide)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14429 "Show all hidden text of type TYPE.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14430 If HIDE, hide the text instead."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14431 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14432 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14433 (let ((buffer-read-only nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14434 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14435 (beg (point-min)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14436 (while (gnus-goto-char (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14437 beg (point-max) 'gnus-type type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14438 (setq beg (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14439 (forward-char)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14440 (if hide
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14441 (gnus-hide-text beg (point) gnus-hidden-properties)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14442 (gnus-unhide-text beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14443 (setq beg (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14444 t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14445
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14446 (defvar gnus-article-time-units
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14447 `((year . ,(* 365.25 24 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14448 (week . ,(* 7 24 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14449 (day . ,(* 24 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14450 (hour . ,(* 60 60))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14451 (minute . 60)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14452 (second . 1))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14453 "Mapping from time units to seconds.")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14454
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14455 (defun gnus-article-date-ut (&optional type highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14456 "Convert DATE date to universal time in the current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14457 If TYPE is `local', convert to local time; if it is `lapsed', output
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14458 how much time has lapsed since DATE."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14459 (interactive (list 'ut t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14460 (let* ((header (or gnus-current-headers
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14461 (gnus-summary-article-header) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14462 (date (and (vectorp header) (mail-header-date header)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14463 (date-regexp "^Date: \\|^X-Sent: ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14464 (now (current-time))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14465 (inhibit-point-motion-hooks t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14466 bface eface)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14467 (when (and date (not (string= date "")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14468 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14469 (set-buffer gnus-article-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14470 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14471 (nnheader-narrow-to-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14472 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14473 ;; Delete any old Date headers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14474 (if (re-search-forward date-regexp nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14475 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14476 (setq bface (get-text-property (gnus-point-at-bol) 'face)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14477 eface (get-text-property (1- (gnus-point-at-eol))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14478 'face))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14479 (message-remove-header date-regexp t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14480 (beginning-of-line))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14481 (goto-char (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14482 (insert (gnus-make-date-line date type))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14483 ;; Do highlighting.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14484 (forward-line -1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14485 (when (and (gnus-visual-p 'article-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14486 (looking-at "\\([^:]+\\): *\\(.*\\)$"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14487 (gnus-put-text-property (match-beginning 1) (match-end 1)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14488 'face bface)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14489 (gnus-put-text-property (match-beginning 2) (match-end 2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14490 'face eface))))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14491
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14492 (defun gnus-make-date-line (date type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14493 "Return a DATE line of TYPE."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14494 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14495 ;; Convert to the local timezone. We have to slap a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14496 ;; `condition-case' round the calls to the timezone
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14497 ;; functions since they aren't particularly resistant to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14498 ;; buggy dates.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14499 ((eq type 'local)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14500 (concat "Date: " (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14501 (timezone-make-date-arpa-standard date)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14502 (error date))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14503 "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14504 ;; Convert to Universal Time.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14505 ((eq type 'ut)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14506 (concat "Date: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14507 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14508 (timezone-make-date-arpa-standard date nil "UT")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14509 (error date))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14510 "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14511 ;; Get the original date from the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14512 ((eq type 'original)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14513 (concat "Date: " date "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14514 ;; Do an X-Sent lapsed format.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14515 ((eq type 'lapsed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14516 ;; If the date is seriously mangled, the timezone
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14517 ;; functions are liable to bug out, so we condition-case
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14518 ;; the entire thing.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14519 (let* ((now (current-time))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14520 (real-time
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14521 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14522 (gnus-time-minus
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14523 (gnus-encode-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14524 (timezone-make-date-arpa-standard
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14525 (current-time-string now)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14526 (current-time-zone now) "UT"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14527 (gnus-encode-date
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14528 (timezone-make-date-arpa-standard
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14529 date nil "UT")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14530 (error '(0 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14531 (real-sec (+ (* (float (car real-time)) 65536)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14532 (cadr real-time)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14533 (sec (abs real-sec))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14534 num prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14535 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14536 ((equal real-time '(0 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14537 "X-Sent: Unknown\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14538 ((zerop sec)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14539 "X-Sent: Now\n")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14540 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14541 (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14542 "X-Sent: "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14543 ;; This is a bit convoluted, but basically we go
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14544 ;; through the time units for years, weeks, etc,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14545 ;; and divide things to see whether that results
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14546 ;; in positive answers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14547 (mapconcat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14548 (lambda (unit)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14549 (if (zerop (setq num (ffloor (/ sec (cdr unit)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14550 ;; The (remaining) seconds are too few to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14551 ;; be divided into this time unit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14552 ""
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14553 ;; It's big enough, so we output it.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14554 (setq sec (- sec (* num (cdr unit))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14555 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14556 (concat (if prev ", " "") (int-to-string
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14557 (floor num))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14558 " " (symbol-name (car unit))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14559 (if (> num 1) "s" ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14560 (setq prev t))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14561 gnus-article-time-units "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14562 ;; If dates are odd, then it might appear like the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14563 ;; article was sent in the future.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14564 (if (> real-sec 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14565 " ago\n"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14566 " in the future\n"))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14567 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14568 (error "Unknown conversion type: %s" type))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14569
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14570 (defun gnus-article-date-local (&optional highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14571 "Convert the current article date to the local timezone."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14572 (interactive (list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14573 (gnus-article-date-ut 'local highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14574
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14575 (defun gnus-article-date-original (&optional highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14576 "Convert the current article date to what it was originally.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14577 This is only useful if you have used some other date conversion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14578 function and want to see what the date was before converting."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14579 (interactive (list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14580 (gnus-article-date-ut 'original highlight))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14581
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14582 (defun gnus-article-date-lapsed (&optional highlight)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14583 "Convert the current article date to time lapsed since it was sent."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14584 (interactive (list t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14585 (gnus-article-date-ut 'lapsed highlight))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14586
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14587 (defun gnus-article-maybe-highlight ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14588 "Do some article highlighting if `gnus-visual' is non-nil."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14589 (if (gnus-visual-p 'article-highlight 'highlight)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14590 (gnus-article-highlight-some)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14591
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14592 ;;; Article savers.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14593
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14594 (defun gnus-output-to-rmail (file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14595 "Append the current article to an Rmail file named FILE-NAME."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14596 (require 'rmail)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14597 ;; Most of these codes are borrowed from rmailout.el.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14598 (setq file-name (expand-file-name file-name))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14599 (setq rmail-default-rmail-file file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14600 (let ((artbuf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14601 (tmpbuf (get-buffer-create " *Gnus-output*")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14602 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14603 (or (get-file-buffer file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14604 (file-exists-p file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14605 (if (gnus-yes-or-no-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14606 (concat "\"" file-name "\" does not exist, create it? "))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14607 (let ((file-buffer (create-file-buffer file-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14608 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14609 (set-buffer file-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14610 (rmail-insert-rmail-file-header)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14611 (let ((require-final-newline nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14612 (write-region (point-min) (point-max) file-name t 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14613 (kill-buffer file-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14614 (error "Output file does not exist")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14615 (set-buffer tmpbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14616 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14617 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14618 (insert-buffer-substring artbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14619 (gnus-convert-article-to-rmail)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14620 ;; Decide whether to append to a file or to an Emacs buffer.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14621 (let ((outbuf (get-file-buffer file-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14622 (if (not outbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14623 (append-to-file (point-min) (point-max) file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14624 ;; File has been visited, in buffer OUTBUF.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14625 (set-buffer outbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14626 (let ((buffer-read-only nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14627 (msg (and (boundp 'rmail-current-message)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14628 (symbol-value 'rmail-current-message))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14629 ;; If MSG is non-nil, buffer is in RMAIL mode.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14630 (if msg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14631 (progn (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14632 (narrow-to-region (point-max) (point-max))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14633 (insert-buffer-substring tmpbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14634 (if msg
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14635 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14636 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14637 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14638 (search-backward "\^_")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14639 (narrow-to-region (point) (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14640 (goto-char (1+ (point-min)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14641 (rmail-count-new-messages t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14642 (rmail-show-message msg)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14643 (kill-buffer tmpbuf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14644
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14645 (defun gnus-output-to-file (file-name)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14646 "Append the current article to a file named FILE-NAME."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14647 (let ((artbuf (current-buffer)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14648 (nnheader-temp-write nil
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14649 (insert-buffer-substring artbuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14650 ;; Append newline at end of the buffer as separator, and then
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14651 ;; save it to file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14652 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14653 (insert "\n")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14654 (append-to-file (point-min) (point-max) file-name))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14655
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14656 (defun gnus-convert-article-to-rmail ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14657 "Convert article in current buffer to Rmail message format."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14658 (let ((buffer-read-only nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14659 ;; Convert article directly into Babyl format.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14660 ;; Suggested by Rob Austein <sra@lcs.mit.edu>
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14661 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14662 (insert "\^L\n0, unseen,,\n*** EOOH ***\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14663 (while (search-forward "\n\^_" nil t) ;single char
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14664 (replace-match "\n^_" t t)) ;2 chars: "^" and "_"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14665 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14666 (insert "\^_")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14667
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14668 (defun gnus-narrow-to-page (&optional arg)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14669 "Narrow the article buffer to a page.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14670 If given a numerical ARG, move forward ARG pages."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14671 (interactive "P")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14672 (setq arg (if arg (prefix-numeric-value arg) 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14673 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14674 (set-buffer gnus-article-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14675 (goto-char (point-min))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14676 (widen)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14677 (when (gnus-visual-p 'page-marker)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14678 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14679 (gnus-remove-text-with-property 'gnus-prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14680 (gnus-remove-text-with-property 'gnus-next)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14681 (when
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14682 (cond ((< arg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14683 (re-search-backward page-delimiter nil 'move (1+ (abs arg))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14684 ((> arg 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14685 (re-search-forward page-delimiter nil 'move arg)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14686 (goto-char (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14687 (narrow-to-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14688 (point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14689 (if (re-search-forward page-delimiter nil 'move)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14690 (match-beginning 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14691 (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14692 (when (and (gnus-visual-p 'page-marker)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14693 (not (= (point-min) 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14694 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14695 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14696 (gnus-insert-prev-page-button)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14697 (when (and (gnus-visual-p 'page-marker)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14698 (not (= (1- (point-max)) (buffer-size))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14699 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14700 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14701 (gnus-insert-next-page-button)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14702
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14703 ;; Article mode commands
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14704
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14705 (defun gnus-article-goto-next-page ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14706 "Show the next page of the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14707 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14708 (when (gnus-article-next-page)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14709 (gnus-article-read-summary-keys nil (gnus-character-to-event ?n))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14710
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14711 (defun gnus-article-goto-prev-page ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14712 "Show the next page of the article."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14713 (interactive)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14714 (if (bobp) (gnus-article-read-summary-keys nil (gnus-character-to-event ?n))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14715 (gnus-article-prev-page nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14716
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14717 (defun gnus-article-next-page (&optional lines)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14718 "Show the next page of the current article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14719 If end of article, return non-nil. Otherwise return nil.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14720 Argument LINES specifies lines to be scrolled up."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14721 (interactive "p")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14722 (move-to-window-line -1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14723 ;; Fixed by enami@ptgd.sony.co.jp (enami tsugutomo)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14724 (if (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14725 (end-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14726 (and (pos-visible-in-window-p) ;Not continuation line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14727 (eobp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14728 ;; Nothing in this page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14729 (if (or (not gnus-break-pages)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14730 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14731 (save-restriction
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14732 (widen) (forward-line 1) (eobp)))) ;Real end-of-buffer?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14733 t ;Nothing more.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14734 (gnus-narrow-to-page 1) ;Go to next page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14735 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14736 ;; More in this page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14737 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14738 (scroll-up lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14739 (end-of-buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14740 ;; Long lines may cause an end-of-buffer error.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14741 (goto-char (point-max))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14742 (move-to-window-line 0)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14743 nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14744
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14745 (defun gnus-article-prev-page (&optional lines)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14746 "Show previous page of current article.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14747 Argument LINES specifies lines to be scrolled down."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14748 (interactive "p")
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14749 (move-to-window-line 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14750 (if (and gnus-break-pages
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14751 (bobp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14752 (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14753 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14754 (gnus-narrow-to-page -1) ;Go to previous page.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14755 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14756 (recenter -1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14757 (prog1
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14758 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14759 (scroll-down lines)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14760 (error nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14761 (move-to-window-line 0))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14762
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14763 (defun gnus-article-refer-article ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14764 "Read article specified by message-id around point."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14765 (interactive)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14766 (let ((point (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14767 (search-forward ">" nil t) ;Move point to end of "<....>".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14768 (if (re-search-backward "\\(<[^<> \t\n]+>\\)" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14769 (let ((message-id (match-string 1)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14770 (goto-char point)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14771 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14772 (gnus-summary-refer-article message-id))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14773 (goto-char (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14774 (error "No references around point"))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14775
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14776 (defun gnus-article-show-summary ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14777 "Reconfigure windows to show summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14778 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14779 (gnus-configure-windows 'article)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14780 (gnus-summary-goto-subject gnus-current-article))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14781
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14782 (defun gnus-article-describe-briefly ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14783 "Describe article mode commands briefly."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14784 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14785 (gnus-message 6
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14786 (substitute-command-keys "\\<gnus-article-mode-map>\\[gnus-article-goto-next-page]:Next page \\[gnus-article-goto-prev-page]:Prev page \\[gnus-article-show-summary]:Show summary \\[gnus-info-find-node]:Run Info \\[gnus-article-describe-briefly]:This help")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14787
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14788 (defun gnus-article-summary-command ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14789 "Execute the last keystroke in the summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14790 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14791 (let ((obuf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14792 (owin (current-window-configuration))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14793 func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14794 (switch-to-buffer gnus-summary-buffer 'norecord)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14795 (setq func (lookup-key (current-local-map) (this-command-keys)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14796 (call-interactively func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14797 (set-buffer obuf)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14798 (set-window-configuration owin)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14799 (set-window-point (get-buffer-window (current-buffer)) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14800
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14801 (defun gnus-article-summary-command-nosave ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14802 "Execute the last keystroke in the summary buffer."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14803 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14804 (let (func)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14805 (pop-to-buffer gnus-summary-buffer 'norecord)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14806 (setq func (lookup-key (current-local-map) (this-command-keys)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14807 (call-interactively func)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14808
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14809 (defun gnus-article-read-summary-keys (&optional arg key not-restore-window)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14810 "Read a summary buffer key sequence and execute it from the article buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14811 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14812 (let ((nosaves
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14813 '("q" "Q" "c" "r" "R" "\C-c\C-f" "m" "a" "f" "F"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14814 "Zc" "ZC" "ZE" "ZQ" "ZZ" "Zn" "ZR" "ZG" "ZN" "ZP"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14815 "=" "^" "\M-^" "|"))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14816 (nosave-but-article
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14817 '("A\r"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14818 keys)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14819 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14820 (set-buffer gnus-summary-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14821 (push (or key last-command-event) unread-command-events)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14822 (setq keys (read-key-sequence nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14823 (message "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14824
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14825 (if (or (member keys nosaves)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14826 (member keys nosave-but-article))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14827 (let (func)
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14828 (save-window-excursion
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14829 (pop-to-buffer gnus-summary-buffer 'norecord)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14830 (setq func (lookup-key (current-local-map) keys)))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14831 (if (not func)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14832 (ding)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14833 (set-buffer gnus-summary-buffer)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14834 (call-interactively func))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14835 (when (member keys nosave-but-article)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14836 (pop-to-buffer gnus-article-buffer 'norecord)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14837 (let ((obuf (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14838 (owin (current-window-configuration))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14839 (opoint (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14840 func in-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14841 (if not-restore-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14842 (pop-to-buffer gnus-summary-buffer 'norecord)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14843 (switch-to-buffer gnus-summary-buffer 'norecord))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14844 (setq in-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14845 (if (setq func (lookup-key (current-local-map) keys))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14846 (call-interactively func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14847 (ding))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14848 (when (eq in-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14849 (set-buffer obuf)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14850 (unless not-restore-window
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14851 (set-window-configuration owin))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14852 (set-window-point (get-buffer-window (current-buffer)) opoint))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14853
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14854
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14855 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14856 ;;; Kill file handling.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14857 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14858
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14859 ;;;###autoload
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14860 (defalias 'gnus-batch-kill 'gnus-batch-score)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14861 ;;;###autoload
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14862 (defun gnus-batch-score ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14863 "Run batched scoring.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14864 Usage: emacs -batch -l gnus -f gnus-batch-score <newsgroups> ...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14865 Newsgroups is a list of strings in Bnews format. If you want to score
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14866 the comp hierarchy, you'd say \"comp.all\". If you would not like to
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14867 score the alt hierarchy, you'd say \"!alt.all\"."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14868 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14869 (let* ((yes-and-no
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14870 (gnus-newsrc-parse-options
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14871 (apply (function concat)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14872 (mapcar (lambda (g) (concat g " "))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14873 command-line-args-left))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14874 (gnus-expert-user t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14875 (nnmail-spool-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14876 (gnus-use-dribble-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14877 (yes (car yes-and-no))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14878 (no (cdr yes-and-no))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14879 group newsrc entry
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14880 ;; Disable verbose message.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14881 gnus-novice-user gnus-large-newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14882 ;; Eat all arguments.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14883 (setq command-line-args-left nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14884 ;; Start Gnus.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14885 (gnus)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14886 ;; Apply kills to specified newsgroups in command line arguments.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14887 (setq newsrc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14888 (while newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14889 (setq group (caar newsrc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14890 (setq entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14891 (if (and (<= (nth 1 (car newsrc)) gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14892 (and (car entry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14893 (or (eq (car entry) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14894 (not (zerop (car entry)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14895 (if yes (string-match yes group) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14896 (or (null no) (not (string-match no group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14897 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14898 (gnus-summary-read-group group nil t nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14899 (and (eq (current-buffer) (get-buffer gnus-summary-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14900 (gnus-summary-exit))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14901 (setq newsrc (cdr newsrc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14902 ;; Exit Emacs.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14903 (switch-to-buffer gnus-group-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14904 (gnus-group-save-newsrc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14905
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14906 (defun gnus-apply-kill-file ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14907 "Apply a kill file to the current newsgroup.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14908 Returns the number of articles marked as read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14909 (if (or (file-exists-p (gnus-newsgroup-kill-file nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14910 (file-exists-p (gnus-newsgroup-kill-file gnus-newsgroup-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14911 (gnus-apply-kill-file-internal)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14912 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14913
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14914 (defun gnus-kill-save-kill-buffer ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14915 (let ((file (gnus-newsgroup-kill-file gnus-newsgroup-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14916 (when (get-file-buffer file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14917 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14918 (set-buffer (get-file-buffer file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14919 (and (buffer-modified-p) (save-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14920 (kill-buffer (current-buffer))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14921
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14922 (defvar gnus-kill-file-name "KILL"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14923 "Suffix of the kill files.")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14924
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14925 (defun gnus-newsgroup-kill-file (newsgroup)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14926 "Return the name of a kill file name for NEWSGROUP.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14927 If NEWSGROUP is nil, return the global kill file name instead."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14928 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14929 ;; The global KILL file is placed at top of the directory.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14930 ((or (null newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14931 (string-equal newsgroup ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14932 (expand-file-name gnus-kill-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14933 gnus-kill-files-directory))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14934 ;; Append ".KILL" to newsgroup name.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14935 ((gnus-use-long-file-name 'not-kill)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14936 (expand-file-name (concat (gnus-newsgroup-savable-name newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14937 "." gnus-kill-file-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14938 gnus-kill-files-directory))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14939 ;; Place "KILL" under the hierarchical directory.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14940 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14941 (expand-file-name (concat (gnus-newsgroup-directory-form newsgroup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14942 "/" gnus-kill-file-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14943 gnus-kill-files-directory))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14944
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14945
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14946 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14947 ;;; Dribble file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14948 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14949
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14950 (defvar gnus-dribble-ignore nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14951 (defvar gnus-dribble-eval-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14952
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14953 (defun gnus-dribble-file-name ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14954 "Return the dribble file for the current .newsrc."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14955 (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14956 (if gnus-dribble-directory
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14957 (concat (file-name-as-directory gnus-dribble-directory)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14958 (file-name-nondirectory gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14959 gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14960 "-dribble"))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14961
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14962 (defun gnus-dribble-enter (string)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14963 "Enter STRING into the dribble buffer."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14964 (if (and (not gnus-dribble-ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14965 gnus-dribble-buffer
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14966 (buffer-name gnus-dribble-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14967 (let ((obuf (current-buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14968 (set-buffer gnus-dribble-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14969 (insert string "\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14970 (set-window-point (get-buffer-window (current-buffer)) (point-max))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
14971 (bury-buffer gnus-dribble-buffer)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14972 (set-buffer obuf))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14973
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14974 (defun gnus-dribble-read-file ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14975 "Read the dribble file from disk."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14976 (let ((dribble-file (gnus-dribble-file-name)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14977 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14978 (set-buffer (setq gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14979 (get-buffer-create
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14980 (file-name-nondirectory dribble-file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14981 (gnus-add-current-to-buffer-list)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14982 (erase-buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14983 (setq buffer-file-name dribble-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14984 (auto-save-mode t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14985 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14986 (bury-buffer (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14987 (set-buffer-modified-p nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
14988 (let ((auto (make-auto-save-file-name))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14989 (gnus-dribble-ignore t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14990 modes)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14991 (when (or (file-exists-p auto) (file-exists-p dribble-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14992 ;; Load whichever file is newest -- the auto save file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14993 ;; or the "real" file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14994 (if (file-newer-than-file-p auto dribble-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14995 (insert-file-contents auto)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14996 (insert-file-contents dribble-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14997 (unless (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14998 (set-buffer-modified-p t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
14999 ;; Set the file modes to reflect the .newsrc file modes.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15000 (save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15001 (when (and (file-exists-p gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15002 (setq modes (file-modes gnus-current-startup-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15003 (set-file-modes dribble-file modes))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15004 ;; Possibly eval the file later.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15005 (when (gnus-y-or-n-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15006 "Auto-save file exists. Do you want to read it? ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15007 (setq gnus-dribble-eval-file t)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15008
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15009 (defun gnus-dribble-eval-file ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15010 (when gnus-dribble-eval-file
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15011 (setq gnus-dribble-eval-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15012 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15013 (let ((gnus-dribble-ignore t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15014 (set-buffer gnus-dribble-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15015 (eval-buffer (current-buffer))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15016
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15017 (defun gnus-dribble-delete-file ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15018 (when (file-exists-p (gnus-dribble-file-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15019 (delete-file (gnus-dribble-file-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15020 (when gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15021 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15022 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15023 (let ((auto (make-auto-save-file-name)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15024 (if (file-exists-p auto)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15025 (delete-file auto))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15026 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15027 (set-buffer-modified-p nil)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15028
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15029 (defun gnus-dribble-save ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15030 (when (and gnus-dribble-buffer
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15031 (buffer-name gnus-dribble-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15032 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15033 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15034 (save-buffer))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15035
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15036 (defun gnus-dribble-clear ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15037 (when (gnus-buffer-exists-p gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15038 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15039 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15040 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15041 (set-buffer-modified-p nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15042 (setq buffer-saved-size (buffer-size)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15043
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15044
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15045 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15046 ;;; Server Communication
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15047 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15048
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15049 (defun gnus-start-news-server (&optional confirm)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15050 "Open a method for getting news.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15051 If CONFIRM is non-nil, the user will be asked for an NNTP server."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15052 (let (how)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15053 (if gnus-current-select-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15054 ;; Stream is already opened.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15055 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15056 ;; Open NNTP server.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15057 (if (null gnus-nntp-service) (setq gnus-nntp-server nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15058 (if confirm
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15059 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15060 ;; Read server name with completion.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15061 (setq gnus-nntp-server
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15062 (completing-read "NNTP server: "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15063 (mapcar (lambda (server) (list server))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15064 (cons (list gnus-nntp-server)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15065 gnus-secondary-servers))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15066 nil nil gnus-nntp-server))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15067
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15068 (if (and gnus-nntp-server
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15069 (stringp gnus-nntp-server)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15070 (not (string= gnus-nntp-server "")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15071 (setq gnus-select-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15072 (cond ((or (string= gnus-nntp-server "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15073 (string= gnus-nntp-server "::"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15074 (list 'nnspool (system-name)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15075 ((string-match "^:" gnus-nntp-server)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15076 (list 'nnmh gnus-nntp-server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15077 (list 'nnmh-directory
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15078 (file-name-as-directory
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15079 (expand-file-name
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15080 (concat "~/" (substring
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15081 gnus-nntp-server 1)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15082 (list 'nnmh-get-new-mail nil)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15083 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15084 (list 'nntp gnus-nntp-server)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15085
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15086 (setq how (car gnus-select-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15087 (cond ((eq how 'nnspool)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15088 (require 'nnspool)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15089 (gnus-message 5 "Looking up local news spool..."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15090 ((eq how 'nnmh)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15091 (require 'nnmh)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15092 (gnus-message 5 "Looking up mh spool..."))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15093 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15094 (require 'nntp)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15095 (setq gnus-current-select-method gnus-select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15096 (run-hooks 'gnus-open-server-hook)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15097 (or
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15098 ;; gnus-open-server-hook might have opened it
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15099 (gnus-server-opened gnus-select-method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15100 (gnus-open-server gnus-select-method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15101 (gnus-y-or-n-p
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15102 (format
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15103 "%s (%s) open error: '%s'. Continue? "
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15104 (car gnus-select-method) (cadr gnus-select-method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15105 (gnus-status-message gnus-select-method)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15106 (gnus-error 1 "Couldn't open server on %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15107 (nth 1 gnus-select-method))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15108
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15109 (defun gnus-check-group (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15110 "Try to make sure that the server where GROUP exists is alive."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15111 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15112 (or (gnus-server-opened method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15113 (gnus-open-server method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15114
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15115 (defun gnus-check-server (&optional method silent)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15116 "Check whether the connection to METHOD is down.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15117 If METHOD is nil, use `gnus-select-method'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15118 If it is down, start it up (again)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15119 (let ((method (or method gnus-select-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15120 ;; Transform virtual server names into select methods.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15121 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15122 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15123 (if (gnus-server-opened method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15124 ;; The stream is already opened.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15125 t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15126 ;; Open the server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15127 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15128 (gnus-message 5 "Opening %s server%s..." (car method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15129 (if (equal (nth 1 method) "") ""
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15130 (format " on %s" (nth 1 method)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15131 (run-hooks 'gnus-open-server-hook)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15132 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15133 (gnus-open-server method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15134 (unless silent
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15135 (message ""))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15136
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15137 (defun gnus-get-function (method function &optional noerror)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15138 "Return a function symbol based on METHOD and FUNCTION."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15139 ;; Translate server names into methods.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15140 (unless method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15141 (error "Attempted use of a nil select method"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15142 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15143 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15144 (let ((func (intern (format "%s-%s" (car method) function))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15145 ;; If the functions isn't bound, we require the backend in
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15146 ;; question.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15147 (unless (fboundp func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15148 (require (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15149 (when (and (not (fboundp func))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15150 (not noerror))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15151 ;; This backend doesn't implement this function.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15152 (error "No such function: %s" func)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15153 func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15154
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15155
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15156 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15157 ;;; Interface functions to the backends.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15158 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15159
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15160 (defun gnus-open-server (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15161 "Open a connection to METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15162 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15163 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15164 (let ((elem (assoc method gnus-opened-servers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15165 ;; If this method was previously denied, we just return nil.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15166 (if (eq (nth 1 elem) 'denied)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15167 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15168 (gnus-message 1 "Denied server")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15169 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15170 ;; Open the server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15171 (let ((result
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15172 (funcall (gnus-get-function method 'open-server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15173 (nth 1 method) (nthcdr 2 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15174 ;; If this hasn't been opened before, we add it to the list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15175 (unless elem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15176 (setq elem (list method nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15177 gnus-opened-servers (cons elem gnus-opened-servers)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15178 ;; Set the status of this server.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15179 (setcar (cdr elem) (if result 'ok 'denied))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15180 ;; Return the result from the "open" call.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15181 result))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15182
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15183 (defun gnus-close-server (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15184 "Close the connection to METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15185 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15186 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15187 (funcall (gnus-get-function method 'close-server) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15188
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15189 (defun gnus-request-list (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15190 "Request the active file from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15191 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15192 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15193 (funcall (gnus-get-function method 'request-list) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15194
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15195 (defun gnus-request-list-newsgroups (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15196 "Request the newsgroups file from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15197 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15198 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15199 (funcall (gnus-get-function method 'request-list-newsgroups) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15200
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15201 (defun gnus-request-newgroups (date method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15202 "Request all new groups since DATE from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15203 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15204 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15205 (funcall (gnus-get-function method 'request-newgroups)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15206 date (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15207
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15208 (defun gnus-server-opened (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15209 "Check whether a connection to METHOD has been opened."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15210 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15211 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15212 (funcall (gnus-get-function method 'server-opened) (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15213
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15214 (defun gnus-status-message (method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15215 "Return the status message from METHOD.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15216 If METHOD is a string, it is interpreted as a group name. The method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15217 this group uses will be queried."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15218 (let ((method (if (stringp method) (gnus-find-method-for-group method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15219 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15220 (funcall (gnus-get-function method 'status-message) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15221
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15222 (defun gnus-request-group (group &optional dont-check method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15223 "Request GROUP. If DONT-CHECK, no information is required."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15224 (let ((method (or method (gnus-find-method-for-group group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15225 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15226 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15227 (funcall (gnus-get-function method 'request-group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15228 (gnus-group-real-name group) (nth 1 method) dont-check)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15229
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15230 (defun gnus-request-asynchronous (group &optional articles)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15231 "Request that GROUP behave asynchronously.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15232 ARTICLES is the `data' of the group."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15233 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15234 (funcall (gnus-get-function method 'request-asynchronous)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15235 (gnus-group-real-name group) (nth 1 method) articles)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15236
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15237 (defun gnus-list-active-group (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15238 "Request active information on GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15239 (let ((method (gnus-find-method-for-group group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15240 (func 'list-active-group))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15241 (when (gnus-check-backend-function func group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15242 (funcall (gnus-get-function method func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15243 (gnus-group-real-name group) (nth 1 method)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15244
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15245 (defun gnus-request-group-description (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15246 "Request a description of GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15247 (let ((method (gnus-find-method-for-group group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15248 (func 'request-group-description))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15249 (when (gnus-check-backend-function func group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15250 (funcall (gnus-get-function method func)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15251 (gnus-group-real-name group) (nth 1 method)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15252
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15253 (defun gnus-close-group (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15254 "Request the GROUP be closed."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15255 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15256 (funcall (gnus-get-function method 'close-group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15257 (gnus-group-real-name group) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15258
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15259 (defun gnus-retrieve-headers (articles group &optional fetch-old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15260 "Request headers for ARTICLES in GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15261 If FETCH-OLD, retrieve all headers (or some subset thereof) in the group."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15262 (let ((method (gnus-find-method-for-group group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15263 (if (and gnus-use-cache (numberp (car articles)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15264 (gnus-cache-retrieve-headers articles group fetch-old)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15265 (funcall (gnus-get-function method 'retrieve-headers)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15266 articles (gnus-group-real-name group) (nth 1 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15267 fetch-old))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15268
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15269 (defun gnus-retrieve-groups (groups method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15270 "Request active information on GROUPS from METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15271 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15272 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15273 (funcall (gnus-get-function method 'retrieve-groups) groups (nth 1 method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15274
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15275 (defun gnus-request-type (group &optional article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15276 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15277 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15278 (if (not (gnus-check-backend-function 'request-type (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15279 'unknown
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15280 (funcall (gnus-get-function method 'request-type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15281 (gnus-group-real-name group) article))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15282
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15283 (defun gnus-request-update-mark (group article mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15284 "Return the type (`post' or `mail') of GROUP (and ARTICLE)."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15285 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15286 (if (not (gnus-check-backend-function 'request-update-mark (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15287 mark
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15288 (funcall (gnus-get-function method 'request-update-mark)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15289 (gnus-group-real-name group) article mark))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15290
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15291 (defun gnus-request-article (article group &optional buffer)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15292 "Request the ARTICLE in GROUP.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15293 ARTICLE can either be an article number or an article Message-ID.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15294 If BUFFER, insert the article in that group."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15295 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15296 (funcall (gnus-get-function method 'request-article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15297 article (gnus-group-real-name group) (nth 1 method) buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15298
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15299 (defun gnus-request-head (article group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15300 "Request the head of ARTICLE in GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15301 (let* ((method (gnus-find-method-for-group group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15302 (head (gnus-get-function method 'request-head t)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15303 (if (fboundp head)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15304 (funcall head article (gnus-group-real-name group) (nth 1 method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15305 (let ((res (gnus-request-article article group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15306 (when res
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15307 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15308 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15309 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15310 (when (search-forward "\n\n" nil t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15311 (delete-region (1- (point)) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15312 (nnheader-fold-continuation-lines)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15313 res))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15314
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15315 (defun gnus-request-body (article group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15316 "Request the body of ARTICLE in GROUP."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15317 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15318 (funcall (gnus-get-function method 'request-body)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15319 article (gnus-group-real-name group) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15320
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15321 (defun gnus-request-post (method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15322 "Post the current buffer using METHOD."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15323 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15324 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15325 (funcall (gnus-get-function method 'request-post) (nth 1 method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15326
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15327 (defun gnus-request-scan (group method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15328 "Request a SCAN being performed in GROUP from METHOD.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15329 If GROUP is nil, all groups on METHOD are scanned."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15330 (let ((method (if group (gnus-find-method-for-group group) method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15331 (funcall (gnus-get-function method 'request-scan)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15332 (and group (gnus-group-real-name group)) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15333
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15334 (defsubst gnus-request-update-info (info method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15335 "Request that METHOD update INFO."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15336 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15337 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15338 (when (gnus-check-backend-function 'request-update-info (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15339 (funcall (gnus-get-function method 'request-update-info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15340 (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15341 info (nth 1 method))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15342
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15343 (defun gnus-request-expire-articles (articles group &optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15344 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15345 (funcall (gnus-get-function method 'request-expire-articles)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15346 articles (gnus-group-real-name group) (nth 1 method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15347 force)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15348
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15349 (defun gnus-request-move-article
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15350 (article group server accept-function &optional last)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15351 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15352 (funcall (gnus-get-function method 'request-move-article)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15353 article (gnus-group-real-name group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15354 (nth 1 method) accept-function last)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15355
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15356 (defun gnus-request-accept-article (group method &optional last)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15357 ;; Make sure there's a newline at the end of the article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15358 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15359 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15360 (when (and (not method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15361 (stringp group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15362 (setq method (gnus-group-name-to-method group)))
14485
ea5f35baa429 (gnus-request-accept-article): Make sure there's a newline at the
Richard M. Stallman <rms@gnu.org>
parents: 14484
diff changeset
15363 (goto-char (point-max))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15364 (unless (bolp)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15365 (insert "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15366 (let ((func (car (or method (gnus-find-method-for-group group)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15367 (funcall (intern (format "%s-request-accept-article" func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15368 (if (stringp group) (gnus-group-real-name group) group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15369 (cadr method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15370 last)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15371
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15372 (defun gnus-request-replace-article (article group buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15373 (let ((func (car (gnus-find-method-for-group group))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15374 (funcall (intern (format "%s-request-replace-article" func))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15375 article (gnus-group-real-name group) buffer)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15376
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15377 (defun gnus-request-associate-buffer (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15378 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15379 (funcall (gnus-get-function method 'request-associate-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15380 (gnus-group-real-name group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15381
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15382 (defun gnus-request-restore-buffer (article group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15383 "Request a new buffer restored to the state of ARTICLE."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15384 (let ((method (gnus-find-method-for-group group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15385 (funcall (gnus-get-function method 'request-restore-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15386 article (gnus-group-real-name group) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15387
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15388 (defun gnus-request-create-group (group &optional method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15389 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15390 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15391 (let ((method (or method (gnus-find-method-for-group group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15392 (funcall (gnus-get-function method 'request-create-group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15393 (gnus-group-real-name group) (nth 1 method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15394
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15395 (defun gnus-request-delete-group (group &optional force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15396 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15397 (funcall (gnus-get-function method 'request-delete-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15398 (gnus-group-real-name group) force (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15399
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15400 (defun gnus-request-rename-group (group new-name)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15401 (let ((method (gnus-find-method-for-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15402 (funcall (gnus-get-function method 'request-rename-group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15403 (gnus-group-real-name group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15404 (gnus-group-real-name new-name) (nth 1 method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15405
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15406 (defun gnus-member-of-valid (symbol group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15407 "Find out if GROUP has SYMBOL as part of its \"valid\" spec."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15408 (memq symbol (assoc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15409 (symbol-name (car (gnus-find-method-for-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15410 gnus-valid-select-methods)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15411
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15412 (defun gnus-method-option-p (method option)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15413 "Return non-nil if select METHOD has OPTION as a parameter."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15414 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15415 (setq method (gnus-server-to-method method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15416 (memq option (assoc (format "%s" (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15417 gnus-valid-select-methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15418
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15419 (defun gnus-server-extend-method (group method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15420 ;; This function "extends" a virtual server. If the server is
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15421 ;; "hello", and the select method is ("hello" (my-var "something"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15422 ;; in the group "alt.alt", this will result in a new virtual server
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15423 ;; called "hello+alt.alt".
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15424 (let ((entry
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15425 (gnus-copy-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15426 (if (equal (car method) "native") gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15427 (cdr (assoc (car method) gnus-server-alist))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15428 (setcar (cdr entry) (concat (nth 1 entry) "+" group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15429 (nconc entry (cdr method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15430
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15431 (defun gnus-server-status (method)
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15432 "Return the status of METHOD."
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15433 (nth 1 (assoc method gnus-opened-servers)))
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15434
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15435 (defun gnus-group-name-to-method (group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15436 "Return a select method suitable for GROUP."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15437 (if (string-match ":" group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15438 (let ((server (substring group 0 (match-beginning 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15439 (if (string-match "\\+" server)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15440 (list (intern (substring server 0 (match-beginning 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15441 (substring server (match-end 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15442 (list (intern server) "")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15443 gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15444
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15445 (defun gnus-find-method-for-group (group &optional info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15446 "Find the select method that GROUP uses."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15447 (or gnus-override-method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15448 (and (not group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15449 gnus-select-method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15450 (let ((info (or info (gnus-get-info group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15451 method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15452 (if (or (not info)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15453 (not (setq method (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15454 (equal method "native"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15455 gnus-select-method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15456 (setq method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15457 (cond ((stringp method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15458 (gnus-server-to-method method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15459 ((stringp (car method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15460 (gnus-server-extend-method group method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15461 (t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15462 method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15463 (cond ((equal (cadr method) "")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15464 method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15465 ((null (cadr method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15466 (list (car method) ""))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15467 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15468 (gnus-server-add-address method)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15469
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15470 (defun gnus-check-backend-function (func group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15471 "Check whether GROUP supports function FUNC."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15472 (let ((method (if (stringp group) (car (gnus-find-method-for-group group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15473 group)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15474 (fboundp (intern (format "%s-%s" method func)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15475
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15476 (defun gnus-methods-using (feature)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15477 "Find all methods that have FEATURE."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15478 (let ((valids gnus-valid-select-methods)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15479 outs)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15480 (while valids
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15481 (if (memq feature (car valids))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15482 (setq outs (cons (car valids) outs)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15483 (setq valids (cdr valids)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15484 outs))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15485
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15486
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15487 ;;;
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15488 ;;; Active & Newsrc File Handling
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15489 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15490
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15491 (defun gnus-setup-news (&optional rawfile level dont-connect)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15492 "Setup news information.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15493 If RAWFILE is non-nil, the .newsrc file will also be read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15494 If LEVEL is non-nil, the news will be set up at level LEVEL."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15495 (let ((init (not (and gnus-newsrc-alist gnus-active-hashtb (not rawfile)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15496
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15497 (when init
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15498 ;; Clear some variables to re-initialize news information.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15499 (setq gnus-newsrc-alist nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15500 gnus-active-hashtb nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15501 ;; Read the newsrc file and create `gnus-newsrc-hashtb'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15502 (gnus-read-newsrc-file rawfile))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15503
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15504 (when (and (not (assoc "archive" gnus-server-alist))
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15505 (gnus-archive-server-wanted-p))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15506 (push (cons "archive" gnus-message-archive-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15507 gnus-server-alist))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15508
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15509 ;; If we don't read the complete active file, we fill in the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15510 ;; hashtb here.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15511 (if (or (null gnus-read-active-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15512 (eq gnus-read-active-file 'some))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15513 (gnus-update-active-hashtb-from-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15514
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15515 ;; Read the active file and create `gnus-active-hashtb'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15516 ;; If `gnus-read-active-file' is nil, then we just create an empty
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15517 ;; hash table. The partial filling out of the hash table will be
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15518 ;; done in `gnus-get-unread-articles'.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15519 (and gnus-read-active-file
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15520 (not level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15521 (gnus-read-active-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15522
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15523 (or gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15524 (setq gnus-active-hashtb (make-vector 4095 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15525
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15526 ;; Initialize the cache.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15527 (when gnus-use-cache
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15528 (gnus-cache-open))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15529
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15530 ;; Possibly eval the dribble file.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15531 (and init (or gnus-use-dribble-file gnus-slave) (gnus-dribble-eval-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15532
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15533 ;; Slave Gnusii should then clear the dribble buffer.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15534 (when (and init gnus-slave)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15535 (gnus-dribble-clear))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15536
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15537 (gnus-update-format-specifications)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15538
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15539 ;; See whether we need to read the description file.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15540 (if (and (string-match "%[-,0-9]*D" gnus-group-line-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15541 (not gnus-description-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15542 (not dont-connect)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15543 gnus-read-active-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15544 (gnus-read-all-descriptions-files))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15545
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15546 ;; Find new newsgroups and treat them.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15547 (if (and init gnus-check-new-newsgroups (not level)
13694
73433c3071a5 * gnus.el (gnus-parse-headers-hook): New hook.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 13579
diff changeset
15548 (gnus-check-server gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15549 (gnus-find-new-newsgroups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15550
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15551 ;; We might read in new NoCeM messages here.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15552 (when (and gnus-use-nocem
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15553 (not level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15554 (not dont-connect))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15555 (gnus-nocem-scan-groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15556
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15557 ;; Find the number of unread articles in each non-dead group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15558 (let ((gnus-read-active-file (and (not level) gnus-read-active-file)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15559 (gnus-get-unread-articles level))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15560
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15561 (if (and init gnus-check-bogus-newsgroups
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15562 gnus-read-active-file (not level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15563 (gnus-server-opened gnus-select-method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15564 (gnus-check-bogus-newsgroups))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15565
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15566 (defun gnus-find-new-newsgroups (&optional arg)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15567 "Search for new newsgroups and add them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15568 Each new newsgroup will be treated with `gnus-subscribe-newsgroup-method.'
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15569 The `-n' option line from .newsrc is respected.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15570 If ARG (the prefix), use the `ask-server' method to query
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15571 the server for new groups."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15572 (interactive "P")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15573 (let ((check (if (or (and arg (not (listp gnus-check-new-newsgroups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15574 (null gnus-read-active-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15575 (eq gnus-read-active-file 'some))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15576 'ask-server gnus-check-new-newsgroups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15577 (unless (gnus-check-first-time-used)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15578 (if (or (consp check)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15579 (eq check 'ask-server))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15580 ;; Ask the server for new groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15581 (gnus-ask-server-for-new-groups)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15582 ;; Go through the active hashtb and look for new groups.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15583 (let ((groups 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15584 group new-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15585 (gnus-message 5 "Looking for new newsgroups...")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15586 (unless gnus-have-read-active-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15587 (gnus-read-active-file))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15588 (setq gnus-newsrc-last-checked-date (current-time-string))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15589 (unless gnus-killed-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15590 (gnus-make-hashtable-from-killed))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15591 ;; Go though every newsgroup in `gnus-active-hashtb' and compare
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15592 ;; with `gnus-newsrc-hashtb' and `gnus-killed-hashtb'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15593 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15594 (lambda (sym)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15595 (if (or (null (setq group (symbol-name sym)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15596 (not (boundp sym))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15597 (null (symbol-value sym))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15598 (gnus-gethash group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15599 (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15600 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15601 (let ((do-sub (gnus-matches-options-n group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15602 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15603 ((eq do-sub 'subscribe)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15604 (setq groups (1+ groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15605 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15606 (funcall gnus-subscribe-options-newsgroup-method group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15607 ((eq do-sub 'ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15608 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15609 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15610 (setq groups (1+ groups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15611 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15612 (if gnus-subscribe-hierarchical-interactive
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15613 (setq new-newsgroups (cons group new-newsgroups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15614 (funcall gnus-subscribe-newsgroup-method group)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15615 gnus-active-hashtb)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15616 (when new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15617 (gnus-subscribe-hierarchical-interactive new-newsgroups))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15618 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15619 (if (> groups 0)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15620 (gnus-message 6 "%d new newsgroup%s arrived."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15621 groups (if (> groups 1) "s have" " has"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15622 (gnus-message 6 "No new newsgroups.")))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15623
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15624 (defun gnus-matches-options-n (group)
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
15625 ;; Returns `subscribe' if the group is to be unconditionally
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15626 ;; subscribed, `ignore' if it is to be ignored, and nil if there is
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15627 ;; no match for the group.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15628
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15629 ;; First we check the two user variables.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15630 (cond
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15631 ((and gnus-options-subscribe
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15632 (string-match gnus-options-subscribe group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15633 'subscribe)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15634 ((and gnus-auto-subscribed-groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15635 (string-match gnus-auto-subscribed-groups group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15636 'subscribe)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15637 ((and gnus-options-not-subscribe
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15638 (string-match gnus-options-not-subscribe group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15639 'ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15640 ;; Then we go through the list that was retrieved from the .newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15641 ;; file. This list has elements on the form
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15642 ;; `(REGEXP . {ignore,subscribe})'. The first match found (the list
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15643 ;; is in the reverse order of the options line) is returned.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15644 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15645 (let ((regs gnus-newsrc-options-n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15646 (while (and regs
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15647 (not (string-match (caar regs) group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15648 (setq regs (cdr regs)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15649 (and regs (cdar regs))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15650
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15651 (defun gnus-ask-server-for-new-groups ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15652 (let* ((date (or gnus-newsrc-last-checked-date (current-time-string)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15653 (methods (cons gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15654 (nconc
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
15655 (when (gnus-archive-server-wanted-p)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15656 (list "archive"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15657 (append
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15658 (and (consp gnus-check-new-newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15659 gnus-check-new-newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15660 gnus-secondary-select-methods))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15661 (groups 0)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15662 (new-date (current-time-string))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15663 group new-newsgroups got-new method hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15664 gnus-override-subscribe-method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15665 ;; Go through both primary and secondary select methods and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15666 ;; request new newsgroups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15667 (while (setq method (gnus-server-get-method nil (pop methods)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15668 (setq new-newsgroups nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15669 (setq gnus-override-subscribe-method method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15670 (when (and (gnus-check-server method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15671 (gnus-request-newgroups date method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15672 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15673 (setq got-new t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15674 (setq hashtb (gnus-make-hashtable 100))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15675 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15676 ;; Enter all the new groups into a hashtable.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15677 (gnus-active-to-gnus-format method hashtb 'ignore))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15678 ;; Now all new groups from `method' are in `hashtb'.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15679 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15680 (lambda (group-sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15681 (if (or (null (setq group (symbol-name group-sym)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15682 (not (boundp group-sym))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15683 (null (symbol-value group-sym))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15684 (gnus-gethash group gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15685 (member group gnus-zombie-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15686 (member group gnus-killed-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15687 ;; The group is already known.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15688 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15689 ;; Make this group active.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15690 (when (symbol-value group-sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15691 (gnus-set-active group (symbol-value group-sym)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15692 ;; Check whether we want it or not.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15693 (let ((do-sub (gnus-matches-options-n group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15694 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15695 ((eq do-sub 'subscribe)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15696 (incf groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15697 (gnus-sethash group group gnus-killed-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15698 (funcall gnus-subscribe-options-newsgroup-method group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15699 ((eq do-sub 'ignore)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15700 nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15701 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15702 (incf groups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15703 (gnus-sethash group group gnus-killed-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15704 (if gnus-subscribe-hierarchical-interactive
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15705 (push group new-newsgroups)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15706 (funcall gnus-subscribe-newsgroup-method group)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15707 hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15708 (when new-newsgroups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15709 (gnus-subscribe-hierarchical-interactive new-newsgroups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15710 ;; Suggested by Per Abrahamsen <amanda@iesd.auc.dk>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15711 (when (> groups 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15712 (gnus-message 6 "%d new newsgroup%s arrived."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15713 groups (if (> groups 1) "s have" " has")))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15714 (and got-new (setq gnus-newsrc-last-checked-date new-date))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15715 got-new))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15716
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15717 (defun gnus-check-first-time-used ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15718 (if (or (> (length gnus-newsrc-alist) 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15719 (file-exists-p gnus-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15720 (file-exists-p (concat gnus-startup-file ".el"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15721 (file-exists-p (concat gnus-startup-file ".eld")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15722 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15723 (gnus-message 6 "First time user; subscribing you to default groups")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15724 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15725 (gnus-read-active-file))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15726 (setq gnus-newsrc-last-checked-date (current-time-string))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15727 (let ((groups gnus-default-subscribed-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15728 group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15729 (if (eq groups t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15730 nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15731 (setq groups (or groups gnus-backup-default-subscribed-newsgroups))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15732 (mapatoms
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15733 (lambda (sym)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15734 (if (null (setq group (symbol-name sym)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15735 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15736 (let ((do-sub (gnus-matches-options-n group)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15737 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15738 ((eq do-sub 'subscribe)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15739 (gnus-sethash group group gnus-killed-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15740 (funcall gnus-subscribe-options-newsgroup-method group))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15741 ((eq do-sub 'ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15742 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15743 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15744 (setq gnus-killed-list (cons group gnus-killed-list)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15745 gnus-active-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15746 (while groups
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15747 (if (gnus-active (car groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15748 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15749 (car groups) gnus-level-default-subscribed gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15750 (setq groups (cdr groups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15751 (gnus-group-make-help-group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15752 (and gnus-novice-user
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15753 (gnus-message 7 "`A k' to list killed groups"))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15754
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15755 (defun gnus-subscribe-group (group previous &optional method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15756 (gnus-group-change-level
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15757 (if method
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15758 (list t group gnus-level-default-subscribed nil nil method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15759 group)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15760 gnus-level-default-subscribed gnus-level-killed previous t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15761
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15762 ;; `gnus-group-change-level' is the fundamental function for changing
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15763 ;; subscription levels of newsgroups. This might mean just changing
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15764 ;; from level 1 to 2, which is pretty trivial, from 2 to 6 or back
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15765 ;; again, which subscribes/unsubscribes a group, which is equally
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15766 ;; trivial. Changing from 1-7 to 8-9 means that you kill a group, and
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15767 ;; from 8-9 to 1-7 means that you remove the group from the list of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15768 ;; killed (or zombie) groups and add them to the (kinda) subscribed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15769 ;; groups. And last but not least, moving from 8 to 9 and 9 to 8,
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15770 ;; which is trivial.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15771 ;; ENTRY can either be a string (newsgroup name) or a list (if
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15772 ;; FROMKILLED is t, it's a list on the format (NUM INFO-LIST),
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15773 ;; otherwise it's a list in the format of the `gnus-newsrc-hashtb'
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15774 ;; entries.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15775 ;; LEVEL is the new level of the group, OLDLEVEL is the old level and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15776 ;; PREVIOUS is the group (in hashtb entry format) to insert this group
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15777 ;; after.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15778 (defun gnus-group-change-level (entry level &optional oldlevel
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15779 previous fromkilled)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15780 (let (group info active num)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15781 ;; Glean what info we can from the arguments
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15782 (if (consp entry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15783 (if fromkilled (setq group (nth 1 entry))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15784 (setq group (car (nth 2 entry))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15785 (setq group entry))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15786 (if (and (stringp entry)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15787 oldlevel
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15788 (< oldlevel gnus-level-zombie))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15789 (setq entry (gnus-gethash entry gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15790 (if (and (not oldlevel)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15791 (consp entry))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15792 (setq oldlevel (gnus-info-level (nth 2 entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15793 (setq oldlevel (or oldlevel 9)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15794 (if (stringp previous)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15795 (setq previous (gnus-gethash previous gnus-newsrc-hashtb)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15796
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15797 (if (and (>= oldlevel gnus-level-zombie)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15798 (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15799 ;; We are trying to subscribe a group that is already
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15800 ;; subscribed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15801 () ; Do nothing.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15802
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15803 (or (gnus-ephemeral-group-p group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15804 (gnus-dribble-enter
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15805 (format "(gnus-group-change-level %S %S %S %S %S)"
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15806 group level oldlevel (car (nth 2 previous)) fromkilled)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15807
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15808 ;; Then we remove the newgroup from any old structures, if needed.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15809 ;; If the group was killed, we remove it from the killed or zombie
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15810 ;; list. If not, and it is in fact going to be killed, we remove
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15811 ;; it from the newsrc hash table and assoc.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15812 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15813 ((>= oldlevel gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15814 (if (= oldlevel gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15815 (setq gnus-zombie-list (delete group gnus-zombie-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15816 (setq gnus-killed-list (delete group gnus-killed-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15817 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15818 (if (and (>= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15819 entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15820 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15821 (gnus-sethash (car (nth 2 entry)) nil gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15822 (if (nth 3 entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15823 (setcdr (gnus-gethash (car (nth 3 entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15824 gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15825 (cdr entry)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15826 (setcdr (cdr entry) (cdddr entry))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15827
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15828 ;; Finally we enter (if needed) the list where it is supposed to
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15829 ;; go, and change the subscription level. If it is to be killed,
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15830 ;; we enter it into the killed or zombie list.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15831 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15832 ((>= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15833 ;; Remove from the hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15834 (gnus-sethash group nil gnus-newsrc-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15835 ;; We do not enter foreign groups into the list of dead
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15836 ;; groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15837 (unless (gnus-group-foreign-p group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15838 (if (= level gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15839 (setq gnus-zombie-list (cons group gnus-zombie-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15840 (setq gnus-killed-list (cons group gnus-killed-list)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15841 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15842 ;; If the list is to be entered into the newsrc assoc, and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15843 ;; it was killed, we have to create an entry in the newsrc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15844 ;; hashtb format and fix the pointers in the newsrc assoc.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15845 (if (< oldlevel gnus-level-zombie)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15846 ;; It was alive, and it is going to stay alive, so we
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15847 ;; just change the level and don't change any pointers or
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15848 ;; hash table entries.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15849 (setcar (cdaddr entry) level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15850 (if (listp entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15851 (setq info (cdr entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15852 num (car entry))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15853 (setq active (gnus-active group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15854 (setq num
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15855 (if active (- (1+ (cdr active)) (car active)) t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15856 ;; Check whether the group is foreign. If so, the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15857 ;; foreign select method has to be entered into the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15858 ;; info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15859 (let ((method (or gnus-override-subscribe-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15860 (gnus-group-method group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15861 (if (eq method gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15862 (setq info (list group level nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15863 (setq info (list group level nil nil method)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15864 (unless previous
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15865 (setq previous
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15866 (let ((p gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15867 (while (cddr p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15868 (setq p (cdr p)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15869 p)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15870 (setq entry (cons info (cddr previous)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15871 (if (cdr previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15872 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15873 (setcdr (cdr previous) entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15874 (gnus-sethash group (cons num (cdr previous))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15875 gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15876 (setcdr previous entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15877 (gnus-sethash group (cons num previous)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15878 gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15879 (when (cdr entry)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15880 (setcdr (gnus-gethash (caadr entry) gnus-newsrc-hashtb) entry)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15881 (when gnus-group-change-level-function
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15882 (funcall gnus-group-change-level-function group level oldlevel)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15883
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15884 (defun gnus-kill-newsgroup (newsgroup)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15885 "Obsolete function. Kills a newsgroup."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15886 (gnus-group-change-level
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15887 (gnus-gethash newsgroup gnus-newsrc-hashtb) gnus-level-killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15888
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15889 (defun gnus-check-bogus-newsgroups (&optional confirm)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15890 "Remove bogus newsgroups.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15891 If CONFIRM is non-nil, the user has to confirm the deletion of every
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15892 newsgroup."
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15893 (let ((newsrc (cdr gnus-newsrc-alist))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15894 bogus group entry info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15895 (gnus-message 5 "Checking bogus newsgroups...")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15896 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15897 (gnus-read-active-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15898 (when (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15899 ;; Find all bogus newsgroup that are subscribed.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15900 (while newsrc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15901 (setq info (pop newsrc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15902 group (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15903 (unless (or (gnus-active group) ; Active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15904 (gnus-info-method info) ; Foreign
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15905 (and confirm
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15906 (not (gnus-y-or-n-p
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15907 (format "Remove bogus newsgroup: %s " group)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15908 ;; Found a bogus newsgroup.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15909 (push group bogus)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15910 ;; Remove all bogus subscribed groups by first killing them, and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15911 ;; then removing them from the list of killed groups.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15912 (while bogus
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15913 (when (setq entry (gnus-gethash (setq group (pop bogus))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15914 gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15915 (gnus-group-change-level entry gnus-level-killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15916 (setq gnus-killed-list (delete group gnus-killed-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15917 ;; Then we remove all bogus groups from the list of killed and
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15918 ;; zombie groups. They are are removed without confirmation.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15919 (let ((dead-lists '(gnus-killed-list gnus-zombie-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15920 killed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15921 (while dead-lists
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15922 (setq killed (symbol-value (car dead-lists)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15923 (while killed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15924 (unless (gnus-active (setq group (pop killed)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15925 ;; The group is bogus.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15926 ;; !!!Slow as hell.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15927 (set (car dead-lists)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15928 (delete group (symbol-value (car dead-lists))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15929 (setq dead-lists (cdr dead-lists))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15930 (gnus-message 5 "Checking bogus newsgroups...done"))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15931
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15932 (defun gnus-check-duplicate-killed-groups ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15933 "Remove duplicates from the list of killed groups."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15934 (interactive)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15935 (let ((killed gnus-killed-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15936 (while killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15937 (gnus-message 9 "%d" (length killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15938 (setcdr killed (delete (car killed) (cdr killed)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15939 (setq killed (cdr killed)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
15940
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15941 ;; We want to inline a function from gnus-cache, so we cheat here:
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15942 (eval-when-compile
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15943 (provide 'gnus)
15669
84ad859492b2 ((provide 'gnus)): Make sure `gnus-directory' is defined
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15594
diff changeset
15944 (setq gnus-directory (or (getenv "SAVEDIR") "~/News/"))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15945 (require 'gnus-cache))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15946
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15947 (defun gnus-get-unread-articles-in-group (info active &optional update)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15948 (when active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15949 ;; Allow the backend to update the info in the group.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15950 (when (and update
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15951 (gnus-request-update-info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15952 info (gnus-find-method-for-group (gnus-info-group info))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15953 (gnus-activate-group (gnus-info-group info) nil t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15954 (let* ((range (gnus-info-read info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15955 (num 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15956 ;; If a cache is present, we may have to alter the active info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15957 (when (and gnus-use-cache info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15958 (inline (gnus-cache-possibly-alter-active
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15959 (gnus-info-group info) active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15960 ;; Modify the list of read articles according to what articles
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15961 ;; are available; then tally the unread articles and add the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15962 ;; number to the group hash table entry.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15963 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15964 ((zerop (cdr active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15965 (setq num 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15966 ((not range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15967 (setq num (- (1+ (cdr active)) (car active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15968 ((not (listp (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15969 ;; Fix a single (num . num) range according to the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15970 ;; active hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15971 ;; Fix by Carsten Bormann <cabo@Informatik.Uni-Bremen.DE>.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15972 (and (< (cdr range) (car active)) (setcdr range (1- (car active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15973 (and (> (cdr range) (cdr active)) (setcdr range (cdr active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15974 ;; Compute number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15975 (setq num (max 0 (- (cdr active) (- (1+ (cdr range)) (car range))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15976 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15977 ;; The read list is a list of ranges. Fix them according to
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15978 ;; the active hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15979 ;; First peel off any elements that are below the lower
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15980 ;; active limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15981 (while (and (cdr range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15982 (>= (car active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15983 (or (and (atom (cadr range)) (cadr range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15984 (caadr range))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15985 (if (numberp (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15986 (setcar range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15987 (cons (car range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15988 (or (and (numberp (cadr range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15989 (cadr range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15990 (cdadr range))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15991 (setcdr (car range)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15992 (or (and (numberp (nth 1 range)) (nth 1 range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15993 (cdadr range))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15994 (setcdr range (cddr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15995 ;; Adjust the first element to be the same as the lower limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15996 (if (and (not (atom (car range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15997 (< (cdar range) (car active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15998 (setcdr (car range) (1- (car active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
15999 ;; Then we want to peel off any elements that are higher
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16000 ;; than the upper active limit.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16001 (let ((srange range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16002 ;; Go past all legal elements.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16003 (while (and (cdr srange)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16004 (<= (or (and (atom (cadr srange))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16005 (cadr srange))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16006 (caadr srange)) (cdr active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16007 (setq srange (cdr srange)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16008 (if (cdr srange)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16009 ;; Nuke all remaining illegal elements.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16010 (setcdr srange nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16011
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16012 ;; Adjust the final element.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16013 (if (and (not (atom (car srange)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16014 (> (cdar srange) (cdr active)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16015 (setcdr (car srange) (cdr active))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16016 ;; Compute the number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16017 (while range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16018 (setq num (+ num (- (1+ (or (and (atom (car range)) (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16019 (cdar range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16020 (or (and (atom (car range)) (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16021 (caar range)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16022 (setq range (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16023 (setq num (max 0 (- (cdr active) num)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16024 ;; Set the number of unread articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16025 (when info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16026 (setcar (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb) num))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16027 num)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16028
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16029 ;; Go though `gnus-newsrc-alist' and compare with `gnus-active-hashtb'
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16030 ;; and compute how many unread articles there are in each group.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16031 (defun gnus-get-unread-articles (&optional level)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16032 (let* ((newsrc (cdr gnus-newsrc-alist))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16033 (level (or level gnus-activate-level (1+ gnus-level-subscribed)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16034 (foreign-level
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16035 (min
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16036 (cond ((and gnus-activate-foreign-newsgroups
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16037 (not (numberp gnus-activate-foreign-newsgroups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16038 (1+ gnus-level-subscribed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16039 ((numberp gnus-activate-foreign-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16040 gnus-activate-foreign-newsgroups)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16041 (t 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16042 level))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16043 info group active method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16044 (gnus-message 5 "Checking new news...")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16045
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16046 (while newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16047 (setq active (gnus-active (setq group (gnus-info-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16048 (setq info (pop newsrc))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16049
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16050 ;; Check newsgroups. If the user doesn't want to check them, or
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16051 ;; they can't be checked (for instance, if the news server can't
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16052 ;; be reached) we just set the number of unread articles in this
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16053 ;; newsgroup to t. This means that Gnus thinks that there are
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16054 ;; unread articles, but it has no idea how many.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16055 (if (and (setq method (gnus-info-method info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16056 (not (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16057 gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16058 (setq method (gnus-server-get-method nil method))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16059 (not (gnus-secondary-method-p method)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16060 ;; These groups are foreign. Check the level.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16061 (when (<= (gnus-info-level info) foreign-level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16062 (setq active (gnus-activate-group group 'scan))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16063 (unless (inline (gnus-virtual-group-p group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16064 (inline (gnus-close-group group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16065 (when (fboundp (intern (concat (symbol-name (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16066 "-request-update-info")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16067 (inline (gnus-request-update-info info method))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16068 ;; These groups are native or secondary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16069 (when (and (<= (gnus-info-level info) level)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16070 (not gnus-read-active-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16071 (setq active (gnus-activate-group group 'scan))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16072 (inline (gnus-close-group group))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16073
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16074 ;; Get the number of unread articles in the group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16075 (if active
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16076 (inline (gnus-get-unread-articles-in-group info active))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16077 ;; The group couldn't be reached, so we nix out the number of
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16078 ;; unread articles and stuff.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16079 (gnus-set-active group nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16080 (setcar (gnus-gethash group gnus-newsrc-hashtb) t)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16081
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16082 (gnus-message 5 "Checking new news...done")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16083
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16084 ;; Create a hash table out of the newsrc alist. The `car's of the
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16085 ;; alist elements are used as keys.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16086 (defun gnus-make-hashtable-from-newsrc-alist ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16087 (let ((alist gnus-newsrc-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16088 (ohashtb gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16089 prev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16090 (setq gnus-newsrc-hashtb (gnus-make-hashtable (length alist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16091 (setq alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16092 (setq prev (setq gnus-newsrc-alist
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16093 (if (equal (caar gnus-newsrc-alist)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16094 "dummy.group")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16095 gnus-newsrc-alist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16096 (cons (list "dummy.group" 0 nil) alist)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16097 (while alist
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16098 (gnus-sethash
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16099 (caar alist)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16100 (cons (and ohashtb (car (gnus-gethash (caar alist) ohashtb)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16101 prev)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16102 gnus-newsrc-hashtb)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16103 (setq prev alist
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16104 alist (cdr alist)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16105
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16106 (defun gnus-make-hashtable-from-killed ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16107 "Create a hash table from the killed and zombie lists."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16108 (let ((lists '(gnus-killed-list gnus-zombie-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16109 list)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16110 (setq gnus-killed-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16111 (gnus-make-hashtable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16112 (+ (length gnus-killed-list) (length gnus-zombie-list))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16113 (while (setq list (pop lists))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16114 (setq list (symbol-value list))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16115 (while list
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16116 (gnus-sethash (car list) (pop list) gnus-killed-hashtb)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16117
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16118 (defun gnus-activate-group (group &optional scan dont-check method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16119 ;; Check whether a group has been activated or not.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16120 ;; If SCAN, request a scan of that group as well.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16121 (let ((method (or method (gnus-find-method-for-group group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16122 active)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16123 (and (gnus-check-server method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16124 ;; We escape all bugs and quit here to make it possible to
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16125 ;; continue if a group is so out-there that it reports bugs
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16126 ;; and stuff.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16127 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16128 (and scan
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16129 (gnus-check-backend-function 'request-scan (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16130 (gnus-request-scan group method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16131 t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16132 (condition-case ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16133 (gnus-request-group group dont-check method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16134 ; (error nil)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16135 (quit nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16136 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16137 (set-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16138 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16139 ;; Parse the result we got from `gnus-request-group'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16140 (and (looking-at "[0-9]+ [0-9]+ \\([0-9]+\\) [0-9]+")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16141 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16142 (goto-char (match-beginning 1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16143 (gnus-set-active
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16144 group (setq active (cons (read (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16145 (read (current-buffer)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16146 ;; Return the new active info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16147 active))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16148
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16149 (defun gnus-update-read-articles (group unread)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16150 "Update the list of read and ticked articles in GROUP using the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16151 UNREAD and TICKED lists.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16152 Note: UNSELECTED has to be sorted over `<'.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16153 Returns whether the updating was successful."
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16154 (let* ((active (or gnus-newsgroup-active (gnus-active group)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16155 (entry (gnus-gethash group gnus-newsrc-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16156 (info (nth 2 entry))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16157 (prev 1)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16158 (unread (sort (copy-sequence unread) '<))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16159 read)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16160 (if (or (not info) (not active))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16161 ;; There is no info on this group if it was, in fact,
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16162 ;; killed. Gnus stores no information on killed groups, so
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16163 ;; there's nothing to be done.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16164 ;; One could store the information somewhere temporarily,
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16165 ;; perhaps... Hmmm...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16166 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16167 ;; Remove any negative articles numbers.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16168 (while (and unread (< (car unread) 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16169 (setq unread (cdr unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16170 ;; Remove any expired article numbers
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16171 (while (and unread (< (car unread) (car active)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16172 (setq unread (cdr unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16173 ;; Compute the ranges of read articles by looking at the list of
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16174 ;; unread articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16175 (while unread
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16176 (if (/= (car unread) prev)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16177 (setq read (cons (if (= prev (1- (car unread))) prev
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16178 (cons prev (1- (car unread)))) read)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16179 (setq prev (1+ (car unread)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16180 (setq unread (cdr unread)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16181 (when (<= prev (cdr active))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16182 (setq read (cons (cons prev (cdr active)) read)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16183 ;; Enter this list into the group info.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16184 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16185 info (if (> (length read) 1) (nreverse read) read))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16186 ;; Set the number of unread articles in gnus-newsrc-hashtb.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16187 (gnus-get-unread-articles-in-group info (gnus-active group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16188 t)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16189
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16190 (defun gnus-make-articles-unread (group articles)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16191 "Mark ARTICLES in GROUP as unread."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16192 (let* ((info (nth 2 (or (gnus-gethash group gnus-newsrc-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16193 (gnus-gethash (gnus-group-real-name group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16194 gnus-newsrc-hashtb))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16195 (ranges (gnus-info-read info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16196 news article)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16197 (while articles
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16198 (when (gnus-member-of-range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16199 (setq article (pop articles)) ranges)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16200 (setq news (cons article news))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16201 (when news
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16202 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16203 info (gnus-remove-from-range (gnus-info-read info) (nreverse news)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16204 (gnus-group-update-group group t))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16205
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16206 ;; Enter all dead groups into the hashtb.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16207 (defun gnus-update-active-hashtb-from-killed ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16208 (let ((hashtb (setq gnus-active-hashtb (make-vector 4095 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16209 (lists (list gnus-killed-list gnus-zombie-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16210 killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16211 (while lists
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16212 (setq killed (car lists))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16213 (while killed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16214 (gnus-sethash (car killed) nil hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16215 (setq killed (cdr killed)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16216 (setq lists (cdr lists)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16217
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16218 (defun gnus-get-killed-groups ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16219 "Go through the active hashtb and all all unknown groups as killed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16220 ;; First make sure active file has been read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16221 (unless (gnus-read-active-file-p)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16222 (let ((gnus-read-active-file t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16223 (gnus-read-active-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16224 (or gnus-killed-hashtb (gnus-make-hashtable-from-killed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16225 ;; Go through all newsgroups that are known to Gnus - enlarge kill list.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16226 (mapatoms
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16227 (lambda (sym)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16228 (let ((groups 0)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16229 (group (symbol-name sym)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16230 (if (or (null group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16231 (gnus-gethash group gnus-killed-hashtb)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16232 (gnus-gethash group gnus-newsrc-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16233 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16234 (let ((do-sub (gnus-matches-options-n group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16235 (if (or (eq do-sub 'subscribe) (eq do-sub 'ignore))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16236 ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16237 (setq groups (1+ groups))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16238 (setq gnus-killed-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16239 (cons group gnus-killed-list))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16240 (gnus-sethash group group gnus-killed-hashtb))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16241 gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16242
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16243 ;; Get the active file(s) from the backend(s).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16244 (defun gnus-read-active-file ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16245 (gnus-group-set-mode-line)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16246 (let ((methods
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16247 (append
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16248 (if (gnus-check-server gnus-select-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16249 ;; The native server is available.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16250 (cons gnus-select-method gnus-secondary-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16251 ;; The native server is down, so we just do the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16252 ;; secondary ones.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16253 gnus-secondary-select-methods)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16254 ;; Also read from the archive server.
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
16255 (when (gnus-archive-server-wanted-p)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16256 (list "archive"))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16257 list-type)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16258 (setq gnus-have-read-active-file nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16259 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16260 (set-buffer nntp-server-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16261 (while methods
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16262 (let* ((method (if (stringp (car methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16263 (gnus-server-get-method nil (car methods))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16264 (car methods)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16265 (where (nth 1 method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16266 (mesg (format "Reading active file%s via %s..."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16267 (if (and where (not (zerop (length where))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16268 (concat " from " where) "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16269 (car method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16270 (gnus-message 5 mesg)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16271 (when (gnus-check-server method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16272 ;; Request that the backend scan its incoming messages.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16273 (and (gnus-check-backend-function 'request-scan (car method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16274 (gnus-request-scan nil method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16275 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16276 ((and (eq gnus-read-active-file 'some)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16277 (gnus-check-backend-function 'retrieve-groups (car method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16278 (let ((newsrc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16279 (gmethod (gnus-server-get-method nil method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16280 groups info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16281 (while (setq info (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16282 (when (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16283 (gnus-find-method-for-group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16284 (gnus-info-group info) info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16285 gmethod)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16286 (push (gnus-group-real-name (gnus-info-group info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16287 groups)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16288 (when groups
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16289 (gnus-check-server method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16290 (setq list-type (gnus-retrieve-groups groups method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16291 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16292 ((not list-type)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16293 (gnus-error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16294 1.2 "Cannot read partial active file from %s server."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16295 (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16296 ((eq list-type 'active)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16297 (gnus-active-to-gnus-format method gnus-active-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16298 (t
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16299 (gnus-groups-to-gnus-format method gnus-active-hashtb))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16300 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16301 (if (not (gnus-request-list method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16302 (unless (equal method gnus-message-archive-method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16303 (gnus-error 1 "Cannot read active file from %s server."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16304 (car method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16305 (gnus-message 5 mesg)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16306 (gnus-active-to-gnus-format method gnus-active-hashtb)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16307 ;; We mark this active file as read.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16308 (push method gnus-have-read-active-file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16309 (gnus-message 5 "%sdone" mesg))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16310 (setq methods (cdr methods))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16311
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16312 ;; Read an active file and place the results in `gnus-active-hashtb'.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16313 (defun gnus-active-to-gnus-format (&optional method hashtb ignore-errors)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16314 (unless method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16315 (setq method gnus-select-method))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16316 (let ((cur (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16317 (hashtb (or hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16318 (if (and gnus-active-hashtb
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16319 (not (equal method gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16320 gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16321 (setq gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16322 (if (equal method gnus-select-method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16323 (gnus-make-hashtable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16324 (count-lines (point-min) (point-max)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16325 (gnus-make-hashtable 4096)))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16326 ;; Delete unnecessary lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16327 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16328 (while (search-forward "\nto." nil t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16329 (delete-region (1+ (match-beginning 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16330 (progn (forward-line 1) (point))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16331 (or (string= gnus-ignored-newsgroups "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16332 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16333 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16334 (delete-matching-lines gnus-ignored-newsgroups)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16335 ;; Make the group names readable as a lisp expression even if they
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16336 ;; contain special characters.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16337 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16338 (goto-char (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16339 (while (re-search-backward "[][';?()#]" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16340 (insert ?\\))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16341 ;; If these are groups from a foreign select method, we insert the
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16342 ;; group prefix in front of the group names.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16343 (and method (not (gnus-server-equal
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16344 (gnus-server-get-method nil method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16345 (gnus-server-get-method nil gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16346 (let ((prefix (gnus-group-prefixed-name "" method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16347 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16348 (while (and (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16349 (progn (insert prefix)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16350 (zerop (forward-line 1)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16351 ;; Store the active file in a hash table.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16352 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16353 (if (string-match "%[oO]" gnus-group-line-format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16354 ;; Suggested by Brian Edmonds <edmonds@cs.ubc.ca>.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16355 ;; If we want information on moderated groups, we use this
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16356 ;; loop...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16357 (let* ((mod-hashtb (make-vector 7 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16358 (m (intern "m" mod-hashtb))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16359 group max min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16360 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16361 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16362 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16363 (narrow-to-region (point) (gnus-point-at-eol))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16364 (setq group (let ((obarray hashtb)) (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16365 (if (and (numberp (setq max (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16366 (numberp (setq min (read cur)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16367 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16368 (skip-chars-forward " \t")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16369 (not
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16370 (or (= (following-char) ?=)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16371 (= (following-char) ?x)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16372 (= (following-char) ?j)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16373 (set group (cons min max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16374 (set group nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16375 ;; Enter moderated groups into a list.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16376 (if (eq (let ((obarray mod-hashtb)) (read cur)) m)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16377 (setq gnus-moderated-list
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16378 (cons (symbol-name group) gnus-moderated-list))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16379 (error
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16380 (and group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16381 (symbolp group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16382 (set group nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16383 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16384 (forward-line 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16385 ;; And if we do not care about moderation, we use this loop,
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16386 ;; which is faster.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16387 (let (group max min)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16388 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16389 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16390 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16391 (narrow-to-region (point) (gnus-point-at-eol))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16392 ;; group gets set to a symbol interned in the hash table
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16393 ;; (what a hack!!) - jwz
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16394 (setq group (let ((obarray hashtb)) (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16395 (if (and (numberp (setq max (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16396 (numberp (setq min (read cur)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16397 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16398 (skip-chars-forward " \t")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16399 (not
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16400 (or (= (following-char) ?=)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16401 (= (following-char) ?x)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16402 (= (following-char) ?j)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16403 (set group (cons min max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16404 (set group nil)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16405 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16406 (progn
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16407 (and group
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16408 (symbolp group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16409 (set group nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16410 (or ignore-errors
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16411 (gnus-message 3 "Warning - illegal active: %s"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16412 (buffer-substring
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16413 (gnus-point-at-bol) (gnus-point-at-eol)))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16414 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16415 (forward-line 1))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16416
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16417 (defun gnus-groups-to-gnus-format (method &optional hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16418 ;; Parse a "groups" active file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16419 (let ((cur (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16420 (hashtb (or hashtb
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16421 (if (and method gnus-active-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16422 gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16423 (setq gnus-active-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16424 (gnus-make-hashtable
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16425 (count-lines (point-min) (point-max)))))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16426 (prefix (and method
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16427 (not (gnus-server-equal
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16428 (gnus-server-get-method nil method)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16429 (gnus-server-get-method nil gnus-select-method)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16430 (gnus-group-prefixed-name "" method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16431
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16432 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16433 ;; We split this into to separate loops, one with the prefix
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16434 ;; and one without to speed the reading up somewhat.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16435 (if prefix
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16436 (let (min max opoint group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16437 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16438 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16439 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16440 (read cur) (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16441 (setq min (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16442 max (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16443 opoint (point))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16444 (skip-chars-forward " \t")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16445 (insert prefix)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16446 (goto-char opoint)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16447 (set (let ((obarray hashtb)) (read cur))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16448 (cons min max)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16449 (error (and group (symbolp group) (set group nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16450 (forward-line 1)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16451 (let (min max group)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16452 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16453 (condition-case ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16454 (if (= (following-char) ?2)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16455 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16456 (read cur) (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16457 (setq min (read cur)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16458 max (read cur))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16459 (set (setq group (let ((obarray hashtb)) (read cur)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16460 (cons min max))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16461 (error (and group (symbolp group) (set group nil))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16462 (forward-line 1))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16463
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16464 (defun gnus-read-newsrc-file (&optional force)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16465 "Read startup file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16466 If FORCE is non-nil, the .newsrc file is read."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16467 ;; Reset variables that might be defined in the .newsrc.eld file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16468 (let ((variables gnus-variable-list))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16469 (while variables
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16470 (set (car variables) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16471 (setq variables (cdr variables))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16472 (let* ((newsrc-file gnus-current-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16473 (quick-file (concat newsrc-file ".el")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16474 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16475 ;; We always load the .newsrc.eld file. If always contains
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16476 ;; much information that can not be gotten from the .newsrc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16477 ;; file (ticked articles, killed groups, foreign methods, etc.)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16478 (gnus-read-newsrc-el-file quick-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16479
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16480 (if (and (file-exists-p gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16481 (or force
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16482 (and (file-newer-than-file-p newsrc-file quick-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16483 (file-newer-than-file-p newsrc-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16484 (concat quick-file "d")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16485 (not gnus-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16486 ;; We read the .newsrc file. Note that if there if a
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16487 ;; .newsrc.eld file exists, it has already been read, and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16488 ;; the `gnus-newsrc-hashtb' has been created. While reading
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16489 ;; the .newsrc file, Gnus will only use the information it
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16490 ;; can find there for changing the data already read -
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16491 ;; ie. reading the .newsrc file will not trash the data
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16492 ;; already read (except for read articles).
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16493 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16494 (gnus-message 5 "Reading %s..." newsrc-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16495 (set-buffer (find-file-noselect newsrc-file))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16496 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16497 (gnus-newsrc-to-gnus-format)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16498 (kill-buffer (current-buffer))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16499 (gnus-message 5 "Reading %s...done" newsrc-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16500
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16501 ;; Read any slave files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16502 (unless gnus-slave
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16503 (gnus-master-read-slave-newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16504
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16505 ;; Convert old to new.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16506 (gnus-convert-old-newsrc))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16507
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16508 (defun gnus-continuum-version (version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16509 "Return VERSION as a floating point number."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16510 (when (or (string-match "^\\([^ ]+\\)? ?Gnus v?\\([0-9.]+\\)$" version)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16511 (string-match "^\\(.?\\)gnus-\\([0-9.]+\\)$" version))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16512 (let* ((alpha (and (match-beginning 1) (match-string 1 version)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16513 (number (match-string 2 version))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16514 major minor least)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16515 (string-match "\\([0-9]\\)\\.\\([0-9]+\\)\\.?\\([0-9]+\\)?" number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16516 (setq major (string-to-number (match-string 1 number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16517 (setq minor (string-to-number (match-string 2 number)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16518 (setq least (if (match-beginning 3)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16519 (string-to-number (match-string 3 number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16520 0))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16521 (string-to-number
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16522 (if (zerop major)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16523 (format "%s00%02d%02d"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16524 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16525 ((member alpha '("(ding)" "d")) "4.99")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16526 ((member alpha '("September" "s")) "5.01")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16527 ((member alpha '("Red" "r")) "5.03"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16528 minor least)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16529 (format "%d.%02d%02d" major minor least))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16530
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16531 (defun gnus-convert-old-newsrc ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16532 "Convert old newsrc into the new format, if needed."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16533 (let ((fcv (and gnus-newsrc-file-version
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16534 (gnus-continuum-version gnus-newsrc-file-version))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16535 (cond
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16536 ;; No .newsrc.eld file was loaded.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16537 ((null fcv) nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16538 ;; Gnus 5 .newsrc.eld was loaded.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16539 ((< fcv (gnus-continuum-version "September Gnus v0.1"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16540 (gnus-convert-old-ticks)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16541
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16542 (defun gnus-convert-old-ticks ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16543 (let ((newsrc (cdr gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16544 marks info dormant ticked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16545 (while (setq info (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16546 (when (setq marks (gnus-info-marks info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16547 (setq dormant (cdr (assq 'dormant marks))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16548 ticked (cdr (assq 'tick marks)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16549 (when (or dormant ticked)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16550 (gnus-info-set-read
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16551 info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16552 (gnus-add-to-range
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16553 (gnus-info-read info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16554 (nconc (gnus-uncompress-range dormant)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16555 (gnus-uncompress-range ticked)))))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16556
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16557 (defun gnus-read-newsrc-el-file (file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16558 (let ((ding-file (concat file "d")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16559 ;; We always, always read the .eld file.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16560 (gnus-message 5 "Reading %s..." ding-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16561 (let (gnus-newsrc-assoc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16562 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16563 (load ding-file t t t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16564 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16565 (gnus-error 1 "Error in %s" ding-file)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16566 (when gnus-newsrc-assoc
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16567 (setq gnus-newsrc-alist gnus-newsrc-assoc)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16568 (gnus-make-hashtable-from-newsrc-alist)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16569 (when (file-newer-than-file-p file ding-file)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16570 ;; Old format quick file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16571 (gnus-message 5 "Reading %s..." file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16572 ;; The .el file is newer than the .eld file, so we read that one
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16573 ;; as well.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16574 (gnus-read-old-newsrc-el-file file))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16575
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16576 ;; Parse the old-style quick startup file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16577 (defun gnus-read-old-newsrc-el-file (file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16578 (let (newsrc killed marked group m info)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16579 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16580 (let ((gnus-killed-assoc nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16581 gnus-marked-assoc gnus-newsrc-alist gnus-newsrc-assoc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16582 (prog1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16583 (condition-case nil
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16584 (load file t t t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16585 (error nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16586 (setq newsrc gnus-newsrc-assoc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16587 killed gnus-killed-assoc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16588 marked gnus-marked-assoc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16589 (setq gnus-newsrc-alist nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16590 (while (setq group (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16591 (if (setq info (gnus-get-info (car group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16592 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16593 (gnus-info-set-read info (cddr group))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16594 (gnus-info-set-level
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16595 info (if (nth 1 group) gnus-level-default-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16596 gnus-level-default-unsubscribed))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16597 (setq gnus-newsrc-alist (cons info gnus-newsrc-alist)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16598 (push (setq info
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16599 (list (car group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16600 (if (nth 1 group) gnus-level-default-subscribed
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16601 gnus-level-default-unsubscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16602 (cddr group)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16603 gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16604 ;; Copy marks into info.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16605 (when (setq m (assoc (car group) marked))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16606 (unless (nthcdr 3 info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16607 (nconc info (list nil)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16608 (gnus-info-set-marks
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16609 info (list (cons 'tick (gnus-compress-sequence
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16610 (sort (cdr m) '<) t))))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16611 (setq newsrc killed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16612 (while newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16613 (setcar newsrc (caar newsrc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16614 (setq newsrc (cdr newsrc)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16615 (setq gnus-killed-list killed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16616 ;; The .el file version of this variable does not begin with
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16617 ;; "options", while the .eld version does, so we just add it if it
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16618 ;; isn't there.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16619 (and
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16620 gnus-newsrc-options
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16621 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16622 (and (not (string-match "^ *options" gnus-newsrc-options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16623 (setq gnus-newsrc-options (concat "options " gnus-newsrc-options)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16624 (and (not (string-match "\n$" gnus-newsrc-options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16625 (setq gnus-newsrc-options (concat gnus-newsrc-options "\n")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16626 ;; Finally, if we read some options lines, we parse them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16627 (or (string= gnus-newsrc-options "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16628 (gnus-newsrc-parse-options gnus-newsrc-options))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16629
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16630 (setq gnus-newsrc-alist (nreverse gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16631 (gnus-make-hashtable-from-newsrc-alist)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16632
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16633 (defun gnus-make-newsrc-file (file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16634 "Make server dependent file name by catenating FILE and server host name."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16635 (let* ((file (expand-file-name file nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16636 (real-file (concat file "-" (nth 1 gnus-select-method))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16637 (if (or (file-exists-p real-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16638 (file-exists-p (concat real-file ".el"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16639 (file-exists-p (concat real-file ".eld")))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16640 real-file file)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16641
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16642 (defun gnus-newsrc-to-gnus-format ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16643 (setq gnus-newsrc-options "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16644 (setq gnus-newsrc-options-n nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16645
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16646 (or gnus-active-hashtb
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16647 (setq gnus-active-hashtb (make-vector 4095 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16648 (let ((buf (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16649 (already-read (> (length gnus-newsrc-alist) 1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16650 group subscribed options-symbol newsrc Options-symbol
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16651 symbol reads num1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16652 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16653 ;; We intern the symbol `options' in the active hashtb so that we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16654 ;; can `eq' against it later.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16655 (set (setq options-symbol (intern "options" gnus-active-hashtb)) nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16656 (set (setq Options-symbol (intern "Options" gnus-active-hashtb)) nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16657
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16658 (while (not (eobp))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16659 ;; We first read the first word on the line by narrowing and
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16660 ;; then reading into `gnus-active-hashtb'. Most groups will
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16661 ;; already exist in that hashtb, so this will save some string
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16662 ;; space.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16663 (narrow-to-region
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16664 (point)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16665 (progn (skip-chars-forward "^ \t!:\n") (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16666 (goto-char (point-min))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16667 (setq symbol
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16668 (and (/= (point-min) (point-max))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16669 (let ((obarray gnus-active-hashtb)) (read buf))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16670 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16671 ;; Now, the symbol we have read is either `options' or a group
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16672 ;; name. If it is an options line, we just add it to a string.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16673 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16674 ((or (eq symbol options-symbol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16675 (eq symbol Options-symbol))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16676 (setq gnus-newsrc-options
13949
4d9ed72b9a02 (gnus-cache-removable-articles): Renamed from gnus-cache-removeable-articles.
Karl Heuer <kwzh@gnu.org>
parents: 13732
diff changeset
16677 ;; This concating is quite inefficient, but since our
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16678 ;; thorough studies show that approx 99.37% of all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16679 ;; .newsrc files only contain a single options line, we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16680 ;; don't give a damn, frankly, my dear.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16681 (concat gnus-newsrc-options
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16682 (buffer-substring
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16683 (gnus-point-at-bol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16684 ;; Options may continue on the next line.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16685 (or (and (re-search-forward "^[^ \t]" nil 'move)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16686 (progn (beginning-of-line) (point)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16687 (point)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16688 (forward-line -1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16689 (symbol
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16690 ;; Group names can be just numbers.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16691 (when (numberp symbol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16692 (setq symbol (intern (int-to-string symbol) gnus-active-hashtb)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16693 (or (boundp symbol) (set symbol nil))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16694 ;; It was a group name.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16695 (setq subscribed (= (following-char) ?:)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16696 group (symbol-name symbol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16697 reads nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16698 (if (eolp)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16699 ;; If the line ends here, this is clearly a buggy line, so
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16700 ;; we put point a the beginning of line and let the cond
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16701 ;; below do the error handling.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16702 (beginning-of-line)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16703 ;; We skip to the beginning of the ranges.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16704 (skip-chars-forward "!: \t"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16705 ;; We are now at the beginning of the list of read articles.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16706 ;; We read them range by range.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16707 (while
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16708 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16709 ((looking-at "[0-9]+")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16710 ;; We narrow and read a number instead of buffer-substring/
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16711 ;; string-to-int because it's faster. narrow/widen is
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16712 ;; faster than save-restriction/narrow, and save-restriction
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16713 ;; produces a garbage object.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16714 (setq num1 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16715 (narrow-to-region (match-beginning 0) (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16716 (read buf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16717 (widen)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16718 ;; If the next character is a dash, then this is a range.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16719 (if (= (following-char) ?-)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16720 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16721 ;; We read the upper bound of the range.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16722 (forward-char 1)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16723 (if (not (looking-at "[0-9]+"))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16724 ;; This is a buggy line, by we pretend that
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16725 ;; it's kinda OK. Perhaps the user should be
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16726 ;; dinged?
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16727 (setq reads (cons num1 reads))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16728 (setq reads
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16729 (cons
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16730 (cons num1
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16731 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16732 (narrow-to-region (match-beginning 0)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16733 (match-end 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16734 (read buf)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16735 reads))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16736 (widen)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16737 ;; It was just a simple number, so we add it to the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16738 ;; list of ranges.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16739 (setq reads (cons num1 reads)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16740 ;; If the next char in ?\n, then we have reached the end
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16741 ;; of the line and return nil.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16742 (/= (following-char) ?\n))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16743 ((= (following-char) ?\n)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16744 ;; End of line, so we end.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16745 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16746 (t
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16747 ;; Not numbers and not eol, so this might be a buggy
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16748 ;; line...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16749 (or (eobp)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16750 ;; If it was eob instead of ?\n, we allow it.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16751 (progn
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16752 ;; The line was buggy.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16753 (setq group nil)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16754 (gnus-error 3.1 "Mangled line: %s"
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16755 (buffer-substring (gnus-point-at-bol)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16756 (gnus-point-at-eol)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16757 nil))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16758 ;; Skip past ", ". Spaces are illegal in these ranges, but
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16759 ;; we allow them, because it's a common mistake to put a
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16760 ;; space after the comma.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16761 (skip-chars-forward ", "))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16762
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16763 ;; We have already read .newsrc.eld, so we gently update the
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16764 ;; data in the hash table with the information we have just
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16765 ;; read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16766 (when group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16767 (let ((info (gnus-get-info group))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16768 level)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16769 (if info
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16770 ;; There is an entry for this file in the alist.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16771 (progn
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16772 (gnus-info-set-read info (nreverse reads))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16773 ;; We update the level very gently. In fact, we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16774 ;; only change it if there's been a status change
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16775 ;; from subscribed to unsubscribed, or vice versa.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16776 (setq level (gnus-info-level info))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16777 (cond ((and (<= level gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16778 (not subscribed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16779 (setq level (if reads
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16780 gnus-level-default-unsubscribed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16781 (1+ gnus-level-default-unsubscribed))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16782 ((and (> level gnus-level-subscribed) subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16783 (setq level gnus-level-default-subscribed)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16784 (gnus-info-set-level info level))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16785 ;; This is a new group.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16786 (setq info (list group
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16787 (if subscribed
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16788 gnus-level-default-subscribed
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16789 (if reads
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16790 (1+ gnus-level-subscribed)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16791 gnus-level-default-unsubscribed))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16792 (nreverse reads))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16793 (setq newsrc (cons info newsrc))))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16794 (forward-line 1))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16795
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16796 (setq newsrc (nreverse newsrc))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16797
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16798 (if (not already-read)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16799 ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16800 ;; We now have two newsrc lists - `newsrc', which is what we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16801 ;; have read from .newsrc, and `gnus-newsrc-alist', which is
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16802 ;; what we've read from .newsrc.eld. We have to merge these
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16803 ;; lists. We do this by "attaching" any (foreign) groups in the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16804 ;; gnus-newsrc-alist to the (native) group that precedes them.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16805 (let ((rc (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16806 (prev gnus-newsrc-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16807 entry mentry)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16808 (while rc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16809 (or (null (nth 4 (car rc))) ; It's a native group.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16810 (assoc (caar rc) newsrc) ; It's already in the alist.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16811 (if (setq entry (assoc (caar prev) newsrc))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16812 (setcdr (setq mentry (memq entry newsrc))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16813 (cons (car rc) (cdr mentry)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16814 (setq newsrc (cons (car rc) newsrc))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16815 (setq prev rc
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16816 rc (cdr rc)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16817
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16818 (setq gnus-newsrc-alist newsrc)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16819 ;; We make the newsrc hashtb.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16820 (gnus-make-hashtable-from-newsrc-alist)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16821
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16822 ;; Finally, if we read some options lines, we parse them.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16823 (or (string= gnus-newsrc-options "")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16824 (gnus-newsrc-parse-options gnus-newsrc-options))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16825
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16826 ;; Parse options lines to find "options -n !all rec.all" and stuff.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16827 ;; The return value will be a list on the form
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16828 ;; ((regexp1 . ignore)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16829 ;; (regexp2 . subscribe)...)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16830 ;; When handling new newsgroups, groups that match a `ignore' regexp
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16831 ;; will be ignored, and groups that match a `subscribe' regexp will be
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16832 ;; subscribed. A line like
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16833 ;; options -n !all rec.all
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16834 ;; will lead to a list that looks like
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16835 ;; (("^rec\\..+" . subscribe)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16836 ;; ("^.+" . ignore))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16837 ;; So all "rec.*" groups will be subscribed, while all the other
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16838 ;; groups will be ignored. Note that "options -n !all rec.all" is very
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16839 ;; different from "options -n rec.all !all".
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16840 (defun gnus-newsrc-parse-options (options)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16841 (let (out eol)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16842 (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16843 (gnus-set-work-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16844 (insert (regexp-quote options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16845 ;; First we treat all continuation lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16846 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16847 (while (re-search-forward "\n[ \t]+" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16848 (replace-match " " t t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16849 ;; Then we transform all "all"s into ".+"s.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16850 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16851 (while (re-search-forward "\\ball\\b" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16852 (replace-match ".+" t t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16853 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16854 ;; We remove all other options than the "-n" ones.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16855 (while (re-search-forward "[ \t]-[^n][^-]*" nil t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16856 (replace-match " ")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16857 (forward-char -1))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16858 (goto-char (point-min))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16859
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16860 ;; We are only interested in "options -n" lines - we
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16861 ;; ignore the other option lines.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16862 (while (re-search-forward "[ \t]-n" nil t)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16863 (setq eol
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16864 (or (save-excursion
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16865 (and (re-search-forward "[ \t]-n" (gnus-point-at-eol) t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16866 (- (point) 2)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16867 (gnus-point-at-eol)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16868 ;; Search for all "words"...
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16869 (while (re-search-forward "[^ \t,\n]+" eol t)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16870 (if (= (char-after (match-beginning 0)) ?!)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16871 ;; If the word begins with a bang (!), this is a "not"
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16872 ;; spec. We put this spec (minus the bang) and the
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16873 ;; symbol `ignore' into the list.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16874 (setq out (cons (cons (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16875 "^" (buffer-substring
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16876 (1+ (match-beginning 0))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16877 (match-end 0)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16878 'ignore) out))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16879 ;; There was no bang, so this is a "yes" spec.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16880 (setq out (cons (cons (concat "^" (match-string 0))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16881 'subscribe) out)))))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16882
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16883 (setq gnus-newsrc-options-n out))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16884
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16885 (defun gnus-save-newsrc-file (&optional force)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16886 "Save .newsrc file."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16887 ;; Note: We cannot save .newsrc file if all newsgroups are removed
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16888 ;; from the variable gnus-newsrc-alist.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16889 (when (and (or gnus-newsrc-alist gnus-killed-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16890 gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16891 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16892 (if (and (or gnus-use-dribble-file gnus-slave)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16893 (not force)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16894 (or (not gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16895 (not (buffer-name gnus-dribble-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16896 (zerop (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16897 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16898 (buffer-size)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16899 (gnus-message 4 "(No changes need to be saved)")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16900 (run-hooks 'gnus-save-newsrc-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16901 (if gnus-slave
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16902 (gnus-slave-save-newsrc)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16903 ;; Save .newsrc.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16904 (when gnus-save-newsrc-file
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16905 (gnus-message 5 "Saving %s..." gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16906 (gnus-gnus-to-newsrc-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16907 (gnus-message 5 "Saving %s...done" gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16908 ;; Save .newsrc.eld.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16909 (set-buffer (get-buffer-create " *Gnus-newsrc*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16910 (make-local-variable 'version-control)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16911 (setq version-control 'never)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16912 (setq buffer-file-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16913 (concat gnus-current-startup-file ".eld"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16914 (setq default-directory (file-name-directory buffer-file-name))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16915 (gnus-add-current-to-buffer-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16916 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16917 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16918 (gnus-message 5 "Saving %s.eld..." gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16919 (gnus-gnus-to-quick-newsrc-format)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16920 (run-hooks 'gnus-save-quick-newsrc-hook)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16921 (save-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16922 (kill-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16923 (gnus-message
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16924 5 "Saving %s.eld...done" gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16925 (gnus-dribble-delete-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16926 (gnus-group-set-mode-line)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16927
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16928 (defun gnus-gnus-to-quick-newsrc-format ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16929 "Insert Gnus variables such as gnus-newsrc-alist in lisp format."
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16930 (insert ";; Gnus startup file.\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16931 (insert ";; Never delete this file - touch .newsrc instead to force Gnus\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16932 (insert ";; to read .newsrc.\n")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16933 (insert "(setq gnus-newsrc-file-version "
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16934 (prin1-to-string gnus-version) ")\n")
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16935 (let ((variables
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16936 (if gnus-save-killed-list gnus-variable-list
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16937 ;; Remove the `gnus-killed-list' from the list of variables
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16938 ;; to be saved, if required.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16939 (delq 'gnus-killed-list (copy-sequence gnus-variable-list))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16940 ;; Peel off the "dummy" group.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16941 (gnus-newsrc-alist (cdr gnus-newsrc-alist))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16942 variable)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16943 ;; Insert the variables into the file.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16944 (while variables
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16945 (when (and (boundp (setq variable (pop variables)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16946 (symbol-value variable))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16947 (insert "(setq " (symbol-name variable) " '")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16948 (prin1 (symbol-value variable) (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16949 (insert ")\n")))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16950
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16951 (defun gnus-gnus-to-newsrc-format ()
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16952 ;; Generate and save the .newsrc file.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16953 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16954 (set-buffer (create-file-buffer gnus-current-startup-file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16955 (let ((newsrc (cdr gnus-newsrc-alist))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16956 (standard-output (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16957 info ranges range method)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16958 (setq buffer-file-name gnus-current-startup-file)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16959 (setq default-directory (file-name-directory buffer-file-name))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16960 (buffer-disable-undo (current-buffer))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16961 (erase-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16962 ;; Write options.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16963 (if gnus-newsrc-options (insert gnus-newsrc-options))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16964 ;; Write subscribed and unsubscribed.
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16965 (while (setq info (pop newsrc))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16966 ;; Don't write foreign groups to .newsrc.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16967 (when (or (null (setq method (gnus-info-method info)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16968 (equal method "native")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16969 (gnus-server-equal method gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16970 (insert (gnus-info-group info)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16971 (if (> (gnus-info-level info) gnus-level-subscribed)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16972 "!" ":"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16973 (when (setq ranges (gnus-info-read info))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16974 (insert " ")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16975 (if (not (listp (cdr ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16976 (if (= (car ranges) (cdr ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16977 (princ (car ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16978 (princ (car ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16979 (insert "-")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16980 (princ (cdr ranges)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16981 (while (setq range (pop ranges))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16982 (if (or (atom range) (= (car range) (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16983 (princ (or (and (atom range) range) (car range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16984 (princ (car range))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16985 (insert "-")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16986 (princ (cdr range)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16987 (if ranges (insert ",")))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16988 (insert "\n")))
14477
7da7619a6150 (gnus-gnus-to-newsrc-format): Turn off version-control
Richard M. Stallman <rms@gnu.org>
parents: 14359
diff changeset
16989 (make-local-variable 'version-control)
7da7619a6150 (gnus-gnus-to-newsrc-format): Turn off version-control
Richard M. Stallman <rms@gnu.org>
parents: 14359
diff changeset
16990 (setq version-control 'never)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16991 ;; It has been reported that sometime the modtime on the .newsrc
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16992 ;; file seems to be off. We really do want to overwrite it, so
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16993 ;; we clear the modtime here before saving. It's a bit odd,
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
16994 ;; though...
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16995 ;; sometimes the modtime clear isn't sufficient. most brute force:
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16996 ;; delete the silly thing entirely first. but this fails to provide
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16997 ;; such niceties as .newsrc~ creation.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16998 (if gnus-modtime-botch
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
16999 (delete-file gnus-startup-file)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17000 (clear-visited-file-modtime))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17001 (run-hooks 'gnus-save-standard-newsrc-hook)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17002 (save-buffer)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17003 (kill-buffer (current-buffer)))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17004
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17005
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17006 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17007 ;;; Slave functions.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17008 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17009
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17010 (defun gnus-slave-save-newsrc ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17011 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17012 (set-buffer gnus-dribble-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17013 (let ((slave-name
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17014 (make-temp-name (concat gnus-current-startup-file "-slave-"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17015 (write-region (point-min) (point-max) slave-name nil 'nomesg))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17016
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17017 (defun gnus-master-read-slave-newsrc ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17018 (let ((slave-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17019 (directory-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17020 (file-name-directory gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17021 t (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17022 "^" (regexp-quote
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17023 (concat
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17024 (file-name-nondirectory gnus-current-startup-file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17025 "-slave-")))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17026 t))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17027 file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17028 (if (not slave-files)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17029 () ; There are no slave files to read.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17030 (gnus-message 7 "Reading slave newsrcs...")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17031 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17032 (set-buffer (get-buffer-create " *gnus slave*"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17033 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17034 (setq slave-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17035 (sort (mapcar (lambda (file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17036 (list (nth 5 (file-attributes file)) file))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17037 slave-files)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17038 (lambda (f1 f2)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17039 (or (< (caar f1) (caar f2))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17040 (< (nth 1 (car f1)) (nth 1 (car f2)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17041 (while slave-files
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17042 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17043 (setq file (nth 1 (car slave-files)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17044 (insert-file-contents file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17045 (if (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17046 (progn
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17047 (eval-buffer (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17048 t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17049 (error
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17050 (gnus-error 3.2 "Possible error in %s" file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17051 nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17052 (or gnus-slave ; Slaves shouldn't delete these files.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17053 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17054 (delete-file file)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17055 (error nil))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17056 (setq slave-files (cdr slave-files))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17057 (gnus-message 7 "Reading slave newsrcs...done"))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17058
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17059
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17060 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17061 ;;; Group description.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17062 ;;;
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17063
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17064 (defun gnus-read-all-descriptions-files ()
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17065 (let ((methods (cons gnus-select-method
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17066 (nconc
15557
2867ce9fc2e2 Synched with Gnus 5.2.31.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15511
diff changeset
17067 (when (gnus-archive-server-wanted-p)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17068 (list "archive"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17069 gnus-secondary-select-methods))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17070 (while methods
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17071 (gnus-read-descriptions-file (car methods))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17072 (setq methods (cdr methods)))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17073 t))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17074
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17075 (defun gnus-read-descriptions-file (&optional method)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17076 (let ((method (or method gnus-select-method))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17077 group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17078 (when (stringp method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17079 (setq method (gnus-server-to-method method)))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17080 ;; We create the hashtable whether we manage to read the desc file
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17081 ;; to avoid trying to re-read after a failed read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17082 (or gnus-description-hashtb
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17083 (setq gnus-description-hashtb
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17084 (gnus-make-hashtable (length gnus-active-hashtb))))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17085 ;; Mark this method's desc file as read.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17086 (gnus-sethash (gnus-group-prefixed-name "" method) "Has read"
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17087 gnus-description-hashtb)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17088
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17089 (gnus-message 5 "Reading descriptions file via %s..." (car method))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17090 (cond
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17091 ((not (gnus-check-server method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17092 (gnus-message 1 "Couldn't open server")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17093 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17094 ((not (gnus-request-list-newsgroups method))
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17095 (gnus-message 1 "Couldn't read newsgroups descriptions")
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17096 nil)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17097 (t
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17098 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17099 (save-restriction
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17100 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17101 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17102 (when (or (search-forward "\n.\n" nil t)
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17103 (goto-char (point-max)))
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17104 (beginning-of-line)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17105 (narrow-to-region (point-min) (point)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17106 ;; If these are groups from a foreign select method, we insert the
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17107 ;; group prefix in front of the group names.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17108 (and method (not (gnus-server-equal
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17109 (gnus-server-get-method nil method)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17110 (gnus-server-get-method nil gnus-select-method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17111 (let ((prefix (gnus-group-prefixed-name "" method)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17112 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17113 (while (and (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17114 (progn (insert prefix)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17115 (zerop (forward-line 1)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17116 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17117 (while (not (eobp))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17118 ;; If we get an error, we set group to 0, which is not a
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17119 ;; symbol...
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17120 (setq group
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17121 (condition-case ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17122 (let ((obarray gnus-description-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17123 ;; Group is set to a symbol interned in this
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17124 ;; hash table.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17125 (read nntp-server-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17126 (error 0)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17127 (skip-chars-forward " \t")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17128 ;; ... which leads to this line being effectively ignored.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17129 (and (symbolp group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17130 (set group (buffer-substring
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17131 (point) (progn (end-of-line) (point)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17132 (forward-line 1))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17133 (gnus-message 5 "Reading descriptions file...done")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17134 t))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17135
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17136 (defun gnus-group-get-description (group)
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17137 "Get the description of a group by sending XGTITLE to the server."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17138 (when (gnus-request-group-description group)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17139 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17140 (set-buffer nntp-server-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17141 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17142 (when (looking-at "[^ \t]+[ \t]+\\(.*\\)")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17143 (match-string 1)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17144
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17145
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17146 ;;;
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17147 ;;; Buffering of read articles.
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17148 ;;;
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17149
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17150 (defvar gnus-backlog-buffer " *Gnus Backlog*")
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17151 (defvar gnus-backlog-articles nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17152 (defvar gnus-backlog-hashtb nil)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17153
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17154 (defun gnus-backlog-buffer ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17155 "Return the backlog buffer."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17156 (or (get-buffer gnus-backlog-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17157 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17158 (set-buffer (get-buffer-create gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17159 (buffer-disable-undo (current-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17160 (setq buffer-read-only t)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17161 (gnus-add-current-to-buffer-list)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17162 (get-buffer gnus-backlog-buffer))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17163
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17164 (defun gnus-backlog-setup ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17165 "Initialize backlog variables."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17166 (unless gnus-backlog-hashtb
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17167 (setq gnus-backlog-hashtb (make-vector 1023 0))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17168
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17169 (gnus-add-shutdown 'gnus-backlog-shutdown 'gnus)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17170
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17171 (defun gnus-backlog-shutdown ()
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17172 "Clear all backlog variables and buffers."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17173 (when (get-buffer gnus-backlog-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17174 (kill-buffer gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17175 (setq gnus-backlog-hashtb nil
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17176 gnus-backlog-articles nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17177
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17178 (defun gnus-backlog-enter-article (group number buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17179 (gnus-backlog-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17180 (let ((ident (intern (concat group ":" (int-to-string number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17181 gnus-backlog-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17182 b)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17183 (if (memq ident gnus-backlog-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17184 () ; It's already kept.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17185 ;; Remove the oldest article, if necessary.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17186 (and (numberp gnus-keep-backlog)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17187 (>= (length gnus-backlog-articles) gnus-keep-backlog)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17188 (gnus-backlog-remove-oldest-article))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17189 (setq gnus-backlog-articles (cons ident gnus-backlog-articles))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17190 ;; Insert the new article.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17191 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17192 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17193 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17194 (goto-char (point-max))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17195 (or (bolp) (insert "\n"))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17196 (setq b (point))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17197 (insert-buffer-substring buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17198 ;; Tag the beginning of the article with the ident.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17199 (gnus-put-text-property b (1+ b) 'gnus-backlog ident))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17200
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17201 (defun gnus-backlog-remove-oldest-article ()
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17202 (save-excursion
15511
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17203 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17204 (goto-char (point-min))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17205 (if (zerop (buffer-size))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17206 () ; The buffer is empty.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17207 (let ((ident (get-text-property (point) 'gnus-backlog))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17208 buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17209 ;; Remove the ident from the list of articles.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17210 (when ident
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17211 (setq gnus-backlog-articles (delq ident gnus-backlog-articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17212 ;; Delete the article itself.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17213 (delete-region
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17214 (point) (next-single-property-change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17215 (1+ (point)) 'gnus-backlog nil (point-max)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17216
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17217 (defun gnus-backlog-remove-article (group number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17218 "Remove article NUMBER in GROUP from the backlog."
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17219 (when (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17220 (gnus-backlog-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17221 (let ((ident (intern (concat group ":" (int-to-string number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17222 gnus-backlog-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17223 beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17224 (when (memq ident gnus-backlog-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17225 ;; It was in the backlog.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17226 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17227 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17228 (let (buffer-read-only)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17229 (when (setq beg (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17230 (point-min) (point-max) 'gnus-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17231 ident))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17232 ;; Find the end (i. e., the beginning of the next article).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17233 (setq end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17234 (next-single-property-change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17235 (1+ beg) 'gnus-backlog (current-buffer) (point-max)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17236 (delete-region beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17237 ;; Return success.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17238 t)))))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17239
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17240 (defun gnus-backlog-request-article (group number buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17241 (when (numberp number)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17242 (gnus-backlog-setup)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17243 (let ((ident (intern (concat group ":" (int-to-string number))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17244 gnus-backlog-hashtb))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17245 beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17246 (when (memq ident gnus-backlog-articles)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17247 ;; It was in the backlog.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17248 (save-excursion
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17249 (set-buffer (gnus-backlog-buffer))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17250 (if (not (setq beg (text-property-any
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17251 (point-min) (point-max) 'gnus-backlog
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17252 ident)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17253 ;; It wasn't in the backlog after all.
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17254 (ignore
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17255 (setq gnus-backlog-articles (delq ident gnus-backlog-articles)))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17256 ;; Find the end (i. e., the beginning of the next article).
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17257 (setq end
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17258 (next-single-property-change
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17259 (1+ beg) 'gnus-backlog (current-buffer) (point-max)))))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17260 (let ((buffer-read-only nil))
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17261 (erase-buffer)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17262 (insert-buffer-substring gnus-backlog-buffer beg end)
530d0d516a42 New version.
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents: 15297
diff changeset
17263 t)))))
13401
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17264
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17265 ;; Allow redefinition of Gnus functions.
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17266
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17267 (gnus-ems-redefine)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17268
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17269 (provide 'gnus)
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17270
178d730efae2 entered into RCS
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
diff changeset
17271 ;;; gnus.el ends here